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: "Bhavesh Davda" <email@hidden>
- Date: Sun, 17 Jun 2007 18:36:55 -0700
FYI: browsing the xnu code, I found a simple way to determine the
major version of the kernel:
from libkern/version.h:
extern const int version_major;
So I guess I can simply check if (version_major == 8), then it must be Tiger.
So never mind, I've finally answered my original question.
Thanks
On 6/17/07, Bhavesh Davda <email@hidden> wrote:
> 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.
So I don't have that problem because I'm not an I/O Kit kext. I'm a
direct KPI user.
> (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...)
Just to be clear where you're going with this. Are you suggesting that
I walk the list of kmod_info structs passed to my start routine?
> 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.
If someone at Apple can confirm this, I'll gladly use the utsname
major number 9 to mean Leopard. That's indeed sounding like my best
option.
Thanks!
--
Bhavesh P. Davda
--
Bhavesh P. Davda
_______________________________________________
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