PMM: init (find biggest usable region)

This commit is contained in:
2025-12-31 12:02:41 +01:00
parent 8f5e2eae3e
commit 05a862e97a
7 changed files with 99 additions and 5 deletions

View File

@@ -10,6 +10,7 @@
#include "kernel.h"
#include "time/timer.h"
#include "io/kbd/ps2.h"
#include "mem/paging/pmm.h"
// Limine version used
__attribute__((used, section(".limine_requests")))
@@ -29,6 +30,13 @@ static volatile struct limine_memmap_request memmap_request = {
.revision = 0
};
// Higher Half Direct Map
__attribute__((used, section(".limine_requests")))
static volatile struct limine_hhdm_request hhdm_request = {
.id = LIMINE_HHDM_REQUEST,
.revision = 0
};
__attribute__((used, section(".limine_requests_start")))
static volatile LIMINE_REQUESTS_START_MARKER;
@@ -61,13 +69,18 @@ void kmain()
if (memmap_request.response == NULL) hcf();
memmap_display(memmap_request.response);
if (hhdm_request.response == NULL) hcf();
hhdm_display(hhdm_request.response);
pmm_init(memmap_request.response, hhdm_request.response);
CLEAR_INTERRUPTS;
gdt_init();
idt_init();
timer_init();
SET_INTERRUPTS;
//keyboard_init(FR);
keyboard_init(FR);
// Draw something
printf("%s, %s!\n", "Hello", "world");