From 6262e41de1fc2d713239d0b15b7f759df5ed4901 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 6 May 2023 00:10:15 +0300 Subject: [PATCH] Kernel: ISRs now print pid and tid --- kernel/arch/x86_64/IDT.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/arch/x86_64/IDT.cpp b/kernel/arch/x86_64/IDT.cpp index 608c2d70..9cb16de9 100644 --- a/kernel/arch/x86_64/IDT.cpp +++ b/kernel/arch/x86_64/IDT.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #define REGISTER_ISR_HANDLER(i) register_interrupt_handler(i, isr ## i) @@ -99,13 +100,13 @@ namespace IDT extern "C" void cpp_isr_handler(uint64_t isr, uint64_t error, const Registers* regs) { Kernel::panic( - "{} (error code: 0x{16H})\r\n" + "{} (error code: 0x{16H}), pid {}, tid {}\r\n" "Register dump\r\n" "rax=0x{16H}, rbx=0x{16H}, rcx=0x{16H}, rdx=0x{16H}\r\n" "rsp=0x{16H}, rbp=0x{16H}, rdi=0x{16H}, rsi=0x{16H}\r\n" "rip=0x{16H}, rflags=0x{16H}\r\n" "cr0=0x{16H}, cr2=0x{16H}, cr3=0x{16H}, cr4=0x{16H}\r\n", - isr_exceptions[isr], error, + isr_exceptions[isr], error, Kernel::Process::current().pid(), Kernel::Thread::current().tid(), regs->rax, regs->rbx, regs->rcx, regs->rdx, regs->rsp, regs->rbp, regs->rdi, regs->rsi, regs->rip, regs->rflags,