Dean,
I don't really want to use an unsupported function; if I know I only
need to
do this on 10.3, I'd need to know the OS version anyway, putting me in
a
chicken and egg situation.
I could use sysctl to find the Darwin version (as a string), could I
not?
sysctl is callable from the kernel, isn't it?
#include <sys/types.h>#include <sys/sysctl.h>
int mib[3] = { CTL_KERN, KERN_OSRELEASE, 0 };
size_t len = 0;
char * p = NULL;
sysctl(mib, 2, NULL, &len, NULL, 0);
p = malloc(len);
sysctl(mib, 2, p, &len, NULL, 0);
on return, p will point at "7.7.0" for Mac OS 10.3.7.
The number kern.osrevision = 199506 may be more useful, but I've no
idea how
that number correlates with OS revision.
what are those compiled-in globals I was thinking of? I don't know what
header they are in. Perhaps they'd give me a more direct way of
determining
the system version.
Stuart
on 1/28/05 1:34 PM, Dean Reece at xxxx wrote:
"from kernel space"
I should have read the title more carefully. There isn't a supported
way to do this for loaded kexts. The compiled-in globals you are
thinking of only cover the kernel and it's major sections, not
families.
The UNsupported way to do this is to use kmod_lookupbyname(), which is
available on Panther and Tiger, but will go away in the future. Since
it isn't a public function, you'll have to look at Darwin xnu to get
the prototype and calling conventions for it.
- Dean
On Jan 28, 2005, at 1:24 PM, Dean Reece wrote:
On Mac OS X, the USB Family is not compiled into the kernel; it is
loaded as a kernel extension (kext).
You can find the versions of all loaded kexts via the kextstat
command.
The kexts that show a load address of 0x0 represent compiled-in code.
All other kexts are loaded.
Cheesr,
- Dean
On Jan 28, 2005, at 12:57 PM, Stuart Smith wrote:
how do I find the version of the IOUSBFamily which is currently in
the
kernel (either as a version number or a string like "214.4.5".
Alternatively, can I find the OS Version as an NumVersion or as a
string
e.g. "10.3.7"
I believe some information of this kind is compiled-in as kernel
globals,
but I can't find any documentation for them, I only vaguely remember
that
someone may have mentioned them on a list...
TIA, Stuart
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden