Skip site navigation (1)Skip section navigation (2)
Date:      21 Jan 2006 20:33:06 -0000
From:      John Levine <johnl@iecc.com>
To:        freebsd-questions@freebsd.org
Cc:        nb_root@videotron.ca
Subject:   Re: C/C++ call to detect cpu?
Message-ID:  <20060121203306.25121.qmail@simone.iecc.com>
In-Reply-To: <200601211310.38269.nb_root@videotron.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060121203306.25121.qmail>