#include #include #include #include #include #include struct stackframe { struct stackframe* ebp; uint32_t eip; }; __attribute__((noreturn)) void _panic_impl(char* msg, int line, char* file, ...) { arch_disable_int(); va_list args; va_start(args, file); term_clear(); term_setpos(0, 0); term_setfg(VGA_LIGHT_RED); puts("!!!PANIC!!!\n"); term_setfg(VGA_WHITE); vprintk(msg, args); if (!term_newline()) putchar('\n'); printk("\nin %s at line %d\n", file, line); term_flush(); while(1) { arch_halt(); } }