What is the equivalent of /proc/cpuinfo on FreeBSD v8.1?

WilliamKF picture WilliamKF · Nov 3, 2010 · Viewed 30.7k times · Source

What is the equivalent of Linux's /proc/cpuinfo on FreeBSD v8.1? My application reads /proc/cpuinfo and saves the information in the log file, what could I do to get similar information logged on FreeBSD?

A sample /proc/cpuinfo looks like this:

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 23
model name  : Intel(R) Xeon(R) CPU           E5420  @ 2.50GHz
stepping    : 8
cpu MHz     : 2499.015
cache size  : 6144 KB
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 10
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx lm constant_tsc pni ds_cpl
bogomips    : 5004.54

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 23
model name  : Intel(R) Xeon(R) CPU           E5420  @ 2.50GHz
stepping    : 8
cpu MHz     : 2499.015
cache size  : 6144 KB
fdiv_bug    : no
hlt_bug     : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 10
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx lm constant_tsc pni ds_cpl
bogomips    : 5009.45

Answer

Josh Lee picture Josh Lee · Nov 3, 2010

I don’t believe there is anything as detailed as Linux’s /proc/cpuinfo. Look into sysctl hw and /var/run/dmesg.boot. Most of the information like CPU speed and instruction sets should be in there somewhere.

This is what I see (with a few uninteresting hw.* fields removed):

$ uname -sr
FreeBSD 4.10-RELEASE
$ grep -i cpu /var/run/dmesg.boot 
CPU: Pentium III/Pentium III Xeon/Celeron (448.97-MHz 686-class CPU)
$ /sbin/sysctl hw
hw.machine: i386
hw.model: Pentium III/Pentium III Xeon/Celeron
hw.ncpu: 1
hw.byteorder: 1234
hw.physmem: 665989120
hw.usermem: 604614656
hw.pagesize: 4096
hw.floatingpoint: 1
hw.machine_arch: i386
hw.aac.iosize_max: 65536
hw.an.an_dump: off
hw.an.an_cache_mode: dbm
hw.an.an_cache_mcastonly: 0
hw.an.an_cache_iponly: 1
hw.fxp_rnr: 0
hw.fxp_noflow: 0
hw.dc_quick: 1
hw.ste.rxsyncs: 0
hw.instruction_sse: 0
hw.availpages: 162432

(Note that on OpenBSD, the cpu speed is found in hw.cpuspeed instead of in dmesg.)