From 2ae431b4fb4460cc222f059a343dd8ecade8e1ea Mon Sep 17 00:00:00 2001 From: Nic Gaffney Date: Fri, 16 Feb 2024 21:17:51 -0600 Subject: Forgot to add these last time womp womp --- src/kernel/exceptions.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/kernel/exceptions.c') diff --git a/src/kernel/exceptions.c b/src/kernel/exceptions.c index ded9e9b..11e45fb 100644 --- a/src/kernel/exceptions.c +++ b/src/kernel/exceptions.c @@ -1,9 +1,13 @@ #include "print.h" -__attribute__((noreturn)) void exception_handler(void); -void exception_handler() { - print_set_color(PRINT_COLOR_RED, PRINT_COLOR_BLACK); +__attribute__((noreturn)) void panic(const char *msg) { + print_set_color(PRINT_COLOR_BLACK, PRINT_COLOR_RED); print_clear(); - printf("KERNEL EXCEPTION"); + printf("PANIC!!\n\t%s", msg); __asm__ volatile("cli; hlt"); + while (1) + ; } + +__attribute__((noreturn)) void exception_handler(void); +void exception_handler() { panic("KERNEL EXCEPTION"); } -- cgit v1.2.3