One of the most common way to get CPU information is to check the content of /proc/cpuinfo. For example, this is the output I get from running the command on NanoPi NEO (Allwinner H3) board:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
cat /proc/cpuinfo Processor : ARMv7 Processor rev 5 (v7l) processor : 0 BogoMIPS : 2400.00 processor : 1 BogoMIPS : 2400.00 Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 Hardware : sun8i Revision : 0000 Serial : 5400503583203c3c040e |
Many fields are self-explanatory, but what about CPU implementer and CPU part numbers? Those are values stored in Arm’s CPUID Base Register, and 0x41 looks up to Arm implementer, while 0xc07 refers to Cortex A7. But I had to look it up to find out.
One solution would be to decode those values in the kernel, but the developers won’t do that probably because it may break user-space programs that rely on hexadecimal values. So instead,
In the meantime, I could try it out by compiling the code myself:
1 2 3 4 5 6 |
sudo apt install gettext autopoint bison libtool git build-essential pkg-config git clone https://github.com/karelzak/util-linux cd util-linux ./autogen.sh ./configure make lscpu |
Let’s now run our freshly compiled lscpu to see if an Arm Cortex A7 processor is detected:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
./lscpu Architecture: armv7l Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0,1 Off-line CPU(s) list: 2,3 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 Vendor ID: ARM Model: 5 Model name: Cortex-A7 Stepping: r0p5 CPU max MHz: 1200.0000 CPU min MHz: 240.0000 BogoMIPS: 9120.00 Flags: swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt |
It works as ARM Cortex-A7 revision 5 is shown. It does not follow Arm’s new lower case logo / name, but who cares 🙂 We can see most of the information provided by /proc/cpuinfo and more, but the BogoMIPS number is different, and the last three lines with Hardware, Revision and Serial are not shown.
It’d be particular interesting to test it on products or boards with processors featuring custom Arm cores such as you should get values like “Qualcomm Krait” or “Marvell PJ4/PJ4b”.

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress