16.6 C
Jaipur
Wednesday, December 1, 2021

FreeBSD CPU Information Command – nixCraft

Must read

How do I get more information about CPU under FreeBSD operating systems such as CPU Speed and model using the command-line options?

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements FreeBSD shell
Est. reading time 4 minutes

You can use the dmesg utility displays the contents of the system message buffer when FreeBSD comes up. For accuracy I recommend querying /var/run/dmesg.boot file. Usually a snapshot of the buffer contents taken soon after file systems are mounted at startup time and dumped to /var/run/dmesg.boot file. This page explains how to find CPU information on FreeBSD Unix computer.

Check CPU Speed in FreeBSD using sysctl command

Type the following command at a shell prompt as root user:
# sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
OR
# sysctl hw.model hw.machine hw.ncpu
Sample outputs:

hw.machine: amd64
hw.model: Intel(R) Xeon(R) CPU           X3220  @ 2.40GHz
hw.ncpu: 4
hw.machine_arch: amd64

From the outputs, I have got an Intel Xeon quad core processor running at 2.40GHz from hw.model. The amd64 means 64 bit CPU and I have 4 core cpu as confirmed by hw.ncpu. Here is another output from my FreeBSD based firewall server:

Fig. 01: Finding out CPU info on a FreeBSD server/router

The i386 means I’ve got 32 bit CPU in my home router/firewall.

FreeBSD find out if CPU is 32bit or 64bit regardless of Intel/AMD/ARM CPU model

We need to use the getconf command:
getconf LONG_BIT
And we see:

64

Releated: Linux Find If Processor (CPU) is 64 bit / 32 bit [long mode ~ lm]

FreeBSD CPUINFO using the dmesg command

Type the following command:
# dmesg | grep -i cpu
We can directly query /var/run/dmesg.boot file too:
# grep -i cpu /var/run/dmesg.boot
Here is what we see:

CPU: Dual Core AMD Opteron(tm) Processor 170 (1999.08-MHz 686-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
cpu0:  on acpi0
acpi_throttle0:  on cpu0
cpu1:  on acpi0
acpi_throttle1:  on cpu1
SMP: AP CPU #1 Launched!

You can also dump more information using sysctl command:
# sysctl -a | grep -i cpu | less

Installing packages to gain CPU information

We can use the following packages.

cpu-x app

CPU-X is a free software that gathers information about CPU, motherboard, and more on one’s system. It is similar to well-known CPU-Z program for Windows. It can be used in graphic mode by using GTK+3, or in text-based mode by using ncurses. Non-interactive dump mode is also available. Install it:
sudo pkg install cpu-x

cpuid app

Cpuid dumps detailed information about the CPU(s) gathered from the CPUID instruction, and also determines the exact model of CPU(s). It supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC, NexGen, Rise, and SiS CPUs. Use the pkg command to install it:
sudo pkg install cpuid
cpuid | more

Detailed information about my CPU:

 eax in    eax      ebx      ecx      edx
00000000 00000016 756e6547 6c65746e 49656e69
00000001 000806ea 04100800 7ffafbff bfebfbff
00000002 76036301 00f0b5ff 00000000 00c30000
00000003 00000000 00000000 00000000 00000000
00000004 1c004121 01c0003f 0000003f 00000000
00000005 00000040 00000040 00000003 11142120
00000006 000027f7 00000002 00000009 00000000
00000007 00000000 029c6fbf 00000000 9c002600
00000008 00000000 00000000 00000000 00000000
00000009 00000000 00000000 00000000 00000000
0000000a 07300404 00000000 00000000 00000603
0000000b 00000001 00000002 00000100 00000004
0000000c 00000000 00000000 00000000 00000000
0000000d 0000001f 00000440 00000440 00000000
0000000e 00000000 00000000 00000000 00000000
0000000f 00000000 00000000 00000000 00000000
00000010 00000000 00000000 00000000 00000000
00000011 00000000 00000000 00000000 00000000
00000012 00000000 00000000 00000000 00000000
00000013 00000000 00000000 00000000 00000000
00000014 00000001 0000000f 00000007 00000000
00000015 00000002 000000b0 00000000 00000000
00000016 00000834 00001068 00000064 00000000
80000000 80000008 00000000 00000000 00000000
80000001 00000000 00000000 00000121 2c100800
80000002 65746e49 2952286c 726f4320 4d542865
80000003 37692029 3536382d 43205530 40205550
80000004 392e3120 7a484730 00000000 00000000
80000005 00000000 00000000 00000000 00000000
80000006 00000000 00000000 01006040 00000000
80000007 00000000 00000000 00000000 00000100
80000008 00003027 00000000 00000000 00000000

Vendor ID: "GenuineIntel"; CPUID level 22

Intel-specific functions:
Version 000806ea:
Type 0 - Original OEM
Family 6 - Pentium Pro
Model 142 - 
Stepping 10
Reserved 0

Extended brand string: "Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz"
CLFLUSH instruction cache line size: 8
Initial APIC ID: 4
Hyper threading siblings: 16

Feature flags set 1 (CPUID.01H:EDX): bfebfbff:
FPU    Floating Point Unit
.....
...
....
Structured feature flags CPUID.07H.00H:EBX: 029c6fbf:
FSGSBASE
IA32_TSC_ADJUST MSR
2 - unknown feature
BMI1
HLE
AVX2
SMEP
BMI2
Enhanced REP MOVSB/STOSB
INVPCID
RTM
Deprecates FPU CS and FPU DS
14 - unknown feature


dmidecode DMI table decoder app

dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Install it:
sudo pkg install dmidecode
Type:
sudo dmidecode | more
sudo dmidecode -t processor

Patreon supporters only guides 🤓

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare
  • Join my Patreon to support independent content creators and start reading latest guides:

Join Patreon

Conclusion

We explained various command-line options to display information about installed CPU under FreeBSD operating systems.


ADVERTISEMENT

Source link

- Advertisement -

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement -

Latest article