使用 Xcode 创建的设备驱动程序无法加载

发布于 2024-12-10 17:34:32 字数 2664 浏览 1 评论 0原文

我已经基于此链接实现了设备驱动程序应用程序 https://developer.apple.com/library/archive/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}
    

    什么是Info字典属性值是非法类型:

    IOKitPersonalities->MyDriver->IOKitDebug?

    (MyDriver 我的应用程序名称。)

I have implemented a Device Driver Application based on this link https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIOKit/iokit_tutorial.html

If I try to load Device on Terminal($ sudo cp -R MyDriver.kext /tmp) I get the error:

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    

My Doubts are:

  1. What is No Kernel file specified Error (what have I missed on my application)?

  2. What is MyDriver.kext is invalid; can't resolve dependencies?

  3. My Bundle Identifier is:

     <key>CFBundleIdentifier</key>
     <string>com.MyCompany.driver.${PRODUCT_NAME:maanu}</string>
    

    what is Info dictionary property value is of illegal type:

    IOKitPersonalities->MyDriver->IOKitDebug?

    (MyDriver My application Name.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

临走之时 2024-12-17 17:34:33

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

这里info.plist的路径 以下是info.plist中AppleHIDKeyboard.kext的内核依赖
(key)OSBundleLibraries<(/key)
(字典)
(key)com.apple.iokit.IOHIDFamily(/key)
(字符串)1.4(/字符串)
(key)com.apple.kpi.iokit(/key)
(字符串)10.0.0d2(/字符串)
(key)com.apple.kpi.libkern(/key)
(字符串)10.0.0d2(/字符串)

(/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.触摸 /System/Library/Extensions/

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

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

First kernel dependencies.
This is specified in the info.plist of your driver.
Here the path to info.plist seems to be /Users/Rasheed/Library/Developer/Xcode/DerivedData/MyDriver-gdmnlqdybpdwzyanoeludcalqwba/Build/Products/Debug/MyDriver.kext/Contents/Info.plist

The following is the kernel dependencies of AppleHIDKeyboard.kext in the info.plist
(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)

Second Authentication Failures:
U can solve this issue by the following procedure to deployment your driver.
1.place MyDriver.kext in your Desktop.
2.open the Terminal app and type commands list below.
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.touch /System/Library/Extenstions/

Third CFBundleIdentifier warning.
I am not sure what type of issue here, this warning may make your driver unexecutable.
However, u should check your driver's info.plist, confirm whether your driver has the CFBundleIdentifier key and the associate value.
Besides, u should also check the driver's project settings.

Hope this is helpful to u, have a good day!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文