diff options
author | Danny Holman <dholman@gymli.org> | 2024-03-28 21:30:12 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-03-28 21:30:12 -0500 |
commit | cbe2690cd5d1b290633c466ebb4df7b64b09b037 (patch) | |
tree | 99f77ef19f303c42c028be11cbb4210245b8a583 /arch/i386/kernel/multiboot.c | |
parent | 891f1010bbdc1351bda8d2a6139094a14bdfd5e1 (diff) |
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 <dholman@gymli.org>
Diffstat (limited to 'arch/i386/kernel/multiboot.c')
-rw-r--r-- | arch/i386/kernel/multiboot.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 <kernel/idt.h> #include <kernel/pic.h> #include <kernel/paging.h> -#include <kernel/mem.h> +#include <kernel/pmem.h> #include <kernel/keyboard.h> #include <kernel/framebuffer.h> #include <kernel/timer.h> @@ -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); |