I always have this question and didn't get an answer after reading man-page and searching online. Anyone who has knowledge about this please comment.
I understand that SMBIOS table or DMI table is what dmidecode locates and parses. But where does it get it from? Is it in the format of a file in Linux?
DmiDmiThe Desktop Management Interface (DMI) generates a standard framework for managing and tracking components in a desktop, notebook or server computer, by abstracting these components from the software that manages them.https://en.wikipedia.org › Desktop_Management_InterfaceDesktop Management Interface - Wikipediadecode reads the data from DMI (Desktop Management Interface) table, which holds information for the system's hardware components like BIOS Revision, Serial Number, RAM, CPU, manufacturer information, etc.
The SMBIOS Entry Point Table is located somewhere between the addresses 0xF0000 and 0xFFFFF, and must be on a 16-byte boundary.
Dmidecode stands for DMI (Desktop Management Interface) table decoder, as the name suggests it reads the data from DMI table and represents to us in human readable format.
Handle - This is a unique identifier, which allows records to reference each other. For example, processor records usually reference cache memory records using their handles.
Looks like it comes from /dev/mem
root@aw42e ~]# strace -F -e open dmidecode -t 17
<snip>
open("/sys/firmware/efi/systab", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/proc/efi/systab", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/dev/mem", O_RDONLY) = 3
SMBIOS 2.5 present.
open("/dev/mem", O_RDONLY) = 3
Handle 0x0016, DMI type 17, 27 bytes
Memory Device
<snip>
/dev/mem
is described as
mem is a character device file that is an image of the main memory of the computer. It may be used, for example, to examine (and even patch) the system. Byte addresses in mem are interpreted as physical memory addresses.
So to answer, it is contained in /dev/mem
I'm searching for more info, but I assume that the kernel inserts the DMI table into memory at boot time - from man dmidecode
As you run it, dmidecode will try to locate the DMI table. If it succeeds, it will then parse this table and display a list of records like this one:
The data defined in the DMI table is an industry standard; implemented for both Linux and Windows (among other PC OSs):
https://en.wikipedia.org/wiki/System_Management_BIOS
the System Management BIOS (SMBIOS) specification defines data structures (and access methods) that can be used to read information stored in the BIOS of a computer. Circa 1999, it became part of the domain of the Distributed Management Task Force (DMTF)...
At approximately the same time Microsoft started to require that OEMs and BIOS vendors support the interface/data-set in order to have Microsoft certification...
You can read more about the Linux implementation - and the driver used to export the actual, raw data to userspace ("/sys/class/dmi/", "/dev/mem", and friends) - here:
https://web.archive.org/web/20160318010215/http://www.linux.org/threads/the-linux-kernel-configuring-the-kernel-part-19.4929/
The actual kernel code for accessing DMI info is here (your distro/version might differ):
https://elixir.bootlin.com/linux/latest/source/drivers/firmware/dmi-sysfs.c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With