diff options
author | Anton Kling <anton@kling.gg> | 2024-04-15 23:47:25 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-04-16 00:02:23 +0200 |
commit | efe10908766d96974c008a6a8f124916fdca7a14 (patch) | |
tree | 69f90dc3c01d32d63a38ab50f61268b1ac06dc97 /kernel/cpu | |
parent | 62ba2a9ab01e5f2a9b1cd325af8d3112702b7713 (diff) |
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.
Diffstat (limited to 'kernel/cpu')
-rw-r--r-- | kernel/cpu/idt.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |