feat: userspace program loading and task spawning

This commit is contained in:
Zoe
2026-09-07 08:24:46 -05:00
parent 028ac8fb13
commit 3308fd2959
28 changed files with 1605 additions and 676 deletions
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "echo"
version = "0.1.0"
edition = "2024"
[dependencies]
dusk-sys = { path = "../dusk-sys" }
[[bin]]
name = "echo"
test = false
bench = false
+23
View File
@@ -0,0 +1,23 @@
#![no_std]
#![no_main]
use dusk_sys::{println, sys_exit, sys_recv, sys_send};
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
let out = [0u8; 128];
loop {
let (actual_len, sender) = sys_recv(out.as_ptr() as usize, out.len()).unwrap();
println!(
"[echo] Received: {}",
core::str::from_utf8(&out[..actual_len]).unwrap()
);
sys_send(sender, out.as_ptr() as usize, actual_len).unwrap();
}
}
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
println!("{info}");
sys_exit(1);
}