ADC Home > Reference Library > Technical Q&As > Darwin > Hardware & Drivers >

Issues with boot time KEXT loading


Q: My KEXT loads when I hot-plug my device, so why won't it load at boot time?

A: There are a couple of reasons why this could be happening.

First, a boot time KEXT other than your own may be matching to your device, namely a KEXT with its OSBundleRequired property set. Once a driver has been matched to a device, it will stay loaded until the device is removed.

A common example of this is a composite USB device with a vendor-specific driver. The Apple composite class driver will match at boot time. (The composite class driver has to be a boot time KEXT because it is needed to boot from Mass Storage class devices.) As a result, the vendor-specific driver will not load. But, if the device is hot-plugged, all eligible drivers will then compete for the device and the vendor-specific driver will be a better match than the composite class driver.

The solution is to set the OSBundleRequired property in your Info.plist to the same value as that in the competing boot time driver.

Another possible cause is that boot time KEXT loading does stricter version and dependency checking starting in Mac OS X 10.1. Verify that the CFBundleVersion from your Info.plist and the MODULE_VERSION that you specify in the 'Build Settings' tab both have the same version number. If the version numbers don't match, you'll see an error in system.log similar to Listing 1.

Oct 23 15:40:29 localhost mach_kernel: verify_kmod(): Kmod
"com.apple.mydriver" and its property list claim different versions
(1.0.0b1 & 1.0.0b2).
Oct 23 15:40:29 localhost mach_kernel: load_kernel_extension(): load_kmod()
failed for kmod "com.apple.mydriver".
Oct 23 15:40:29 localhost mach_kernel: IOCatalogue: com.apple.mydriver
cannot be loaded.

Listing 1. verify_kmod() error.



Even after changing the MODULE_VERSION in Project Builder, it may be necessary to 'Clean' your project or even delete your build folder in the Finder before recompiling because Project Builder caches some of this information.

For more information about loading KEXTs at boot time, please see the Loading Kernel Extensions at Boot Time document.


[Jan 15, 2004]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.