在Linux中读取BIOS内容的最佳方法
确实是一个奇怪的问题。是否可以读取BIOS芯片的全部内容。我们有一个问题,需要验证BIOS芯片的内容?
干杯詹姆斯
An odd question really. Is it possible to read the entire contents of the bios chip in. We have a problem where we need to verify the contents of the bios chip?
Cheers James
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果有的话,您可以尝试 dmidecode 或 biosdecode。
you can try dmidecode or biosdecode if you have them.
如何读取BIOS区域
我假设您的意思是专门读取“BIOS 区域”,因为同一芯片可能包含多个不同的区域:
读取 BIOS 区域:
/dev/mem
0xffffffff 向下读取。您可以在/proc/iomem
中找到范围(尝试命令:sudo grep -- '-ffffffff ' /proc/iomem
)。然后您可以使用 dd 转储该区域。flashrom
,如果您的主板受此工具支持(例如sudo flashrom -p internal --ifd -i bios -r /tmp/bios_region.img
>)。/dev/mtd*
。如何验证内容(出于安全目的)
您实际上可以仅使用 TPM 中的 PCR0 值,该值应该测量 BIOS 的内容。它有很多警告,但它们都经过了马马虎虎的调查和解决(请随意提出问题,我会尽力提供帮助)。
但如果您需要直接比较内容,请记住:
避免这两个问题的最简单方法是仅使用 PCR0 值。
如何验证内容(出于操作目的)
另请参阅上面的“安全目的”部分,但除此之外 BIOS 卷和文件还有校验和。在某些情况下您可能只想检查它们。
PS
其他答案建议使用诸如 dmidecode 之类的东西。他们不会转储 BIOS 映像,而只会打印 SMBIOS 信息等。
How to read BIOS region
I assume you mean to read specifically "BIOS region", because the same chip may contain multiple different regions:
To read the BIOS region:
/dev/mem
0xffffffff downwards. You can find the range in/proc/iomem
(try command:sudo grep -- '-ffffffff ' /proc/iomem
). Then you can usedd
to dump the region.flashrom
, if you motherboard is supported by this tool (something likesudo flashrom -p internal --ifd -i bios -r /tmp/bios_region.img
)./dev/mtd*
.How to verify the content (for security purposes)
You can actually just use PCR0 value from TPM, which supposed to measure the content of BIOS. It has a lot of caveats, but they are so-so investigated and solved (feel free to ask a question, I'll try to help).
But if you need to compare the content directly, keep in mind:
The easiest way to avoid both problems is to just use the PCR0 value.
How to verify the content (for operational purposes)
See also the "security purposes" section above, but on top of that BIOS volumes and files has checksums. You may just want to check them in some cases.
P.S.
Other answers suggests to use things like
dmidecode
. They won't dump the BIOS image, but just will print the SMBIOS info and things like that.您读过此 ?
Have you read this ?