Commit ca511b98 authored by Jeremy Soller's avatar Jeremy Soller

Add code to shut down QEMU with it's default ACPI settings, run cli hlt in loop

parent 504e93d1
......@@ -36,9 +36,17 @@ pub unsafe extern fn kstop() -> ! {
Pio::<u8>::new(port).write(c);
}
// Magic shutdown using qemu default ACPI method
{
let port = 0x604;
let data = 0x2000;
println!("Shutdown with outb(0x{:X}, 0x{:X})", port, data);
Pio::<u16>::new(port).write(data);
}
// Magic code for VMWare. Also a hard lock.
println!("Shutdown with cli hlt");
asm!("cli; hlt" : : : : "intel", "volatile");
unreachable!();
loop {
asm!("cli; hlt" : : : : "intel", "volatile");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment