Kernel: Reboot will now always succeed

If acpi reset fails, we forcefully trigger a triple fault to restart
the system.
This commit is contained in:
Bananymous
2023-09-28 12:48:52 +03:00
parent 6eda65eea6
commit d7ecf94347
3 changed files with 25 additions and 1 deletions

View File

@@ -424,4 +424,14 @@ namespace IDT
flush_idt();
}
[[noreturn]] void force_triple_fault()
{
// load 0 sized IDT and trigger an interrupt to force triple fault
asm volatile("cli");
s_idtr.size = 0;
flush_idt();
asm volatile("int $0x00");
ASSERT_NOT_REACHED();
}
}