2

I checked the dmidecode source code.

I saw this:

int fd=open("/dev/mem", O_RDONLY);
long fp=0xE0000L;

It looks like Linux already copy SMBIOS information to memory?

Mark K
  • 779
  • 2
  • 13
  • 33

1 Answers1

2

/dev/mem provides access to all physical address space. The BIOS firmware is part of this address space (your computer must have some code to run during power-up).

So Linux "did not copy SMBIOS information to memory", 0xe0000 is the base address of the BIOS since ancient times, and reading this via /dev/mem will read directly from the ROM (unless the BIOS replaced itself with shadow RAM during the boot process, but again that has nothing to do with Linux).

dirkt
  • 31,679
  • 3
  • 40
  • 73
  • 1
    Note that in typical kernel configurations, `/dev/mem` no longer provides access to all the physical address space, but only to the BIOS code and data, and any unclaimed PCI space. – Stephen Kitt Aug 27 '19 at 09:39
  • 1
    @StephenKitt: Which is really a pity from a hacker's point of view (though it's probably better for security). – dirkt Aug 27 '19 at 10:05