未指定内核文件 KEXT MAC 环境中出现错误
我尝试为 USBHID 设备实现 KEXT。如果我在终端上检查它能够加载 KEXT ie
Newtok:桌面 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 开发方面没有太多经验。任何人都可以建议最好的文件或一些想法
感谢您的信息...
I try implement KEXT for USBHID Device. If i am checking on Terminal It able to load KEXT ie
Newtok:Desktop Rasheed$ kextutil -nt SampleKextDriver.kext
No kernel file specified; using running kernel for linking.
SampleKextDriver.kext appears to be loadable (including linkage for on-disk libraries).
But Unfortunately I Got the above Message. My plist File is
<?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>
I don't know where i Did Wrong ,I do not have much experience in Mac OS X development. Can anyone please suggest the best documents or some Idea
Thanks for your information...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1.加载 kext 时不应使用 -n 选项。
kextutil 的 -n 选项似乎仅用于生成符号文件。
kextutil 的 -t 选项在发生错误时打印失败原因。
有关kextutil的更多详细信息,您应该在终端中输入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.希望这对你有用。祝你有美好的一天!
1.U should not using -n option when loading your kext.
The -n option for kextutil seems used to generate the symbol file only.
The -t option for kextutil print the failed reason when error occurs.
For more details about kextutil, u should type man kextutil in the Terminal.
2.I suggest u to open the Terminal and type follow commands to determine the version of the Kexts your driver depends on. (Of course, u should specify the lowest version of the system your driver needs to support.)
kextstat |grep com.apple.iokit.IOHIDFamily
kextstat |grep com.apple.kpi.iokit
kextstat |grep com.apple.kpi.libkern
then update the OSBundleLibraries dictionary of your driver's info.plist.
3.Hope this is useful for u. Have a good day!