implements first free mem block

This commit is contained in:
2025-06-11 17:41:35 -04:00
parent f216c32f22
commit 98f8a0dc88
3 changed files with 13 additions and 27 deletions

View File

@ -38,14 +38,7 @@ void verify_memmap(multiboot_info_t* mbd, uint32_t magic)
// mmmt-> len is in bytes (according to multiboot specification0
// mmmt->len / 1024 == kib // block size == blocks
if (mmmt->type == MULTIBOOT_MEMORY_AVAILABLE && (mmmt->addr == 0x100000)) {
// This is the main mem address we want
// TODO: this is probably flaky, so i want to find a better and more reliable way to do this
set_grub_mem_map(mmmt->addr, mmmt->len);
}
}
printf("%2 %2\n", mbd->mem_lower, mbd->mem_upper);
}
void _main(multiboot_info_t* mbd, uint32_t magic)
@ -54,8 +47,6 @@ void _main(multiboot_info_t* mbd, uint32_t magic)
terminal_initialize();
serial_initialize();
#endif
printf("%2, %2\n", mbd->mem_lower, mbd->mem_upper);
verify_memmap(mbd, magic);
gdt_init();