From efe10908766d96974c008a6a8f124916fdca7a14 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 15 Apr 2024 23:47:25 +0200 Subject: Kernel: Improve "out of memory" error handling It can now boot with fairly low memory while not crashing and instead gracefully failing the operation. Userland still does not properly handle errors. --- kernel/cpu/idt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'kernel/cpu') diff --git a/kernel/cpu/idt.c b/kernel/cpu/idt.c index b668c6e..ce21d08 100644 --- a/kernel/cpu/idt.c +++ b/kernel/cpu/idt.c @@ -53,6 +53,10 @@ void general_protection_fault(reg_t *regs) { klog("General Protetion Fault", 0x1); kprintf(" Error Code: %x\n", regs->error_code); kprintf("Instruction Pointer: %x\n", regs->eip); + if (current_task) { + kprintf("PID: %x\n", current_task->pid); + kprintf("Name: %s\n", current_task->program_name); + } dump_backtrace(12); halt(); EOI(0xD - 8); -- cgit v1.2.3