Darwin kernel extensions (KEXT) are modules that provide aditional functionality to the kernel, e.g., in the form of device drivers. Minimal set of kexts neededThe kernel cannot boot at all (crashes) if there is not at least a certain set of KEXTs present. The minimal set of KEXTs required to boot Darwin 9 from USB appears to be:
This should get the system booting from USB (At the very least, it should go beyond the "Got boot device" phase, so that no message "Still waiting for boot device..." appears). Installing kextsCopy the KEXT to $VOLUME/System/Library/Extensions/ and fix permissions (important): chown -R root:wheel $VOLUME/System/Library/Extensions/ chmod -R 755 $VOLUME/System/Library/Extensions/ Determining kext dependenciesThe minimal set of KEXTs above cannot, for example, boot from a CD, since the CD driver is not there. Hence, if we want to boot from CD, for example, we need to install the CD driver KEXT and its dependencies. Thus, we need to identify the dependencies. In order to determine the dependencies of a KEXT, we can use kextlibs. Example: kextlibs $VOLUME/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBCDC.kext com.apple.kpi.libkern = 9.2.2 com.apple.kpi.iokit = 9.2.2 com.apple.iokit.IOUSBFamily = 3.0.8 So in this example, AppleUSBCDC.kext has three dependencies. To see which KEXT satisfies a dependency (aka dependents), use kextfind: kextfind -case-insensitive -bundle-id -substring 'com.apple.iokit.IOUSBFamily' -print /System/Library/Extensions/IOUSBFamily.kext Of course, IOUSBFamily.kext itself has its own dependencies, so we need to make that recursive if we want to find out all dependencies. A visual overview of dependenciesTake a look at Visualize KEXTs dependencies page. Extensions.mkextA cache of installed KEXTs is kept in order to speed up boot time. Unpack Extensions.mkextExtensions.mkext can be unpacked with the mkextunpack command: mkextunpack -v -d /tmp/Extensions Extensions.mkext Force cache updateNormally, Extensions.mkext is updated whenever we add or remove extensions using the Finder on a Mac OS X system. However, if you install an extension as a plug-in of another (a subfolder into $VOLUME/System/Library/Extensions), the automatic cache updater is not triggered. To force cache update, simply change the modification date of $VOLUME/System/Library/Extensions: touch $VOLUME/System/Library/Extensions |
The goal of this project is to make Darwin more usable by providing an installation ISO, documentation, and add-on software. You are welcome to join #puredarwin on irc.freenode.net if you would like to join PureDarwin development and to add to this site.