diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-03 23:38:33 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-03 23:38:33 -0400 |
commit | 3c2a519ee9ab1ee5fcf043eb403242859b541d6b (patch) | |
tree | e5571b4732f1366e36c7da5ce08dcb4c18913f1e /kernel/lib/panic.c | |
parent | pci (diff) | |
download | comus-3c2a519ee9ab1ee5fcf043eb403242859b541d6b.tar.gz comus-3c2a519ee9ab1ee5fcf043eb403242859b541d6b.tar.bz2 comus-3c2a519ee9ab1ee5fcf043eb403242859b541d6b.zip |
serial and tty
Diffstat (limited to 'kernel/lib/panic.c')
-rw-r--r-- | kernel/lib/panic.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/lib/panic.c b/kernel/lib/panic.c new file mode 100644 index 0000000..403418f --- /dev/null +++ b/kernel/lib/panic.c @@ -0,0 +1,16 @@ +#include <lib.h> +#include <stdarg.h> +#include <comus/asm.h> + +__attribute__((noreturn)) void panic(const char *format, ...) +{ + cli(); + va_list list; + va_start(list, format); + printf("\n\n!!! PANIC !!!\n"); + vprintf(format, list); + printf("\n\n"); + + while (1) + halt(); +} |