• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Can a Kext Unload Itself?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can a Kext Unload Itself?


  • Subject: Re: Can a Kext Unload Itself?
  • From: Dean Reece <email@hidden>
  • Date: Sat, 3 Feb 2007 23:52:21 -0800

On Feb 3, 2007, at 10:46 PM, Jones Curtis wrote:
Is there an acceptable way for a kext to unload itself without any external help (like a socket to a user process that actually calls kextunload)?

IOKit KEXTs can arrange to be unloaded by simply having the instance counts of all their classes go to zero. A short time after this happens, the kext will be unloaded.


For non-IOKit KEXTs there isn't a good way to do this today. The problem is that your kext can't call into a function to cause itself to unload, because the kext will still need to be around to execute the return path. I suppose we could invent a non-returning unload function that terminated the thread it was called on. Frankly, the question has never come up as far as I know. I guess if you need a helper to load, having a helper to unload seems natural enough that nobody has asked before.

Go ahead and write up an enhancement request if you think this is something you'd like to see added for a future release.

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


References: 
 >Can a Kext Unload Itself? (From: Jones Curtis <email@hidden>)

  • Prev by Date: Can a Kext Unload Itself?
  • Next by Date: Re: Debugging Proprietary KEXTs
  • Previous by thread: Can a Kext Unload Itself?
  • Next by thread: Easy mbuf_pullup Question (I hope)
  • Index(es):
    • Date
    • Thread