Re: NKE does kextload successfully, but does not load at startup time
Re: NKE does kextload successfully, but does not load at startup time
- Subject: Re: NKE does kextload successfully, but does not load at startup time
- From: Dean Reece <email@hidden>
- Date: Mon, 14 Nov 2005 20:37:24 -0800
On Nov 14, 2005, at 6:27 PM, Terry Lambert wrote:
On Nov 14, 2005, at 4:52 PM, Michael Dautermann wrote:
I have two NKE's... one for 10.3 and one for 10.4, and both of
them load with no complaints when doing a "sudo kextload -t" on
their respective systems.
After copying them into "/System/Library/Extensions", the driver
doesn't get picked up and loaded at boot time.
/var/log/system.log shows no complaints at all (it'd be useful
if it did... should that be a feature request for Radar?)
The system does not automatically load network kernel extensions.
If there is a driver that matches hardware according to IOKits
matching rules, IOKit will load it automatically. Since this is a
network kernel extension and not an IOKit driver, it must be
loaded manually. If you need to load at startup, you can use a
startup script. If you need to be loaded only while some
application is running, the application can use kextload to load
the kext.
groovy. thanks for the response, Josh.
It doesn't make intuitive sense to me why only certain kexts in /
System/Library/Extensions would get loaded and others not, but I
don't make the rules. :-)
Using "kextload" in a startup shell script would mean it's okay to
load the NKE from anywhere (outside of the extensions folder) on
disk I want, right?
You can make your kext "required" by adding:
<key>OSBundleRequired</key>
<string>Root</string>
to it's Info.plist file. It will then be loaded at system startup
time.
This is not correct. The common confusion here is the difference
between "available for loading" and loaded. Adding this key makes
your kext AVAILABLE prior to root being mounted, but something in the
kernel has to explicitly ask for your kext by CFBundleIdentifier
before it will be linked/relocated/started etc. This property is
presently meaningless for non-IOKit kexts since only IOKit ever makes
load requests at this early stage. In fact, it's presence on non-
IOKit drivers slightly hurts boot-time performance, since the
additional (unused) kext is included in the kext cache.
http://developer.apple.com/documentation/Darwin/Conceptual/
KEXTConcept/KEXTConceptLoading/loading_kexts.html
Yes, this is a good document that covers the basics. One important
design criteria to keep in mind is that we did not want to load a
kext just because it is there. We felt it was very important that a
kext load only when requested by name. This is an inconvenience for
non-IOKit kext developers, but it encourages the developer to think
about what events trigger the need for the kext and load it only on
that path. For example, the filesystem kexts are typically loaded
from their associated mount command (and ideally are unloaded from
their umount command). This helps ensure the minimum necessary set
of kexts are loaded at any point in time.
Cheers,
- Dean
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden