diff --git a/test-spawn/Cargo.toml b/test-spawn/Cargo.toml new file mode 100644 index 000000000..e8c888f35 --- /dev/null +++ b/test-spawn/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "test-spawn" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +xous = {path = "../xous-rs" } \ No newline at end of file diff --git a/test-spawn/src/main.rs b/test-spawn/src/main.rs new file mode 100644 index 000000000..f3771c824 --- /dev/null +++ b/test-spawn/src/main.rs @@ -0,0 +1,19 @@ +fn main() { + println!("Loading stub file"); + let spawn_stub = include_bytes!("spawn-stub"); + println!("About to launch a process..."); + + let args = xous::ProcessArgs::new(spawn_stub); + let process = xous::create_process(args).unwrap(); + println!( + "Connected to process. PID: {:?}, CID: {:?}", + process.pid, process.cid + ); + let result = xous::send_message( + process.cid, + xous::Message::new_blocking_scalar(4, 1, 2, 3, 4), + ) + .unwrap(); + println!("Result of ping: {:?}", result); + println!("Hello, world!"); +} diff --git a/test-spawn/src/spawn-stub b/test-spawn/src/spawn-stub new file mode 100644 index 000000000..366f9d91d Binary files /dev/null and b/test-spawn/src/spawn-stub differ