Format
This commit is contained in:
parent
9f3136724a
commit
76afb94f63
@ -1,7 +1,8 @@
|
||||
#![allow(clippy::result_unit_err)]
|
||||
|
||||
use std::{
|
||||
os::mikros::ipc::rpc::{self, IncomingCall}, path::Path,
|
||||
os::mikros::ipc::rpc::{self, IncomingCall},
|
||||
path::Path,
|
||||
};
|
||||
|
||||
use parking_lot::RwLock;
|
||||
|
18
src/main.rs
18
src/main.rs
@ -1,4 +1,8 @@
|
||||
use std::{collections::HashMap, os::mikros::{ipc, syscalls}, sync::Arc};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
os::mikros::{ipc, syscalls},
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use parking_lot::RwLock;
|
||||
|
||||
@ -24,12 +28,14 @@ impl fs_rpc::Server for Serv {
|
||||
impl devfs_rpc::Server for Serv {
|
||||
fn register_dev(&self, from: u64, name: &str) -> Result<(), ()> {
|
||||
self.devices.write().insert(name.to_owned(), from);
|
||||
self.syslog_client.send_text_binary_message(
|
||||
self.syslog_client
|
||||
.send_text_binary_message(
|
||||
"devfs",
|
||||
format!("PID {} registered device {}", from, name),
|
||||
1,
|
||||
name.as_bytes().to_vec()
|
||||
).unwrap();
|
||||
name.as_bytes().to_vec(),
|
||||
)
|
||||
.unwrap();
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@ -58,7 +64,9 @@ fn main() {
|
||||
}
|
||||
vfs_rpc::Client::new(vfs_pid).register_fs("devfs").unwrap();
|
||||
syscalls::register(1);
|
||||
syslog_client.send_text_binary_message("devfs", "Devfs initialized", 0, &[]).unwrap();
|
||||
syslog_client
|
||||
.send_text_binary_message("devfs", "Devfs initialized", 0, [])
|
||||
.unwrap();
|
||||
loop {
|
||||
ipc::process_messages()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user