PMM: init (find biggest usable region)
This commit is contained in:
15
src/kmain.c
15
src/kmain.c
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user