···11+What: /sys/firmware/dmi/22+Date: February 201133+Contact: Mike Waychison <mikew@google.com>44+Description:55+ Many machines' firmware (x86 and ia64) export DMI /66+ SMBIOS tables to the operating system. Getting at this77+ information is often valuable to userland, especially in88+ cases where there are OEM extensions used.99+1010+ The kernel itself does not rely on the majority of the1111+ information in these tables being correct. It equally1212+ cannot ensure that the data as exported to userland is1313+ without error either.1414+1515+ DMI is structured as a large table of entries, where1616+ each entry has a common header indicating the type and1717+ length of the entry, as well as 'handle' that is1818+ supposed to be unique amongst all entries.1919+2020+ Some entries are required by the specification, but many2121+ others are optional. In general though, users should2222+ never expect to find a specific entry type on their2323+ system unless they know for certain what their firmware2424+ is doing. Machine to machine will vary.2525+2626+ Multiple entries of the same type are allowed. In order2727+ to handle these duplicate entry types, each entry is2828+ assigned by the operating system an 'instance', which is2929+ derived from an entry type's ordinal position. That is3030+ to say, if there are 'N' multiple entries with the same type3131+ 'T' in the DMI tables (adjacent or spread apart, it3232+ doesn't matter), they will be represented in sysfs as3333+ entries "T-0" through "T-(N-1)":3434+3535+ Example entry directories:3636+3737+ /sys/firmware/dmi/entries/17-03838+ /sys/firmware/dmi/entries/17-13939+ /sys/firmware/dmi/entries/17-24040+ /sys/firmware/dmi/entries/17-34141+ ...4242+4343+ Instance numbers are used in lieu of the firmware4444+ assigned entry handles as the kernel itself makes no4545+ guarantees that handles as exported are unique, and4646+ there are likely firmware images that get this wrong in4747+ the wild.4848+4949+ Each DMI entry in sysfs has the common header values5050+ exported as attributes:5151+5252+ handle : The 16bit 'handle' that is assigned to this5353+ entry by the firmware. This handle may be5454+ referred to by other entries.5555+ length : The length of the entry, as presented in the5656+ entry itself. Note that this is _not the5757+ total count of bytes associated with the5858+ entry_. This value represents the length of5959+ the "formatted" portion of the entry. This6060+ "formatted" region is sometimes followed by6161+ the "unformatted" region composed of nul6262+ terminated strings, with termination signalled6363+ by a two nul characters in series.6464+ raw : The raw bytes of the entry. This includes the6565+ "formatted" portion of the entry, the6666+ "unformatted" strings portion of the entry,6767+ and the two terminating nul characters.6868+ type : The type of the entry. This value is the same6969+ as found in the directory name. It indicates7070+ how the rest of the entry should be7171+ interpreted.7272+ instance: The instance ordinal of the entry for the7373+ given type. This value is the same as found7474+ in the parent directory name.7575+ position: The position of the entry within the entirety7676+ of the entirety.7777+7878+ === Entry Specialization ===7979+8080+ Some entry types may have other information available in8181+ sysfs.8282+8383+ --- Type 15 - System Event Log ---8484+8585+ This entry allows the firmware to export a log of8686+ events the system has taken. This information is8787+ typically backed by nvram, but the implementation8888+ details are abstracted by this table. This entries data8989+ is exported in the directory:9090+9191+ /sys/firmware/dmi/entries/15-0/system_event_log9292+9393+ and has the following attributes (documented in the9494+ SMBIOS / DMI specification under "System Event Log (Type 15)":9595+9696+ area_length9797+ header_start_offset9898+ data_start_offset9999+ access_method100100+ status101101+ change_token102102+ access_method_address103103+ header_format104104+ per_log_type_descriptor_length105105+ type_descriptors_supported_count106106+107107+ As well, the kernel exports the binary attribute:108108+109109+ raw_event_log : The raw binary bits of the event log110110+ as described by the DMI entry.