gpt4 book ai didi

linux - dmidecode 从哪里获取 SMBIOS 表?

转载 作者:IT王子 更新时间:2023-10-29 00:49:23 26 4
gpt4 key购买 nike

我一直有这个问题,在阅读手册页和在线搜索后没有得到答案。有知道这方面知识的 friend 请评论。

我理解SMBIOS表或DMI表是dmidecode定位和解析的。但是它是从哪里得到的呢?在Linux中是文件格式吗?

最佳答案

看起来它来自/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 被描述为

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.

所以要回答,它包含在/dev/mem

我正在搜索更多信息,但我假设内核在启动时将 DMI 表插入内存 - 来自 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:

关于linux - dmidecode 从哪里获取 SMBIOS 表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34537435/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com