wip: alloc_femmes now uses multiboot memory mapping

This commit is contained in:
2024-11-13 13:32:14 +01:00
parent 1e35f3b710
commit 09ea386b21
4 changed files with 22 additions and 57 deletions

View File

@ -23,28 +23,22 @@ static void init_multiboot(multiboot_info_t *mbd, uint32_t magic)
const size_t mbd_size = CEIL(
(uint32_t)mbd % PAGE_SIZE + sizeof(multiboot_info_t), PAGE_SIZE);
kprintf("cramptes0\n");
// Index multiboot_info_t struct
for (uint32_t i = 0; i < mbd_size; i++)
multiboot_page_table[i] =
((uint32_t)mbd + PAGE_SIZE * i) & PAGE_MASK | INIT_FLAGS;
(((uint32_t)mbd + PAGE_SIZE * i) & PAGE_MASK) | INIT_FLAGS;
multiboot_info_t *mbd_virt =
(multiboot_info_t *)(GET_PAGE_ADDR(1023, 0) +
(uint32_t)mbd % PAGE_SIZE);
kprintf("cramptes1\n");
PRINT_PTR(mbd_virt);
/* PRINT_UINT(mbd_virt->mmap_length); */
// Index mbd->mmap_addr pointers
for (uint32_t i = 0; i < mbd_virt->mmap_length; i++)
multiboot_page_table[i + mbd_size] =
((mbd_virt->mmap_addr + i * PAGE_SIZE) & PAGE_MASK) |
INIT_FLAGS;
kprintf("cramptes2\n");
mmap_addr =
(multiboot_uint32_t *)(GET_PAGE_ADDR(1023, mbd_size) +
(uint32_t)mbd_virt->mmap_addr % PAGE_SIZE);
kprintf("cramptes3\n");
mmap_length = mbd_virt->mmap_length;
}