From 8650d60a746d9e231a8aa9e9fe38a2293a021a3b Mon Sep 17 00:00:00 2001 From: pjht Date: Thu, 26 Sep 2024 11:35:23 -0500 Subject: [PATCH] Log initialization --- Cargo.lock | 5 +++++ src/main.rs | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index feddeab..6d28fc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,6 +139,7 @@ name = "line_discipline" version = "0.1.0" dependencies = [ "itertools", + "termios", ] [[package]] @@ -348,6 +349,10 @@ dependencies = [ "serde", ] +[[package]] +name = "termios" +version = "0.1.0" + [[package]] name = "unicode-ident" version = "1.0.13" diff --git a/src/main.rs b/src/main.rs index 86936b5..78c2c84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -190,13 +190,17 @@ impl file_rpc::Server for Serv { } fn main() { - let devfs_pid; - loop { - if let Some(pid) = syscalls::try_get_registered(1) { - devfs_pid = pid; - break; + let syslog_pid = loop { + if let Some(pid) = syscalls::try_get_registered(2) { + break pid; } - } + }; + let syslog_client = syslog_rpc::Client::new(syslog_pid); + let devfs_pid = loop { + if let Some(pid) = syscalls::try_get_registered(1) { + break pid; + } + }; let devfs_client = devfs_rpc::Client::new(devfs_pid); let serv = Serv { ptys: Arc::new(RwLock::new(Slab::new())), @@ -207,6 +211,7 @@ fn main() { dev_driver_rpc::register_server(Box::new(serv.clone())); file_rpc::register_server(Box::new(serv.clone())); devfs_client.register_dev("ptmx").unwrap(); + syslog_client.send_text_message("pty_server", "PTY server initialized").unwrap(); loop { ipc::process_messages() }