diff --git a/kernel/src/utils/panic.c b/kernel/src/utils/panic.c index 0d327a6..023ae22 100644 --- a/kernel/src/utils/panic.c +++ b/kernel/src/utils/panic.c @@ -26,6 +26,7 @@ #include "utils/core.h" #include "platform/exceptions.h" #include "mm/stack.h" +#include "mm/region.h" #include "proc/scheduler.h" void panic_log_paging_info(cpu_state_T* state) { @@ -79,7 +80,7 @@ void panic_log_registers(cpu_state_T* state) { } void panic_log_call_stack(cpu_state_T* state) { - process_T* process = scheduler_get_current_process(); + process_T* process = state->rip >= MEM_REGION_KERNEL ? scheduler_get_process(PROCESS_KERNEL) : scheduler_get_current_process(); if (process == NULL || process->executable == NULL) { log(LOG_NONE, "Call Stack not resolvable (no symbol data access)"); return;