No kernel file specified Error On KEXT MAC Environment
-
27-10-2019 - |
Question
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...
Solution
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!