From 511b9484826d9fe2c6c368d467f8c9fa009d9425 Mon Sep 17 00:00:00 2001 From: pjht Date: Tue, 6 Aug 2024 19:37:55 -0500 Subject: [PATCH] Pass name of process as first argument --- Cargo.lock | 1 - src/main.rs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7cf8d45..b650053 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -289,7 +289,6 @@ version = "0.1.0" dependencies = [ "parking_lot", "postcard", - "serde", "syslog_structs", ] diff --git a/src/main.rs b/src/main.rs index f31338c..49d5629 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ #![feature(int_roundings)] #![deny(unsafe_op_in_unsafe_fn)] +use std::ffi::CString; use std::os::mikros::loader::Loader; use std::os::mikros::syscalls::{get_initrd, new_process}; use std::path::Path; @@ -56,5 +57,6 @@ fn run_initrd_proc(initrd: &TarArchiveRef, path: &str) -> u64 { .expect(&format!("{} not found", path)) .data(); 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() }