#include "interrupts/IRQ.h" #include "interrupts/SavedContext.h" #include "panic/hang.h" #include "std/stdio.h" extern "C" void common_handler(SavedContext* context) { if (context->number == 13) { printf("General protection fault at %zx, %ld, %ld, %zx, %ld, %zx\n", context->rip, context->cs, context->ss, context->rsp, context->error_code, context->cr2); while (1) halt(); } if (context->number == 14) { printf("Page fault (RIP 0x%lx), while trying to access %lx\n", context->rip, context->cr2); hang(); } if (context->number >= 0x20 && context->number < 0x30) { IRQ::interrupt_handler(context); } return; }