#include <stdint.h>
#include "../../include/limine.h"

// This is the "Panic" screen when something goes wrong
void kpanic(const char* message) {
    // In a real OS, we'd clear the screen and show an error code here.
    // For now, we'll just stop the computer.
    while(1) { __asm__("cli; hlt"); }
}

void exception_handler(uint64_t vec) {
    switch(vec) {
        case 0: kpanic("DIVISION BY ZERO"); break;
        case 14: kpanic("PAGE FAULT"); break;
        default: kpanic("UNKNOWN EXCEPTION"); break;
    }
}