diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2024-02-16 21:17:51 -0600 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2024-02-16 21:17:51 -0600 |
| commit | 2ae431b4fb4460cc222f059a343dd8ecade8e1ea (patch) | |
| tree | 396c0e03feffcf8721ea6524d7ac500e84fefab2 /src/kernel/exceptions.c | |
| parent | a4177529a7834856f16b0edbe4d126bf03742eb1 (diff) | |
| download | gftos-2ae431b4fb4460cc222f059a343dd8ecade8e1ea.tar.gz | |
Forgot to add these last time womp womp
Diffstat (limited to 'src/kernel/exceptions.c')
| -rw-r--r-- | src/kernel/exceptions.c | 12 |
1 files changed, 8 insertions, 4 deletions
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"); } |
