mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-13 07:48:30 +00:00
test-spawn: add program to test spawning
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
2e69ae8a12
commit
8c19cfb1b7
3 changed files with 28 additions and 0 deletions
9
test-spawn/Cargo.toml
Normal file
9
test-spawn/Cargo.toml
Normal file
|
|
@ -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" }
|
||||
19
test-spawn/src/main.rs
Normal file
19
test-spawn/src/main.rs
Normal file
|
|
@ -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!");
|
||||
}
|
||||
BIN
test-spawn/src/spawn-stub
Normal file
BIN
test-spawn/src/spawn-stub
Normal file
Binary file not shown.
Loading…
Reference in a new issue