mirror of https://github.com/tailix/kernel.git
Fix code
This commit is contained in:
parent
577ef4c3ab
commit
bcf727aff2
|
@ -28,13 +28,13 @@ static struct KernAux_PFA pfa;
|
|||
static struct Paging paging;
|
||||
|
||||
void main(
|
||||
const unsigned long multiboot2_magic,
|
||||
const unsigned long multiboot2_info_magic,
|
||||
const struct KernAux_Multiboot2_Info *const multiboot2_info
|
||||
) {
|
||||
kernaux_assert_cb = kernaux_assert_fn;
|
||||
|
||||
if (multiboot2_magic != KERNAUX_MULTIBOOT2_MAGIC) {
|
||||
panic("Multiboot 2 magic number is invalid.");
|
||||
if (multiboot2_info_magic != KERNAUX_MULTIBOOT2_INFO_MAGIC) {
|
||||
panic("Multiboot 2 info magic number is invalid.");
|
||||
}
|
||||
|
||||
KernAux_Multiboot2_Info_print(multiboot2_info, kernaux_console_printf);
|
||||
|
|
|
@ -3,10 +3,15 @@
|
|||
#include <kernaux/asm/i386.h>
|
||||
#include <kernaux/console.h>
|
||||
|
||||
static void poweroff()
|
||||
{
|
||||
kernaux_asm_i386_outportw(0x604, 0x2000);
|
||||
}
|
||||
|
||||
void panic(const char *const s)
|
||||
{
|
||||
kernaux_console_printf("[FAIL] panic: %s\n", s);
|
||||
kernaux_asm_i386_hang();
|
||||
poweroff();
|
||||
}
|
||||
|
||||
void halt()
|
||||
|
@ -21,5 +26,5 @@ void kernaux_assert_fn(
|
|||
) {
|
||||
kernaux_console_printf("[FAIL] assertion failed: %s:%u: \"%s\"\n",
|
||||
file, line, str);
|
||||
kernaux_asm_i386_hang();
|
||||
poweroff();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue