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
+5 -2
View File
@@ -7,15 +7,18 @@ use dusk_sys::{println, sys_exit, sys_recv, sys_send};
pub extern "C" fn _start() -> ! {
let msg = "Hello from client!";
println!("[client] Sent: {}", msg);
sys_send(0, msg.as_ptr() as usize, msg.len()).unwrap();
// TODO: we assume the echo server is task 1 (spawned by omega3)
sys_send(1, msg.as_ptr() as usize, msg.len()).unwrap();
let out = [0u8; 128];
let out_ptr = out.as_ptr() as usize;
let max_len = out.len();
let (actual_len, sender) = sys_recv(out_ptr, max_len).unwrap();
let (actual_len, _) = sys_recv(out_ptr, max_len).unwrap();
println!(
"[client] Received: {}",
core::str::from_utf8(&out[..actual_len]).unwrap()
);
sys_exit(0);
}