Re: How to get system version in IOKit driver
Re: How to get system version in IOKit driver
- Subject: Re: How to get system version in IOKit driver
- From: Dean Reece <email@hidden>
- Date: Wed, 23 Nov 2005 09:37:46 -0800
On Nov 23, 2005, at 2:58 AM, Juncheng Geng wrote:
I'm now developing an IOKit driver. Its behaves differently with
different MAC OS version.
Then my question is how to get system version dynamically when the
driver is running.
Jason,
There are several kernel globals defined that will be of use to you.
In Tiger, they are defined in the following header: Kernel.framework/
Headers/libkern/version.h. In prior releases, they were not
available in any header so people that used them had to provide their
own prototypes. If you are building on an SDK eralier than 10.4, you
can steal the prototypes from the Tiger header and include them in
your own kext.
You probably want (int)version_major and (int)version_minor. If you
just want to do string compares, you can use (char*)osrelease. The
values match the Darwin kernel version (8.0 for Tiger).
To link against them, you need to declare com.apple.kernel.libkern or
com.apple.kpi.libkern in your OSBundleLibraries property. If you
need to load on systems earlier than Tiger, you have to use the
former (.kernel.). If you only need to run on Tiger and later, you
can choose either .kernel. or .kpi., but you can't mix and match the
two library types in a single kext.
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