我必须将现有的驱动程序转换为OSx10.11(Previous Question)。
我已将已弃用和已删除的类和方法替换为10.11中引入的新类和方法。现在kext已成功构建但无法加载驱动程序。
发出命令OSBundleLibraries
后kextlibs -xml driver.kext
已更新。
<key>OSBundleLibraries</key>
<dict>
<key>com.apple.driver.IOBluetoothHIDDriver</key>
<string>4.4d69</string>
<key>com.apple.driver.usb.IOUSBHostHIDDevice</key>
<string>1.0</string>
<key>com.apple.iokit.IOHIDFamily</key>
<string>2.0</string>
<key>com.apple.iokit.IOUSBHostFamily</key>
<string>1.0</string>
<key>com.apple.kpi.bsd</key>
<string>15.0</string>
<key>com.apple.kpi.iokit</key>
<string>15.0</string>
<key>com.apple.kpi.libkern</key>
<string>15.0</string>
<key>com.apple.kpi.mach</key>
<string>15.0</string>
</dict>
此外,向-all
提供kextlibs
表示未找到20个符号。请在下面找到该命令的相关部分结果。
22 symbols not found in any library kext:
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice5Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice17Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice0Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice14Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice9Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice11Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice4Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice18Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice8Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice15Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice3Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice12Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice7Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice19Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice2Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice16Ev
__ZN20IOBluetoothHIDDriver31_RESERVEDIOBluetoothHIDDriver12Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice13Ev
__ZN20IOBluetoothHIDDriver31_RESERVEDIOBluetoothHIDDriver11Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice6Ev
__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice1Ev
__ZN18IOUSBHostHIDDevice29_RESERVEDIOUSBHostHIDDevice10Ev
kextutil提供了以下输出
sudo kextutil -n -print-diagnostics prdt.kext
kxld[com.comp.driver.prdt]: The super class vtable 'vtable for IOBluetoothHIDDriver' for vtable 'vtable for com_MadCatz_driver_bt_RATTe' is out of date. Make sure your kext has been built against the correct headers.
kxld[com.comp.driver.prdt]: The super class vtable 'vtable for IOBluetoothHIDDriver' for vtable 'vtable for com_MadCatz_driver_bt_RATTe' is out of date. Make sure your kext has been built against the correct headers.
kxld[com.comp.driver.prdt]: The vtable for com_comp_driver_usb_prdt was not patched because its parent, the vtable for IOUSBHostHIDDevice, was not found.
Link failed (error code 5).
Check library declarations for your kext with kextlibs(8).
应该采取什么措施来纠正缺失的符号?如何找到符号所在的位置?
任何与此问题有关的想法都受到高度赞赏,因为我无法弄清楚如何继续。
此外,__ZN18
,28_
等在__ZN18IOUSBHostHIDDevice28_RESERVEDIOUSBHostHIDDevice5Ev
中代表什么?有没有办法跟踪未知符号所在的代码行
******以添加其他信息******
从kextlibs
结果(上面列出的)中删除和排序缺失的符号
IOUSBHostHIDDevice::_RESERVEDIOUSBHostHIDDevice0();
IOUSBHostHIDDevice::_RESERVEDIOUSBHostHIDDevice1();
IOUSBHostHIDDevice::_RESERVEDIOUSBHostHIDDevice2();
.
.
.
IOUSBHostHIDDevice::_RESERVEDIOUSBHostHIDDevice17();
IOUSBHostHIDDevice::_RESERVEDIOUSBHostHIDDevice18();
IOUSBHostHIDDevice::_RESERVEDIOUSBHostHIDDevice19();
IOBluetoothHIDDriver::_RESERVEDIOBluetoothHIDDriver11();
IOBluetoothHIDDriver::_RESERVEDIOBluetoothHIDDriver12();
似乎RESERVEDIOUSBHostHIDDevice
IOKit/usb/IOUSBHostHIDDevice.h
(上面列出的)
//From IOUSBHostHIDDevice.h
// Protected pad slots for future expansion
OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 0);
OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 1);
OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 2);
.
.
// Public pad slots for future expansion
OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 10);
.
.
OSMetaClassDeclareReservedUnused(IOUSBHostHIDDevice, 19);
但RESERVEDIOBluetoothHIDDriver
在IOBluetoothHIDDriver.h
中声明了
OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 0 );
OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 1 );
.
.
.
OSMetaClassDeclareReservedUnused( IOBluetoothHIDDriver, 19 );
已声明有趣的是,只有_RESERVEDIOBluetoothHIDDriver11()
和_RESERVEDIOBluetoothHIDDriver12()
是唯一与内核不匹配的方法,即使在{{1}中声明了1到19 }。
其中IOBluetoothHIDDriver.h
是在OSMetaClassDeclareReservedUnused
中声明为
OSMetaClass.h