Re: Help! Can't get kext to load at boot...
Re: Help! Can't get kext to load at boot...
- Subject: Re: Help! Can't get kext to load at boot...
- From: Brad Post <email@hidden>
- Date: Sat, 04 Oct 2003 16:19:31 -0700
Well I did exactly that, and it works ... Almost.
I created the base classes using the IOKit example, and placed my start code
in the ::start method and the stop code in the ::stop method.
Things work if I load the kext manually and unload it manually. Also I can
boot up with the kext in the Extensions folder and it loads correctly too.
But, if I try and unload the kext manually after I have booted, the machine
kernel panics... I'm at home, so I don't have access to my two machine
setup, so I won't know more till I get to work, but do you guys have any
ideas off the top of your head?
Thanks.
Brad
>
From: Dean Reece <email@hidden>
>
Date: Fri, 3 Oct 2003 17:41:45 -0700
>
To: Brad Post <email@hidden>, Nathan Slingerland
>
<email@hidden>
>
Cc: email@hidden
>
Subject: Re: Help! Can't get kext to load at boot...
>
>
This technique is best used only for KEXTs that need to load prior to
>
root being mounted. KEXTs that can wait until after root mounts and
>
the system goes "multiuser" should be loaded by a startup item (or
>
similar daemon-type-thing) using kextload. For kexts that only need to
>
load because of some user action, they should be loaded via kextload
>
from the appropriate code path. For example, filesystems are loaded at
>
the point that mount is run. We really want to keep the kext space
>
free of kexts that load just because they happen to be there.
>
>
Also, it is worth pointing out that using this technique makes you into
>
an IOKit kext, and so you'll need to make sure your XCode settings are
>
correct and you'll have to create at least one C++ class (a subclass of
>
IOService). The ::start() method is where you'll do the stuff that
>
would have been in your module_start() function, and ::stop() is where
>
your module_stop() functionality would go.
>
>
The OSBundleRequired property is usually not required and you should
>
not include it unless you need to. Cases where you would need this are
>
if your kext must be loaded prior to root mounting, or if your kext
>
must be loaded even during safe boot. The legal values are documented
>
at
>
http://developer.apple.com/documentation/Darwin/Conceptual/howto/
>
kext_tutorials/loading_kexts/loading_kexts.html
>
>
Cheers,
>
- Dean
>
>
>
>
On Friday, October 3, 2003, at 04:51 PM, Nathan Slingerland wrote:
>
>
> Hi Brad,
>
>
>
> I believe the CHUD kexts have similar requirements to your kext - we
>
> want our kexts to be loaded at boot time (actually at some point we
>
> will change this so that they are loaded on demand so as not to waste
>
> wired memory, but for now...) but don't actually match to any hardware
>
> device.
>
>
>
> Our Info.plist contains the following relevant fields (especially note
>
> the IOProviderClass and IOResourceMatch fields). Note that you do not
>
> to specify the OSBundleRequired characteristic to get the kexts to
>
> load at boot time (this only ensures that they will load even in safe
>
> mode). The tutorial at
>
> http://developer.apple.com/documentation/Darwin/Conceptual/howto/
>
> kext_tutorials/hello_iokit/hello_iokit.html talks about some of these
>
> fields in more detail.
>
>
>
> <key>IOKitPersonalities</key>
>
> <dict>
>
> <key>FirstPersonality</key>
>
> <dict>
>
> <key>CFBundleIdentifier</key>
>
> <string>com.apple.iokit.CHUDUtils</string>
>
> <key>IOClass</key>
>
> <string>CHUDUtils</string>
>
> <key>IOMatchCategory</key>
>
> <string>CHUDUtils</string>
>
> <key>IOProviderClass</key>
>
> <string>IOResources</string>
>
> <key>IOResourceMatch</key>
>
> <string>IOKit</string>
>
> <key>IOUserClientClass</key>
>
> <string>CHUDUtilsUserClient</string>
>
> </dict>
>
> </dict>
>
> <key>OSBundleLibraries</key>
>
> <dict>
>
> <key>com.apple.kernel.bsd</key>
>
> <string>6.0</string>
>
> <key>com.apple.kernel.iokit</key>
>
> <string>6.0</string>
>
> <key>com.apple.kernel.mach</key>
>
> <string>6.0</string>
>
> </dict>
>
>
>
>
>
> --
>
> Nathan Slingerland
>
> Architecture and Performance Group
>
> Apple Computer, Inc.
>
>
>
>
>
>
>
> On Oct 3, 2003, at 4:25 PM, Brad Post wrote:
>
>
>
>> I'm at my wits end. I have tried everything to get my kext to load
>
>> at boot
>
>> time and it's not working, so I am hoping someone can help me.
>
>>
>
>> I've got the following set in the Info.plist
>
>>
>
>> OSBundleLibraries
>
>> com.apple.kernel.bsd = 1.1
>
>> com.apple.kernel.mach = 1.1
>
>> com.apple.kernel.libkern = 1.1
>
>>
>
>> OSBundleRequired = Root
>
>>
>
>> I have tried using kextcache and it reports no errors, it's just
>
>> after I
>
>> reboot the kext doesn't.
>
>>
>
>> I have tried the simple generic kext as well and it doesn't work, so
>
>> can
>
>> someone help?
>
>>
>
>> I need to be able to support 10.2 and later, so I am still using
>
>> Project
>
>> Builder...
>
>>
>
>> Thanks.
>
>>
>
>> Brad
>
>> _______________________________________________
>
>> darwin-kernel mailing list | email@hidden
>
>> Help/Unsubscribe/Archives:
>
>> http://www.lists.apple.com/mailman/listinfo/darwin-kernel
>
>> Do not post admin requests to the list. They will be ignored.
>
> _______________________________________________
>
> darwin-kernel mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/darwin-kernel
>
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.