Why the undeclared gap in the QEMU memory layout and how...
Posted: Sun Jan 27, 2019 9:08 am
I am working on my memory management and I used int 15h, function E820 to retrieve a memory layout of the system (as explained on https://wiki.osdev.org/Detecting_Memory_(x86) and I don't think my question is explained in there unless I am missing it)
I receive a nice looking table with recognizable values:
0x0 (0x9FC00) (1)
0x9FC00 (0x400) (2)
0xF0000 (0x10000) (2)
0x100000 (0xBFEE0000) (1)
0xBFFE0000 (0x20000) (2)
0xFFFC0000 (0x40000) (2)
...
I just noticed that this table has gaps: 0x9FC00 + 0x400 = 0xA0000, but there is no definition in the table for 0xA0000-0xF0000. Of course I know that this is the video memory area for VGA, and as I ignore everything < 1MB and reserve it as kernel space, it's no worry.
But at 0xBFFE0000, there is a 0x20000 system reserved chunk, and only at 0xFFFC0000, there is a 0x40000 system reserved chunk.
0xBFFE0000 + 0x20000 = 0xBFFF0000, not 0xFFFC0000.
First I thought I had written a code bug, but then I saw someone else in another post getting the same values (viewtopic.php?t=30318).
So, why the gaps? And how should I handle them?
Should I just ignore the sizes in the table and take the next memory address to know the size of the entry?
Would I have the same gaps on a typical real system?
I receive a nice looking table with recognizable values:
0x0 (0x9FC00) (1)
0x9FC00 (0x400) (2)
0xF0000 (0x10000) (2)
0x100000 (0xBFEE0000) (1)
0xBFFE0000 (0x20000) (2)
0xFFFC0000 (0x40000) (2)
...
I just noticed that this table has gaps: 0x9FC00 + 0x400 = 0xA0000, but there is no definition in the table for 0xA0000-0xF0000. Of course I know that this is the video memory area for VGA, and as I ignore everything < 1MB and reserve it as kernel space, it's no worry.
But at 0xBFFE0000, there is a 0x20000 system reserved chunk, and only at 0xFFFC0000, there is a 0x40000 system reserved chunk.
0xBFFE0000 + 0x20000 = 0xBFFF0000, not 0xFFFC0000.
First I thought I had written a code bug, but then I saw someone else in another post getting the same values (viewtopic.php?t=30318).
So, why the gaps? And how should I handle them?
Should I just ignore the sizes in the table and take the next memory address to know the size of the entry?
Would I have the same gaps on a typical real system?