Subject: Re: dmesg CPU frequency
To: None <port-i386@netbsd.org>
From: Michael van Elst <mlelstv@serpens.de>
List: port-i386
Date: 06/05/2006 10:08:35
r.phillips@jkmrc.com (Ray Phillips) writes:

>How is the CPU frequency given by dmesg obtained?
>For example on a PII which is nominally 350 MHz dmesg says:
>cpu0: Intel Pentium II (686-class), 350.82 MHz, id 0x652

On i386-CPUs with a CPU cycle counter that counter is measured
against the system timer.

On Transmeta CPU the frequency is delivered by the
CPUID instruction.

On older CPUs no frequency is shown by dmesg.

CPUs supported by the est driver can run at various speeds,
you can query the speed with 'sysctl -n machdep.est.frequency.current'.

>I'd like to port a program written for linux [1] to NetBSD and it 
>gets the CPU speed from /proc/cpuinfo.

AFAIK, there is currently no generic way to report CPU frequency.

>Is the same method used for NetBSD/alpha?  I've noticed it almost 
>always reports a machine's nominal frequency.

alpha gets the CPU frequency from a parameter block provided
by the firmware.

-- 
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."