feat(userspace-rt): add runtime crate with entry point, panic handler, and allocator re-export

Snake and hello apps now use extern crate userspace_rt — no more boilerplate assembly or panic handlers in app code.
This commit is contained in:
2026-10-18 04:04:52 +02:00
parent e092fa4ae5
commit 29434805a6
9 changed files with 58 additions and 70 deletions

View File

@@ -9,11 +9,4 @@ test = false
bench = false
[dependencies]
userspace = { workspace = true }
[profile.release]
panic = "abort"
opt-level = "s"
[profile.dev]
panic = "abort"
userspace-rt = { workspace = true }

View File

@@ -1,24 +1,9 @@
#![no_std]
#![no_main]
use core::arch::global_asm;
global_asm!(
r#"
.section .text.entry
.globl _start
_start:
call main
j _start
"#
);
extern crate userspace_rt;
#[unsafe(no_mangle)]
extern "C" fn main() -> ! {
userspace::syscall::exit();
}
#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
loop {}
extern "C" fn main() {
// The runtime handles _start, exit, and panic.
}