diff options
author | Danny Holman <dholman@gymli.org> | 2025-01-12 01:17:36 -0600 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2025-01-12 01:19:11 -0600 |
commit | 95cd78840f0891e60f5ebecc8a8eb4fbaf3c2ebf (patch) | |
tree | c8c35347b50477929727fa5be9f5d0f55cbe18fd /kernel/panic.c | |
parent | 5e166f3042a8e7b3031aae4da7006f80caa53ecc (diff) |
PROJECT RESTRUCTURING
Move the entire kernel into its own directory. Create new directories
for system commands, libraries and other required essentials for a
complete Unix-like operating system.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r-- | kernel/panic.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/kernel/panic.c b/kernel/panic.c deleted file mode 100644 index 65279f0..0000000 --- a/kernel/panic.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <kernel/panic.h> -#include <libk/io.h> -#include <stdint.h> -#include <stddef.h> - -static int panicked = 0; - -void walk_stack(uintptr_t *addrs, size_t n); - -void stack_trace(void) { - kprintf("PRINTING STACK TRACE\n"); - uintptr_t strace[32]; - walk_stack(strace, 32); - for (int i = 0; i < 32; i++) { - if (strace[i] == 0) - break; - kprintf("#%d: %x\n", i, strace[i]); - } -} - -void panic(const char *str) { - panicked = 1; - kprintf("KERNEL PANIC: %s\n", str); - stack_trace(); - while (1); -} |