From cbe2690cd5d1b290633c466ebb4df7b64b09b037 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Thu, 28 Mar 2024 21:30:12 -0500 Subject: arch: i386: kernel: add mostly finished PFA and paging system Add the mostly finished physical memory allocator and expose its functions to the paging system. Signed-off-by: Danny Holman --- arch/i386/kernel/multiboot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arch/i386/kernel/multiboot.c') diff --git a/arch/i386/kernel/multiboot.c b/arch/i386/kernel/multiboot.c index 87876f0..720866b 100644 --- a/arch/i386/kernel/multiboot.c +++ b/arch/i386/kernel/multiboot.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -22,7 +22,6 @@ void i386_entry(uint32_t mboot_magic, struct mboot_info *header) { timer_init(); register_irq_handler(1, keyboard_handler); - enable_ints(); if (mboot_magic != MBOOT_LOADER_MAGIC) { fb_write("NOT BOOTED WITH MULTIBOOT BOOTLOADER\n", 37); @@ -30,6 +29,7 @@ void i386_entry(uint32_t mboot_magic, struct mboot_info *header) { disable_ints(); while (1); } + map_page(NULL, (uintptr_t)header, (uintptr_t)header, PD_PRES); if (!(header->flags >> 6 & 0x1)) { fb_write("NO MEMORY MAP FROM BOOTLOADER\n", 30); fb_write("RESET PC!\n", 10); @@ -37,6 +37,8 @@ void i386_entry(uint32_t mboot_magic, struct mboot_info *header) { while (1); } + pfa_init(header); + enable_ints(); kernel_main((char*)header->cmdline); while (1); -- cgit v1.2.3