From 1e4a254674f668839e5de273916024c16814b045 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 03:19:57 -0400 Subject: (basic, not much tested) keyboard, better panic --- src/kernel/panic.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/kernel/panic.c') diff --git a/src/kernel/panic.c b/src/kernel/panic.c index a2e68e3..5d32bf7 100644 --- a/src/kernel/panic.c +++ b/src/kernel/panic.c @@ -1,11 +1,17 @@ -#include "panic.h" #include "log.h" #include "vga.h" +#include "util.h" -void panic(const char *message) { +__attribute__ ((noreturn)) +void panic(const char *filename, uint32_t line, const char *message) { set_log_mode(LOG_PANIC); vga_blank(); - logsz("Kernel panic: "); + logsz("Kernel panic ["); + logsz(filename); + char nbuf[12] = ":"; + u32_dec(line, nbuf + 1); + logsz(nbuf); + logsz("]: "); logsz(message); logsz("\nHalting."); while (1) -- cgit v1.2.3