diff --git a/kernel/src/utils/panic.c b/kernel/src/utils/panic.c index cf18a4f..7f2ab69 100644 --- a/kernel/src/utils/panic.c +++ b/kernel/src/utils/panic.c @@ -57,9 +57,15 @@ void panic_log_registers(cpu_state_T* state) { void panic(cpu_state_T* state, string_t message) { log(LOG_ERROR, "!=====[ KERNEL PANIC ]=====!"); + log(LOG_NONE, "Error Message: %s", message); + + if (state == NULL) { + log(LOG_WARNING, "No detailed Information available (cpu_state null reference)"); + CORE_HALT_FOREVER + } + log(LOG_NONE, "Interrupt ID: 0x%xb", state->interrupt_id); - log(LOG_NONE, "Error Code: 0b%.32b", state->error_code); - log(LOG_NONE, "Error Message: %s\n", message); + log(LOG_NONE, "Error Code: 0b%.32b\n", state->error_code); panic_log_paging_info(state);