Hello all,
Sorry if this has been asked before.. I tried searching but didn't find a result. I'm working on my new OS and UEFI bootloader. I was starting work on my PMM, when I realized something a little funky about my memory map. There seem to be around half a Gb of gaps in the physical memory address space. Here's my memory map returned from GetMemoryMap() to be a bit more clear:
Code:
Type Start Addr (Low bits) Num Pages
7 0 160
7 1048576 768
2 4194304 2
7 4202496 7172
4 33579008 1
7 33583104 25
4 33685504 2272
7 42991616 9984
2 83886080 1
7 83890176 389055
1 1677459456 10
7 1677500416 491574
4 3690987520 32
7 3691118592 11827
2 3739561984 3
7 3739574272 775
4 3742748672 202
7 3743576064 27
4 3743686656 2836
7 3755302912 18
3 3755376640 366
5 3756875776 48
6 3757072384 36
0 3757219840 4
9 3757236224 8
10 3757268992 4
4 3757285376 134
6 3757834240 32
7 3757965312 16
7 4294967296 1179648
This system was set up in VirtualBox to have 8Gb of RAM. Notice at the 4Gb address there are 1179648 available 4KiB frames (4.5 Gb worth), making the final memory address at the 8.5Gb mark even though there's only 8Gb of RAM. If you add up the total number of frames, it adds up to right around 8Gb (about half a Mb shy if I did the calculations correctly, which would make sense if some memory is being reserved by the hardware). So my main question is, is this normal? It would make the memory bitmap more complicated, but workable - I could just map a bit directly to a physical page if I treated the system like it had 8.5Gb of RAM, and marked the "gaps" as already allocated. Something about this seems off to me though. I did notice the UEFI documentation stated
Quote:
The firmware does not return a range description for address space regions that are not backed by physical hardware.
so I'm not sure if that's related. I'll likely have follow-up questions depending on the responses. Sorry if this is a silly question, I'm new to OSdev.
Edit: Messed up the final table entry, fixed