4

我已经基于此链接http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIOKit/iokit_tutorial.html实现了一个设备驱动程序应用程序

如果我尝试在终端上加载设备($ sudo cp -R MyDriver.kext /tmp),我会收到错误消息:

No kernel file specified; using running kernel for linking.
MyDriver.kext is invalid; can't resolve dependencies.
MyDriver.kext is invalid; can't resolve dependencies.
MyDriver.kext is invalid; can't resolve dependencies.
MyDriver.kext has problems:
Validation Failures: 
    Info dictionary property value is of illegal type: 
        IOKitPersonalities->MyDriver->IOKitDebug

Authentication Failures:             File owner/permissions are incorrect (must be root:wheel, nonwritable by group/other): 
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/Info.plist
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/MacOS
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/MacOS/MyDriver
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/Resources
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/Resources/en.lproj
        /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/Resources/en.lproj/InfoPlist.strings        
Warnings: 
    Personality has no CFBundleIdentifier; the kext's identifier will be inserted when sending to the IOCatalogue: 
        MyDriver    

我的疑问是:1)什么是没有指定内核文件错误(我的应用程序错过了什么)?2)什么是MyDriver.kext 无效;无法解决依赖关系?3)我的捆绑标识符是:
CFBundleIdentifier com.MyCompany.driver.${PRODUCT_NAME:maanu}

          what is Info dictionary property value is of illegal type: 

          IOKitPersonalities->MyDriver->IOKitDebug?

          (MyDriver My application Name.)

非常感谢您的回复。

                Muhammed Musthafa
4

1 回答 1

3

首先是内核依赖。
这在驱动程序的info.plist中指定。这里 info.plist 的路径似乎是 /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/Info.plist

以下是info.plist中AppleHIDKeyboard.kext的内核依赖
(key)OSBundleLibraries<(/key)
(dict)
(key)com.apple.iokit.IOHIDFamily(/key)
(string)1.4(/string)
( key)com.apple.kpi.iokit(/key)
(string)10.0.0d2(/string)
(key)com.apple.kpi.libkern(/key)
(string)10.0.0d2(/string)
(/dict )

第二次身份验证失败:
您​​可以通过以下过程部署​​驱动程序来解决此问题。1.将 MyDriver.kext
放入您的桌面。 2.打开终端应用程序并键入下面的命令列表。 3. sudo chown -R root:wheel ~/Desktop/MyDriver.kext 4. sudo chmod -R 755 ~/Desktop/MyDriver.kext 5. mv -f ~/Desktop/MyDriver.kext /System/Library/Extensions/ 6 .触摸/系统/库/扩展/





第三个CFBundleIdentifier 警告。
我不确定这里是什么类型的问题,此警告可能会使您的驱动程序无法执行。
但是,您应该检查驱动程序的info.plist,确认您的驱动程序是否具有CFBundleIdentifier键和关联值。
此外,您还应该检查驱动程序的项目设置。

希望这对你有帮助,祝你有美好的一天!

于 2011-10-19T18:23:18.543 回答