Browse Source

fixed assert/panic

master
Mathieu Sérandour 2 years ago
parent
commit
867169b8ca
  1. 4
      kernel/debug/assert.c
  2. 10
      kernel/debug/panic.c

4
kernel/debug/assert.c

@ -8,7 +8,7 @@ void __assert(const char* __restrict__ expression,
const int line) {
char buffer[1024];
sprintf("assertion '%s' failed at: %s:%d", expression, file, line);
sprintf(buffer, "assertion '%s' failed at: %s:%d", expression, file, line);
panic(buffer);
panic("buffer");
}

10
kernel/debug/panic.c

@ -6,18 +6,18 @@
__attribute__((noreturn)) void panic(const char* panic_string) {
// checks if video is operationnal
if(get_terminal_handler() != NULL) {
termina_set_colors(0xa0a0a0, 0x0000ff);
terminal_set_colors(0xa0a0a0, 0x0000ff);
if(panic_string == NULL)
panic_string = "";
panic_string = "(null)";
kprintf(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
"!!!!!!!!!!!!! KERNL PANIC !!!!!!!!!!!!!\n"
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
"%s\n\n\n"
"you may manually shutdown the machine.\n"
"%s\n\n"
"you may manually shutdown the machine.\n",
panic_string
);
}
for(;;)

Loading…
Cancel
Save