Complete details about first 1MB reserved

This commit is contained in:
Mathieu Maret 2021-06-09 22:23:33 +02:00
parent 865d3b811e
commit 8bb6cdbad4

View File

@ -105,7 +105,11 @@ void kmain(unsigned long magic, unsigned long addr)
for (uint i = 0; i < size; i++) {
printf(" base_addr 0x%llx, length = 0x%llx, type = 0x%x\n", mmap[i].addr,
mmap[i].len, (uint32_t)mmap[i].type);
if(mmap[i].addr < 0x100000){ //Consider low memory taken (https://wiki.osdev.org/Detecting_Memory_(x86). For example by VGA
// Consider low memory taken (https://wiki.osdev.org/Detecting_Memory_(x86). For
// example by VGA
// Turns out linux and windows do the same !
// https://lore.kernel.org/lkml/MWHPR21MB159330952629D36EEDE706B3D7379@MWHPR21MB1593.namprd21.prod.outlook.com/
if (mmap[i].addr < 0x100000) {
continue;
}
memAddBank(max(mmap[i].addr, (multiboot_uint64_t)lastUsedByMem),