feat: userspace round-trip — syscall stubs, ecall dispatch, U-mode entry and exit on QEMU
This commit is contained in:
24
crates/apps/hello/src/main.rs
Normal file
24
crates/apps/hello/src/main.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use core::arch::global_asm;
|
||||
|
||||
global_asm!(
|
||||
r#"
|
||||
.section .text.entry
|
||||
.globl _start
|
||||
_start:
|
||||
call main
|
||||
j _start
|
||||
"#
|
||||
);
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
extern "C" fn main() -> ! {
|
||||
userspace::syscall::exit();
|
||||
}
|
||||
|
||||
#[panic_handler]
|
||||
fn panic(_: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
Reference in New Issue
Block a user