From d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Mon, 11 Mar 2024 21:30:31 -0400 Subject: usermode capable kernel with logging syscall --- lib/kpanic.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/kpanic.c (limited to 'lib/kpanic.c') diff --git a/lib/kpanic.c b/lib/kpanic.c new file mode 100644 index 0000000..97e42eb --- /dev/null +++ b/lib/kpanic.c @@ -0,0 +1,15 @@ +#include "jove.h" +#include "io/log.h" + +#include + +__attribute__((noreturn)) +void _kpanic(const char *file, int line, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + klogf("!!! PANIC !!!\n%s:%i\n", file, line); + kvlogf(fmt, ap); + va_end(ap); + for(;;) __asm__ volatile("hlt"); +} -- cgit v1.2.1