kernel/kernel/panic.c

26 lines
513 B
C
Raw Normal View History

2017-11-08 04:49:30 +00:00
#include "panic.h"
#include <kernaux/arch/i386.h>
2020-12-06 03:04:34 +00:00
#include <kernaux/console.h>
2017-11-08 04:49:30 +00:00
void panic(const char *const s)
{
2020-12-06 03:04:34 +00:00
kernaux_console_printf("[FAIL] panic: %s\n", s);
kernaux_arch_i386_hang();
2017-11-08 04:49:30 +00:00
}
void halt()
{
panic("Kernel main function returned.");
}
2021-12-14 23:53:05 +00:00
void kernaux_assert_fn(
const char *const file,
const int line,
const char *const str
) {
2021-12-14 23:57:12 +00:00
kernaux_console_printf("[FAIL] assertion failed: %s:%u: \"%s\"\n",
2021-12-14 23:53:05 +00:00
file, line, str);
kernaux_arch_i386_hang();
}