diff options
author | Benji Dial <benji6283@gmail.com> | 2020-09-13 03:19:57 -0400 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2020-09-13 03:19:57 -0400 |
commit | 1e4a254674f668839e5de273916024c16814b045 (patch) | |
tree | 6774f4d4398a29c4aafb4120070975d864ffcde4 /src/kernel/panic.c | |
parent | b8284137d4e0eec11c78bc14047243fce6a51373 (diff) | |
download | portland-os-1e4a254674f668839e5de273916024c16814b045.tar.gz |
(basic, not much tested) keyboard, better panic
Diffstat (limited to 'src/kernel/panic.c')
-rw-r--r-- | src/kernel/panic.c | 12 |
1 files changed, 9 insertions, 3 deletions
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) |