site_archiver@lists.apple.com Delivered-To: Darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EZKutJHm7hosqeF5DbkqDt31REnyty/RotPU8XrQqFBiklBzQ9cVvufPTv6IV60vLX6gSCSpXDpfT+t6yUtVo41Xtp1ouQw98l2RU9bbDSgn/KlFk543qiakgPhG9IpmUhGFBfMpWoBmx3XEmowkXQY0ITf/ob7OSMFEgqbmV9A= Hmm, you may need to post more details about your driver to the list. i'm sure you're right - it'll be something silly.. ..but i've built the HelloIOKit project, and it exhibits the same symptoms - it loads and unloads fine, but if it's in /System/Library/Extensions/ (ie automatically loaded on boot) then it won't unload. Can't unload com.MyTutorial.driver.HelloIOKit due to - com.MyTutorial.driver.HelloIOKit: com_MyTutorial_driver_HelloIOKit has 1 instance(s) I must be doing something wrong, but i really can't think what?
From: "Herb Petschauer" <bogvardi@gmail.com> To: "Mark Stow" <markstow@hotmail.com> CC: Darwin-kernel@lists.apple.com Subject: Re: kextunload problem Date: Tue, 27 Jun 2006 08:32:30 -0700
Hard to say, at this point it will be something silly though :-)
It really depends on what it is you are actually implementing...
Good luck! -H.
On 27/06/06, Mark Stow <markstow@hotmail.com> wrote:
thanks again - sorry - I've not posted anything before! my free() calls super::free(). In an effort to find out why it's not unloading, all the life cycle functions just call super (and IOLog for some diags). any ideas why logging out and back in again would cure this kextunload fail issue?
From: "Herb Petschauer" <bogvardi@gmail.com> To: "Mark Stow" <markstow@hotmail.com> CC: Darwin-kernel@lists.apple.com Subject: Re: kextunload problem Date: Tue, 27 Jun 2006 07:37:40 -0700
Ok, top posting it is... :-)
Look at the OSObject.cpp code, I think the retain count is set to "1" in the constructor, so I would expect the release() calls to go one beyond the retain() calls.
A simple solution, does your free() method call super::free()? That's my mistake 9 times of out 10.
See also this thread: < http://lists.apple.com/archives/darwin-drivers/2006/May/msg00091.html>
hth, -H.
On 27/06/06, Mark Stow <markstow@hotmail.com> wrote:
Herb, thanks. I have some more info - The system log tells me there is one instance of my class which is why
it
can't unload. It doesn't make any difference if the firewire device is plugged in or not.
I tried overriding retain() and release(), and in both cases when kextunload fails or succeeds, release() seems to be called once more than retain().
I also noticed that if I delete the driver from system/library/extensions and reboot, so it's not loaded on boot, and then copy it back and kextload
it, kextunload will succeed.
If someone is over-retaining (and it seems to need to happen on bootup) wouldn't I see a difference in the retain() release() counts when unload fails?
From: "Herb Petschauer" < bogvardi@gmail.com> To: "Mark Stow" <markstow@hotmail.com> CC: Darwin-kernel@lists.apple.com Subject: Re: kextunload problem Date: Mon, 26 Jun 2006 09:18:45 -0700
On 26/06/06, Mark Stow <markstow@hotmail.com > wrote:
Hi - I'm having some difficulties with kextunload. I am working on a firewire device driver which derives from
IOService.
The problem seems to be that free() never gets called. However, if I log out, then log back in again, everything works fine - ie free() is called, and the driver unloads correctly. I have stripped the code down to a bare minimum of just the life cycle functions, which in turn just call into IOService. I see init(), attach() and start() being called, and then on unload stop() detach() but not free(). Any help/ideas would be appreciated!
Check your system.log, there's probably a message telling you why your kext won't unload (e.g. Couldn't unload kext (name) because there are x instances of <some class>). free() doesn't get called until the last release() (retain/release must balance) so I suspect someone is over-retaining(). Is your Firewire drive unplugged when you try and unload the kext? The /dev/disk nodes are usually left created until you unplug the device. Just a thought...
-H.
_________________________________________________________________ Windows Live™ Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb
_________________________________________________________________ The new MSN Search Toolbar now includes Desktop search! http://join.msn.com/toolbar/overview
Windows Live™ Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On 28/06/06, Mark Stow <markstow@hotmail.com> wrote: This email sent to site_archiver@lists.apple.com
participants (1)
-
Herb Petschauer