Log initialization

This commit is contained in:
pjht 2024-09-26 11:35:23 -05:00
parent 142c1d2aab
commit 8650d60a74
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A
2 changed files with 16 additions and 6 deletions

5
Cargo.lock generated
View File

@ -139,6 +139,7 @@ name = "line_discipline"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"itertools", "itertools",
"termios",
] ]
[[package]] [[package]]
@ -348,6 +349,10 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "termios"
version = "0.1.0"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.13" version = "1.0.13"

View File

@ -190,13 +190,17 @@ impl file_rpc::Server for Serv {
} }
fn main() { fn main() {
let devfs_pid; let syslog_pid = loop {
loop { if let Some(pid) = syscalls::try_get_registered(2) {
if let Some(pid) = syscalls::try_get_registered(1) { break pid;
devfs_pid = pid;
break;
} }
} };
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 devfs_client = devfs_rpc::Client::new(devfs_pid);
let serv = Serv { let serv = Serv {
ptys: Arc::new(RwLock::new(Slab::new())), ptys: Arc::new(RwLock::new(Slab::new())),
@ -207,6 +211,7 @@ fn main() {
dev_driver_rpc::register_server(Box::new(serv.clone())); dev_driver_rpc::register_server(Box::new(serv.clone()));
file_rpc::register_server(Box::new(serv.clone())); file_rpc::register_server(Box::new(serv.clone()));
devfs_client.register_dev("ptmx").unwrap(); devfs_client.register_dev("ptmx").unwrap();
syslog_client.send_text_message("pty_server", "PTY server initialized").unwrap();
loop { loop {
ipc::process_messages() ipc::process_messages()
} }