mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 17:33:23 +00:00
Add support for DevFS
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
cc2ab9d5d4
commit
6f321ad7b7
17
services/libs/jinux-std/src/device/mod.rs
Normal file
17
services/libs/jinux-std/src/device/mod.rs
Normal file
@ -0,0 +1,17 @@
|
||||
mod null;
|
||||
pub mod tty;
|
||||
mod zero;
|
||||
|
||||
use crate::fs::device::{add_node, Device, DeviceId, DeviceType};
|
||||
use crate::prelude::*;
|
||||
|
||||
/// Init the device node in fs, must be called after mounting rootfs.
|
||||
pub fn init() -> Result<()> {
|
||||
let null = Arc::new(null::Null);
|
||||
add_node(null, "null")?;
|
||||
let zero = Arc::new(zero::Zero);
|
||||
add_node(zero, "zero")?;
|
||||
let tty = tty::get_n_tty().clone();
|
||||
add_node(tty, "tty")?;
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user