Re: How to tell when all kexts are loaded
Re: How to tell when all kexts are loaded
- Subject: Re: How to tell when all kexts are loaded
- From: Peter Lovell <email@hidden>
- Date: Sat, 26 Nov 2005 10:22:32 -0500
On Nov 25, 2005, at 6:30 PM, Carl Smith wrote:
I have a carbon app that is dependent on an NKE that I install at
startup time. I had all this working fine for 10.3 but now that I
am getting the bugs out for 10.4 I find that 10.4 takes a longer
time to load all the kexts and what every else the OS needs to get
started.
My main problem is that my App starts before my kext, I have my app
loaded into ‘Login Items’ and the I load my kext by using the
prescribed method from apple i.e. “ System Startup Programming
Topics”, which includes my StartupParameters.plist, my executable
script and so on.
In 10.3 I just put in a wait(10) call in my app and that seemed to
take care of waiting for any 10.3 machine to load my kext. Now that
it takes longer in 10.4 I realize what I really need is some way
for my app to know if the OS is finished with all it’s startup
loading then my app can try and connect to my kext.
Is there some call or set of methods where my app can tell if all
the kexts have been loaded?
Thanks for any information or input ahead of time.
Carl
Hi Carl,
there are a couple of ways.
Assuming that you want your kext to load during boot, and not later
(requires root access then, which can cause other issues), the best
is for your app to wait until the kext is loaded. If it's IOKit then
use IOKit mechanisms for this. If not (as I suspect) then look at ADC
documentation for kern_control and kern_events <http://
developer.apple.com/documentation/Darwin/Reference/KPI_Reference/
index.html>
Basically you need to wait for the kext to make available some agreed-
upon resource (such as a control socket), or wait for a kext-
generated event.
The cheesy hack solution if you're just interested in getting
something going quickly and it's not for production, is to execute
"kmodstat" and see if the output contains your kext. You don't need
to be root to get this list.
Also note that the schemes for starting kexts etc at boot time have
changed for Tiger. The old ones still work but will be going away
sometime. The new capabilities may also be an easy solution to your
problem (I'm not very familiar with the details, I just know that
there are new capabilities). Have a look for "launchd" in ADC
documentation - that's what is the driving force behind the new scheme.
Regards.....Peter _______________________________________________
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