Answers:
您可以尝试使用biosdecode
。
它是一个命令行实用程序,用于解析BIOS内存并打印有关其已知的所有结构(或入口点)的信息。它查找有关硬件的信息,例如:
等等
注意事项:
biosdecode
解析BIOS内存并打印有关所有结构的信息。biosdecode
不是人类可读的格式。您将需要使用dmidecode
命令在屏幕上转储计算机的DMI(SMBIOS)表内容。
$ sudo dmidecode --type 0
搜索手册页以获取更多信息:
$ man dmidecode
是的,内核仅将需要的信息从BIOS保留在RAM中。但是,您可以使用包含嵌入式ASM(汇编代码)等的C应用程序从root用户进行实时BIOS调用。
您可以从Linuxmagazine的标题为Linux和BIOS的文章中了解有关Linux内核和系统BIOS的更多信息。
我认为您正在寻找的是flashrom
。如果您的系统受支持,则可以通过发出以下命令来读取BIOS内容
# flashrom -r <outputfile>
如果只想保存所谓的CMOS RAM(将配置保存到的那些多余字节,例如RTC等警报),内核的nvram
驱动程序和设备可能会帮助您:
config NVRAM
tristate "/dev/nvram support"
depends on ATARI || X86 || (ARM && RTC_DRV_CMOS) || GENERIC_NVRAM
---help---
If you say Y here and create a character special file /dev/nvram
with major number 10 and minor number 144 using mknod ("man mknod"),
you get read and write access to the extra bytes of non-volatile
memory in the real time clock (RTC), which is contained in every PC
and most Ataris. The actual number of bytes varies, depending on the
nvram in the system, but is usually 114 (128-14 for the RTC).
This memory is conventionally called "CMOS RAM" on PCs and "NVRAM"
on Ataris. /dev/nvram may be used to view settings there, or to
change them (with some utility). It could also be used to frequently
save a few bits of very important data that may not be lost over
power-off and for which writing to disk is too insecure. Note
however that most NVRAM space in a PC belongs to the BIOS and you
should NEVER idly tamper with it. See Ralf Brown's interrupt list
for a guide to the use of CMOS bytes by your BIOS.
On Atari machines, /dev/nvram is always configured and does not need
to be selected.
To compile this driver as a module, choose M here: the
module will be called nvram.
如果其他工具不可用或无法使用,则可以通过以下方法对要转储的内存区域进行有根据的猜测。
例如,在VirtualBox VM中,我通过执行以下操作成功转储了它的BIOS:
$ grep ROM /proc/iomem # https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-memmap
000c0000-000c7fff : Video ROM
000e2000-000e2fff : Adapter ROM
000f0000-000fffff : System ROM
# dd if=/dev/mem of=pcbios.rom bs=64k skip=15 count=1 # 15*64k + 64k
这在VirtualBox中为我工作:
$ grep ROM /proc/iomem
结果为:
000c0000-000c7fff:视频ROM
000e2000-000e2fff:适配器ROM
000f0000-000fffff:系统ROM
系统ROM从000f0000开始,即0xF0000。
打开浏览器,然后转到http://www.hexadecimaldictionary.com/hexadecimal/0xF0000。这表示十进制值为983040,将其除以1024得到千字节为960,这是起始点,也是“跳过”的值。
结束号是0xFFFFF,即1048575,仅比1024小。1024-960为64,即“ count”的值。
因此,要运行以转储BIOS的命令是:
dd if=/dev/mem of=pcbios.bin bs=1k skip=960 count=64