【问题标题】:No kernel file specified Error On KEXT MAC Environment未指定内核文件 KEXT MAC 环境中的错误
【发布时间】:2011-10-20 09:50:11
【问题描述】:

我尝试为 USBHID 设备实现 KEXT。如果我在终端上检查它能够加载 KEXT 即
Newtok:Desktop Rasheed$ kextutil -nt SampleKextDriver.kext 未指定内核文件;使用正在运行的内核进行链接。 SampleKextDriver.kext 似乎是可加载的(包括磁盘库的链接)。
但不幸的是,我收到了上述消息。我的 plist 文件是

<?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        <plist version="1.0">
        <dict>
            <key>CFBundleDevelopmentRegion</key>
            <string>English</string>
            <key>CFBundleExecutable</key>
            <string>SampleKextDriver</string>
            <key>CFBundleIconFile</key>
            <string></string>
            <key>CFBundleIdentifier</key>
            <string>com.apple.dts.driver.SampleKextDriver</string>
            <key>CFBundleInfoDictionaryVersion</key>
            <string>6.0</string>
            <key>CFBundleName</key>
            <string>Mustahfa</string>
            <key>CFBundlePackageType</key>
            <string>KEXT</string>
            <key>CFBundleShortVersionString</key>
            <string>1.0</string>
            <key>CFBundleSignature</key>
            <string>????</string>
            <key>CFBundleVersion</key>
            <string>1</string>
            <key>IOKitPersonalities</key>
            <dict>
                <key>Device Driver</key>
                <dict>            
                    <key>bConfigurationValue</key>
                    <integer>1</integer>
                    <key>bInterfaceNumber</key>
                    <integer>0</integer>
                    <key>CFBundleIdentifier</key>
                    <string>com.apple.dts.driver.SampleKextDriver</string>
                    <key>IOMatchingCategory</key>
                    <string>com_apple_dts_driver_SampleKextDriver</string>
                    <key>IOProviderClass</key>
                    <string>IOUSBDevice</string>
                    <key>idProduct</key>
                    <integer>4389</integer>
                    <key>idVendor</key>
                    <integer>8192</integer>
                    <key>IOClass</key>
                    <string>IOService</string>
                    <key>IOProviderClass</key>
                    <string>IOUSBInterface</string>
                </dict>
            </dict>
            <key>OSBundleLibraries</key>
            <dict>
                <key>com.apple.iokit.IOHIDFamily</key>
                <string>1.6.4</string>
                <key>com.apple.kpi.iokit</key>
                <string>10.7</string>
                <key>com.apple.kpi.libkern</key>
                <string>10.7</string>
            </dict>
        </dict>
        </plist>

我不知道我在哪里做错了,我在 Mac OS X 开发方面没有太多经验。任何人都可以请建议最好的文件或一些想法

感谢您的信息...

【问题讨论】:

    标签: objective-c cocoa device-driver iokit kernel-extension


    【解决方案1】:

    1.U 在加载 kext 时不应使用 -n 选项。
    kextutil 的 -n 选项似乎只用于生成符号文件。
    kextutil 的 -t 选项在发生错误时打印失败的原因。
    有关 kextutil 的更多详细信息,您应该在 Terminal 中键入 man kextutil

    2.我建议你打开终端并输入以下命令来确定你的驱动程序所依赖的 Kexts 的版本。 (当然,您应该指定您的驱动程序需要支持的最低系统版本。)

    kextstat |grep com.apple.iokit.IOHIDFamily
    kextstat |grep com.apple.kpi.iokit
    kextstat |grep com.apple.kpi.libkern

    然后更新驱动程序 info.plist 的 OSBundleLibraries 字典。

    3.希望这对你有用。祝你有美好的一天!

    【讨论】:

      猜你喜欢
      • 2020-12-14
      • 2018-04-09
      • 2017-02-03
      • 2017-02-14
      • 2015-05-31
      • 2015-01-03
      • 2020-04-02
      • 1970-01-01
      • 2013-06-16
      相关资源
      最近更新 更多