diff --git a/src/arch/x86_64/stop.rs b/src/arch/x86_64/stop.rs index ec0b23a..909757f 100644 --- a/src/arch/x86_64/stop.rs +++ b/src/arch/x86_64/stop.rs @@ -36,9 +36,17 @@ pub unsafe extern fn kstop() -> ! { Pio::::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::::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"); + } }