Launch a test process using std APIs

This commit is contained in:
pjht 2024-06-18 16:37:34 -05:00
parent cc29c1edef
commit 1a218a9978
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -4,6 +4,7 @@
use std::os::mikros::loader::Loader; use std::os::mikros::loader::Loader;
use std::os::mikros::syscalls::{get_initrd, new_process}; use std::os::mikros::syscalls::{get_initrd, new_process};
use std::path::Path; use std::path::Path;
use std::process::Command;
use tar_no_std::TarArchiveRef; use tar_no_std::TarArchiveRef;
fn main() { fn main() {
@ -29,8 +30,7 @@ fn main() {
} }
} }
println!("[INIT] Mounted initrd as root"); println!("[INIT] Mounted initrd as root");
println!("/test_file.txt:"); Command::new("/bin/load_test").spawn().unwrap();
print!("{}", std::fs::read_to_string("/test_file.txt").unwrap())
} }
fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 { fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 {