feat: basic IPC

This commit is contained in:
Zoe
2026-09-06 10:53:45 -05:00
parent dd596d5378
commit 028ac8fb13
19 changed files with 674 additions and 373 deletions
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "client"
version = "0.1.0"
edition = "2024"
[dependencies]
dusk-sys = { path = "../dusk-sys" }
[[bin]]
name = "client"
test = false
bench = false
+26
View File
@@ -0,0 +1,26 @@
#![no_std]
#![no_main]
use dusk_sys::{println, sys_exit, sys_recv, sys_send};
#[unsafe(no_mangle)]
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();
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();
println!(
"[client] Received: {}",
core::str::from_utf8(&out[..actual_len]).unwrap()
);
sys_exit(0);
}
#[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! {
println!("{info}");
sys_exit(1);
}