Re: How to detect Mac OS X version from a kext
Re: How to detect Mac OS X version from a kext
- Subject: Re: How to detect Mac OS X version from a kext
- From: Michael Smith <email@hidden>
- Date: Sun, 17 Jun 2007 11:46:24 -0700
On Jun 16, 2007, at 11:27 PM, Bhavesh Davda wrote:
I really want to know what I asked. I've been told by someone that
attended WWDC that a bug I had reported in the Tiger kernel has
finally been fixed in the latest Leopard seed, and the workaround I
had put in my kext is no longer needed.
So no, you don't want to know whether you are running on Tiger or
not. What you want to know is whether or not you are linked with a
kernel that has the bug you're working around or not.
Instead of spinning 2 different versions of the kext, one for Tiger
and one for Leopard, I would like to figure out at runtime whether I
need to do the workaround or not, and just have one version of the
kext.
That sounds eminently desirable.
Irritatingly, the thing that you most want - the kmod version for the
symbol set(s) against which you are matched - is not easy to get.
The kmod_info struct that is passed to your kmod_start routine
contains a list of kmod references which would include the kernel
symbol sets against which you're linked, but if you're an I/O Kit
kext I don't think this is readily available because Xcode is
generating this function for you magically behind the scenes.
(Am I missing something here, folks? I couldn't find a public
interface to fetch the kmod_info data except via invoking kextstat,
which doesn't work well for kernel mode consumers...)
I don't know what versioning scheme Apple uses for the OS (10.4.9)
This is a marketing number.
versus the xnu kernel (792.18.5)
This is related to build and branch activity within the development
organisation.
versus the utsname (8.9.1). Hence the question.
This number is your best bet; the major digit has consistenly been
bumped at each major OS release. You will want to get confirmation
from DTS (Garth?), but it seems reasonable to assume that as Panther
was 7.x and Tiger was 8.x that Leopard will be 9.x.
Assuming you don't care about folks running old Leopard kernels
(prior to the fix), then that's easy enough to implement.
= Mike
_______________________________________________
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