Memory map shows more RAM than physically available

前端 未结 1 865
心在旅途
心在旅途 2021-01-05 09:17

I am working on a small x86 kernel. I am accessing and attempting to read the memory map that GRUB provides in the multiboot header. I have an Intel i3 cpu and 4 GiB of RA

相关标签:
1条回答
  • 2021-01-05 09:47

    Some thoughts:

    • Address space != physical memory size.
    • An i3 supports virtual address spaces in either 64bit, or 32bit mode with 36bit PAE (optional, with kernel support). If you actually have 4GiB of RAM available in the booted 32bit system, PAE must be enabled. How to check: https://serverfault.com/q/247080
    • AFAIR, those ranges could overlap and appear in any order, so that ordering and re-typing to the most restricted type or range splitting is required.
    • That last base address 0x0000000100000000 is >= 2^32. This is usually done, because hardware, ROM images and other special ranges are allocated below 2^32 in (all?) PCs. Thus, either PAE or long mode is required to access main memory ranges starting at or above 2^32.

    Edit:

    Look here for more details: http://wiki.osdev.org/Detecting_Memory_%28x86%29

    Edit 2:

    Today, I stumbled upon a Sysinternals tool, which shows following physical range mapping for my EFI System, without any related setting altered. As one can see, all of 64GiB main memory is mapped at 0x100000000, right at 2^32:

    Sysinternals RamMap on Win 7 / ASUS EFI BIOS

    0 讨论(0)
提交回复
热议问题