C/C++ call to detect cpu?

Garrett Cooper youshi10 at u.washington.edu
Sat Jan 21 18:27:16 PST 2006


On Jan 21, 2006, at 12:33 PM, John Levine wrote:

>> Other than 'grep'ing dmesg, is there a way to know the current cpu  
>> such as a
>> struct with the machine's cpu and cpu feature (kinda like a time_t  
>> struct)?
>
> $ sysctl hw.model
> hw.model: AMD Athlon(tm) 64 Processor 3000+
>
> If you want more details write a tiny assembler routine that does a
> CPUID instruction and decode the result.  Intel has a detailed  
> application
> note about it at
> http://developer.intel.ru/design/xeon/applnots/241618.htm
>
> R's,
> John

Erm. Nevermind. I just misunderstood your question =\...
-Garrett


More information about the freebsd-questions mailing list