Pass name of process as first argument

This commit is contained in:
pjht 2024-08-06 19:37:55 -05:00
parent b372f96ce6
commit 511b948482
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E
2 changed files with 3 additions and 2 deletions

1
Cargo.lock generated
View File

@ -289,7 +289,6 @@ version = "0.1.0"
dependencies = [ dependencies = [
"parking_lot", "parking_lot",
"postcard", "postcard",
"serde",
"syslog_structs", "syslog_structs",
] ]

View File

@ -1,6 +1,7 @@
#![feature(int_roundings)] #![feature(int_roundings)]
#![deny(unsafe_op_in_unsafe_fn)] #![deny(unsafe_op_in_unsafe_fn)]
use std::ffi::CString;
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;
@ -56,5 +57,6 @@ fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 {
.expect(&format!("{} not found", path)) .expect(&format!("{} not found", path))
.data(); .data();
let (space, entry) = Loader::load(&proc); let (space, entry) = Loader::load(&proc);
new_process(entry as _, space).unwrap() let path_arg = CString::new(path).unwrap();
new_process(entry as _, space, &[path_arg.as_bytes_with_nul()]).unwrap()
} }