Re: Getting processor description from sysctl
Re: Getting processor description from sysctl
- Subject: Re: Getting processor description from sysctl
- From: Terry Lambert <email@hidden>
- Date: Wed, 14 May 2008 21:43:09 -0700
On May 14, 2008, at 8:28 PM, Mike wrote:
Terry Lambert wrote:
On May 14, 2008, at 7:28 PM, Mike wrote:
Is there a way to get the description of the processor(s) using
sysctl. I am interested in the specific processor name, not the
family name. For example "Northwood", not "i386" or "x86".
No.
We care about the family and the capability bits, not the Intel
marketing name for it. The first lets us grade binaries, and th
second lets us write software that avoids attempting to use
capabilities not present on a specific CPU.
-- Terry
I am not attempting to use this info to determine capabilities of
the specific CPU. I need to write a system-profiler like feature and
I need the name of the processor, not just the family.
System Profiler provides the processor name, so there must be a way
to get it. For example on the MacBook it reports:
Processor Name: Intel Core 2 Duo
Oh, you gave an example of "Northwood", which I don't expect you'll
ever see. If you just want to report what system_profiler reports,
the easiest way is to do what Philip Aker suggested, and invoke the
command line version of system_profiler and read its output.
If you are OK with less specificity, and insist that it be a sysctl,
then:
"machdep.cpu.brand_string" (use sysctlbyname(), please).
I expect you can get this same information from issuing the CPUID
instruction various ways, which is how we fill out the capability bits.
Remember that not checking the capability bits, and assuming that some
marketing name means a feature is usable does not mean the feature is
usable. For example, it's possible with a boot argument to disable
Altivec on G4 and G5 based machines, and Intel CPUs have similar
capabilities, so not looking at the capability bits means you might be
trying to use some hardware feature that has been disabled for some
reason (e.g. power management, etc.).
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden