Commit 10cde6fc authored by Jonathan Schwender's avatar Jonathan Schwender Committed by Stefan Lankes
Browse files

aarch64: Attempt to exit via QEMU on aarch64

This will help with testing (rusty-loader) since we currently
can't go very far in the kernel.
However if we reach this point, then that is already useful
for testing rusty-loader in CI.
This requires passing the `-semihosting` option to QEMU.
If this is not done or real hardware is used, a spinloop
will be entered.
parent 49c723d7
......@@ -89,6 +89,9 @@ x86 = { version = "0.41", default-features = false }
git = "https://github.com/hermitcore/rust-aarch64"
default-features = false
[target.'cfg(target_arch = "aarch64")'.dependencies]
qemu-exit = "1.0"
[target.'cfg(target_arch = "aarch64")'.dependencies.aarch64]
path = "/Users/stefan/share/rust-aarch64"
default-features = false
......
......@@ -72,6 +72,9 @@ use core::sync::atomic::{AtomicU32, Ordering};
use arch::percore::*;
use mm::allocator::LockedHeap;
#[cfg(target_arch = "aarch64")]
use qemu_exit::QEMUExit;
pub use crate::arch::*;
pub use crate::config::*;
pub use crate::syscalls::*;
......@@ -339,8 +342,15 @@ fn boot_processor_main() -> ! {
environment::get_tls_start(),
environment::get_tls_memsz()
);
info!("Entering Spinloop - please implement / fix more to proceed");
loop {} /* Compiles up to here - loop prevents linker errors */
#[cfg(target_arch = "aarch64")]
{
info!("The current hermit-kernel is only implemented up to this point on aarch64.");
info!("Attempting to exit via QEMU.");
info!("This requires that you passed the `-semihosting` option to QEMU.");
let exit_handler = qemu_exit::AArch64::new();
exit_handler.exit_success();
loop {} /* Compiles up to here - loop prevents linker errors */
}
arch::boot_processor_init();
scheduler::add_current_core();
......
Supports Markdown
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