[fpc-pascal] Hardware information: Linux and Windows

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu Jan 21 11:57:56 CET 2010

Osvaldo Filho wrote:
> How do I get information about the hardware in Linux and Windows?
> - Identification of the processor: model, manufacturer, serial number

That depends very much on the type of the processor, i.e. whether it's 
x86, ARM and so on. On x86 the info is available from processor 
registers, on Linux you can use /proc/cpuinfo (noting that the format of 
this depends on processor type and the whim of the kernel developers).

> - Identification of Hard Disk: model, manufacturer, physical serial number

With difficulty on Linux. I see that somebody has suggested dmesg|grep 
but that won't be reliable if something's trickling messages into the 
kernel buffer that eventually flush out the boot stuff.

> - Identification of Memory: model, manufacturer, size, type

In general depends on the chipset. To get this info reliably you need to 
access the serial bus that runs to each DIMM to get its parameters, and 
then you need to know how to decode them.

> - Identification of Motherboard: model, manufacturer

With extreme difficulty. On Linux there might possibly be info in 
/proc/acpi, /proc/openprom etc. but again it depends very much on the 
architecture, kernel version and so on. A good place to start is looking 
at lspci or /proc/bus/pci, you should find that most models of computer 
have a distinct arrangement of devices and with modest expenditure of 
effort you should be able to characterise each one :-)

Again, there's a whole lot of stuff that you can get by parsing dmesg 
output on Linux. However that's basically debugging info from the kernel 
as it starts and if it's not also presented in /proc, /sys or /dev then 
it might only be available for a limited time.

Sorry I can't say more about Windows, Solaris, or the other OSes that 
FPC supports.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-pascal mailing list