1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "panic.h" #include <stdarg.h> #include <stdio.h> __attribute__((noreturn)) void panic(const char *str, ...) { /* no printf formatting for now */ printf("KERNEL PANIC: "); va_list ap; va_start(ap, str); vprintf(str, ap); va_end(ap); for(;;) { asm("cli"); asm("hlt"); } }