GDT finally works

This commit is contained in:
2025-08-10 21:29:16 +02:00
parent f8f00cc608
commit 8ee1ea1292
36 changed files with 868 additions and 206 deletions

21
kernel/hal/x86_64/hal.c Normal file
View File

@ -0,0 +1,21 @@
#include <stdint.h>
#include <stdbool.h>
#include "hal/hal.h"
#include "kprintf.h"
#include "serial.h"
#include "gdt.h"
void hal_init(void) {
if (!serial_init()) {
hal_hang(); // going further makes no sense
}
LOG("hal", "serial init\n");
gdt_init();
}
__attribute__((noreturn)) void hal_hang(void) {
for(;;) {
asm("hlt");
}
}