Start and initialize proc_man before the VFS

This commit is contained in:
pjht 2024-11-03 11:03:36 -06:00
parent ce8d183e0b
commit 6e73b15b68
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E
3 changed files with 25 additions and 6 deletions

17
Cargo.lock generated
View File

@ -86,6 +86,7 @@ dependencies = [
name = "init"
version = "0.1.0"
dependencies = [
"proc_man_rpc",
"syslog_msg_ipc",
"syslog_rpc",
"tar-no-std",
@ -174,6 +175,22 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "proc_man_rpc"
version = "0.1.0"
dependencies = [
"parking_lot",
"postcard",
"proc_man_structs",
]
[[package]]
name = "proc_man_structs"
version = "0.1.0"
dependencies = [
"serde",
]
[[package]]
name = "quote"
version = "1.0.37"

View File

@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
proc_man_rpc = { version = "0.1.0", path = "../proc_man/proc_man_rpc" }
syslog_msg_ipc = { version = "0.1.0", path = "../syslog/syslog_msg_ipc" }
syslog_rpc = { version = "0.1.0", path = "../syslog/syslog_rpc" }
tar-no-std = "0.3.1"

View File

@ -4,9 +4,9 @@
use std::ffi::CString;
use std::fs::File;
use std::io::Write;
use std::os::mikros::{ipc, syscalls};
use std::os::mikros::loader::Loader;
use std::os::mikros::syscalls::{get_initrd, new_process};
use std::os::mikros::{ipc, syscalls};
use std::path::Path;
use std::process::Command;
use syslog_msg_ipc::Message;
@ -76,6 +76,11 @@ fn main() {
syslog_client.subscribe_to_binary("devfs".to_string(), vec![0, 1]);
syslog_client.subscribe_to_binary("tarfs".to_string(), vec![0]);
let mut msg_handler = SyslogMessageHandler::new();
let proc_man_pid = run_initrd_proc(&initrd, "bin/proc_man");
let proc_man_client = proc_man_rpc::Client::new(proc_man_pid);
proc_man_client.new_proc(0, None).unwrap();
proc_man_client.new_proc(1, Some(0)).unwrap();
proc_man_client.new_proc(2, Some(0)).unwrap();
let vfs_pid = run_initrd_proc(&initrd, "bin/vfs");
let vfs_client = vfs_rpc::Client::new(vfs_pid);
run_initrd_proc(&initrd, "bin/devfs");
@ -96,11 +101,7 @@ fn main() {
}
}
run_initrd_proc(&initrd, "bin/initrd_driver");
while !msg_handler
.registered_devices
.iter()
.any(|x| x == "initrd")
{
while !msg_handler.registered_devices.iter().any(|x| x == "initrd") {
msg_handler.process_messages();
}
vfs_client