Fix TODO: Use triple fault to guarantee reboot

Cause interrupt, since the IDT is dorked we can't find the INT 3
handler (double fault), and the double fault handler can't be
found (triple fault).
This commit is contained in:
Josh Abraham
2018-05-21 17:14:58 -10:00
parent 5cfe3f822b
commit aff0c339b4

View File

@@ -14,7 +14,10 @@ pub unsafe extern fn kreset() -> ! {
port.write(0xFE);
}
// TODO: Use triple fault to guarantee reset
// Use triple fault to guarantee reset
asm!("cli" : : : : "intel", "volatile");
asm!("lidt cs:0" : : : : "intel", "volatile");
asm!("int $$3" : : : : "intel", "volatile");
unreachable!();
}