Exit qemu

This commit is contained in:
Philipp Oppermann
2019-01-25 13:38:26 +01:00
parent c21f051300
commit d007aae993
3 changed files with 36 additions and 0 deletions

View File

@@ -13,9 +13,20 @@ pub extern "C" fn _start() -> ! {
println!("Hello World{}", "!");
serial_println!("Hello Host{}", "!");
unsafe {
exit_qemu();
}
loop {}
}
pub unsafe fn exit_qemu() {
use x86_64::instructions::port::Port;
let mut port = Port::<u32>::new(0xf4);
port.write(0);
}
/// This function is called on panic.
#[cfg(not(test))]
#[panic_handler]