Memory map alignment
Memory map alignment
Will the memory map returned by BIOS Function: INT 0x15, EAX = 0xE820 be 0x1000 aligned?
I realised this could pose an issue in my memory managment.
I realised this could pose an issue in my memory managment.
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Memory map alignment
No.
It also will not be sorted and it may describe regions that overlap.
It also will not be sorted and it may describe regions that overlap.
Re: Memory map alignment
If they overlap how can you conclude which one is valid??
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Memory map alignment
Treat the overlapped parts as whichever one has the strictest type. (For example, if a "reserved" region and a "usable" region overlap, the overlapped part is "reserved".)
Re: Memory map alignment
Why does it show memory regions above what is allocated, Vbox shows 4GiB when i allocate 32MiB in settings
qemu does same but 13GiB
It is always marked as resurved though
qemu does same but 13GiB
It is always marked as resurved though
Re: Memory map alignment
It seems that I am given 2 extra entries but its also two more than I my botloaders say I have.
Here is a dump of the output from qemu running 32MiB (excluding the acpi extended field as they are all 0(i already checked)):
0 9FC00 1
9FC00 400 2
F0000 10000 2
100000 1EE0000 1
1FE0000 20000 2
--Where it keeps going even though my botloader says it stops here and after the limit in memory
FFFC0000 40000 2
FD00000000 300000000 2
Here is a dump of the output from qemu running 32MiB (excluding the acpi extended field as they are all 0(i already checked)):
0 9FC00 1
9FC00 400 2
F0000 10000 2
100000 1EE0000 1
1FE0000 20000 2
--Where it keeps going even though my botloader says it stops here and after the limit in memory
FFFC0000 40000 2
FD00000000 300000000 2
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Memory map alignment
Large gaps in the memory map are normal.Xeno wrote:Why does it show memory regions above what is allocated
Why doesn't your bootloader give you those entries? You need the entire memory map.Xeno wrote:It seems that I am given 2 extra entries but its also two more than I my botloaders say I have.
Re: Memory map alignment
No im saying the bootloader provides them, but does not include them in the length of the list.Octocontrabass wrote:Large gaps in the memory map are normal.Xeno wrote:Why does it show memory regions above what is allocated
Why doesn't your bootloader give you those entries? You need the entire memory map.Xeno wrote:It seems that I am given 2 extra entries but its also two more than I my botloaders say I have.
There is no reason for this in my boot code
Those "gaps" do not exist in ram, the system is allocated 32 MiB, 31 are usable.
Those "gaps" are MUCH larger than what is availbe
Re: Memory map alignment
Large gaps in the memory map are normal./quote]Octocontrabass wrote:Xeno wrote:Why does it show memory regions above what is allocated
Are you saying there should be areas in physical memory that DO NOT exist?
if so am i to treat them as resurved in my memory bitmap?
Re: Memory map alignment
Well I now see my issue.
Thank you
Thank you
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Memory map alignment
Why aren't they included in the length of the list? Aren't they part of the list?Xeno wrote:No im saying the bootloader provides them, but does not include them in the length of the list.
Not that there should be, but there can be. For example, a PC with 16GB of RAM might give you a memory map with 8GB of usable memory, then an 8GB gap, then another 8GB of usable memory.Xeno wrote:Are you saying there should be areas in physical memory that DO NOT exist?
The gaps are not memory, so your physical memory allocator should treat them the same way it treats reserved regions. (But for other purposes, like configuring MMIO, you need to know the difference between "reserved" and "not included the memory map".)Xeno wrote:if so am i to treat them as resurved in my memory bitmap?
Re: Memory map alignment
BIOS typically will map PCI bars and VBE linear framebuffers in high memory. With UEFI, things can be mapped above 4G, and so a 32-bit OS will need to use PAE to be able to map these. These areas can sometimes be implemented in PCI devices (PCI bars) and sometimes can be conventional RAM that is remapped. A computer with above 4G memory might remap the higher GB or so in 32-bit memory above 4G to be able to map PCI devices below 4G.Xeno wrote:It seems that I am given 2 extra entries but its also two more than I my botloaders say I have.
Here is a dump of the output from qemu running 32MiB (excluding the acpi extended field as they are all 0(i already checked)):
0 9FC00 1
9FC00 400 2
F0000 10000 2
100000 1EE0000 1
1FE0000 20000 2
--Where it keeps going even though my botloader says it stops here and after the limit in memory
FFFC0000 40000 2
FD00000000 300000000 2
Example of usable memory in one of my new PCs I'm working on which boots with 64-bit UEFI:
0 8FFFF
100000 10FFFF
120000 120FFF
5B0000 74224FFF
76C4F000 76C4FFFF
100000000 1803FFFFF
The 2:nd and 3:rd area are due to reservations I do in the UEFI boot loader. Usable RAM then starts at 5B0000, which is after the kernel image. The kernel image is loaded between 121000 and 5AFFFF. The computer has 4G RAM, but 2G is remapped above 4G to make place for PCI devices. Actually, the CAN controller (and other PSE function) BARs are mapped at 6000000000 and above.