Re: Re (5): Baffled
Re: Re (5): Baffled
- Subject: Re: Re (5): Baffled
- From: Eric Long <email@hidden>
- Date: Fri, 14 Feb 2003 11:19:10 -0800
>
I think the problem is that you are trying to use the module start/stop
>
entry points AND have an I/O Kit driver in the same kext. This isn't
>
supported, because the C++ runtime hijacks the module start/stop entry
>
points in order to setup your kext's classes. This is the primary
>
difference between the "IOKit Driver" and "Generic Kernel Extension"
>
project templates in ProjectBuilder.
I suspected this was involved. The puzzlement is that I was able to use the
extension for a long time without this problem appearing. Originally, the
extension had no IOKit code. It was just the basic NKE. Later, I added
code to interface with a client app and to allow me to use lots of helpful
IOKit classes in parsing XML preference data passed to me.
Somehow, it worked. Until I trashed the original build folder to build from
scratch, things were peachy.
>
1) Split your kext into two - one I/O Kit driver, and one generic kext.
>
2) Relocate the code from your module start/stop routines into init()
>
and free(), or someplace similar. Be aware that init & free will be
>
called once for each instance of your class, rather than just once like
>
module start/stop. This is probably the best choice if you can adapt
>
your setup teardown code.
>
3) You may be able to provide a static initializer/destructor with your
>
class that will be called at module start/stop time. I'll have to
>
check to see if this is possible, as I've not tried to do it myself.
I'll check that out.
Thanks for clearing things up.
Eric
_______________________________________________
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.