Commit 526700fb authored by Stefan Lankes's avatar Stefan Lankes
Browse files

using the crate qemu_exit to leave the hypervisor

- see more information at https://github.com/andre-richter/qemu-exit
parent ffd30c61
......@@ -91,4 +91,4 @@ jobs:
cargo build --no-default-features --release -p hello_world
- name: Test minimal profile
run: |
qemu-system-x86_64 -M microvm,x-option-roms=off,pit=off,pic=off,rtc=on -global virtio-mmio.force-legacy=on -nodefaults -no-user-config -display none -smp 1 -m 64M -serial stdio -kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader -initrd target/x86_64-unknown-hermit/release/hello_world -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr
qemu-system-x86_64 -M microvm,x-option-roms=off,pit=off,pic=off,rtc=on -global virtio-mmio.force-legacy=on -nodefaults -no-user-config -display none -smp 1 -m 64M -serial stdio -kernel loader/target/x86_64-unknown-hermit-loader/release/rusty-loader -initrd target/x86_64-unknown-hermit/release/hello_world -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr -device isa-debug-exit,iobase=0xf4,iosize=0x04
......@@ -58,6 +58,7 @@ num = { version = "0.4", default-features = false }
num-derive = "0.3"
num-traits = { version = "0.2", default-features = false }
scopeguard = { version = "1.1", default-features = false }
qemu-exit = "2.0"
[target.'cfg(target_arch = "x86_64")'.dependencies]
multiboot = "0.7"
......@@ -72,9 +73,6 @@ x86 = { version = "0.43", default-features = false }
version = "0.0.6"
default-features = false
[target.'cfg(target_arch = "aarch64")'.dependencies]
qemu-exit = "2.0"
# The development profile, used for `cargo build`.
[profile.dev]
opt-level = 1 # controls the `--opt-level` the compiler builds with
......
......@@ -22,6 +22,7 @@ use core::arch::x86_64::{
use core::convert::TryInto;
use core::hint::spin_loop;
use core::{fmt, u32};
use qemu_exit::QEMUExit;
use x86::bits64::segmentation;
const IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP: u64 = 1 << 16;
......@@ -965,9 +966,9 @@ pub fn shutdown() -> ! {
#[cfg(feature = "acpi")]
acpi::poweroff();
loop {
halt();
}
// assume that we running on Qemu
let exit_handler = qemu_exit::X86::new(0xf4, 1);
exit_handler.exit_success()
}
pub fn get_timer_ticks() -> u64 {
......
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