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 | arch: i386: kmalloc: fix last element being ignored (diff) | |
download | box-95cd78840f0891e60f5ebecc8a8eb4fbaf3c2ebf.tar.gz box-95cd78840f0891e60f5ebecc8a8eb4fbaf3c2ebf.tar.zst box-95cd78840f0891e60f5ebecc8a8eb4fbaf3c2ebf.zip |
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 '')
-rw-r--r-- | kernel/core/panic.c (renamed from kernel/panic.c) | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/panic.c b/kernel/core/panic.c index 65279f0..a44a73c 100644 --- a/kernel/panic.c +++ b/kernel/core/panic.c @@ -1,8 +1,10 @@ #include <kernel/panic.h> +#include <kernel/spinlock.h> #include <libk/io.h> #include <stdint.h> #include <stddef.h> +static struct spinlock panic_lock = {0}; static int panicked = 0; void walk_stack(uintptr_t *addrs, size_t n); @@ -19,8 +21,11 @@ void stack_trace(void) { } void panic(const char *str) { + disable_ints(); + spin_lock(&panic_lock); panicked = 1; - kprintf("KERNEL PANIC: %s\n", str); + spin_unlock(&panic_lock); + kprintf("KERNEL PANIC - NOT SYNCING: %s\n", str); stack_trace(); while (1); } |