diff --git a/src/kernel/src/fs/dev/console.rs b/src/kernel/src/fs/dev/console.rs index 064729532..de4e2600e 100644 --- a/src/kernel/src/fs/dev/console.rs +++ b/src/kernel/src/fs/dev/console.rs @@ -4,11 +4,14 @@ use crate::process::VThread; use crate::ucred::Ucred; use macros::vpath; use std::fmt::{Display, Formatter}; + /// An implementation of `/dev/console`. #[derive(Debug)] pub struct Console {} + impl Console { pub const PATH: &VPath = vpath!("/dev/console"); + pub fn new() -> Self { Self {} } diff --git a/src/kernel/src/fs/dev/mod.rs b/src/kernel/src/fs/dev/mod.rs index 05091adf5..e30748e52 100644 --- a/src/kernel/src/fs/dev/mod.rs +++ b/src/kernel/src/fs/dev/mod.rs @@ -1,3 +1,3 @@ -pub mod console; -pub mod dipsw; -pub mod stdout; +pub(super) mod console; +pub(super) mod dipsw; +pub(super) mod stdout; diff --git a/src/kernel/src/fs/item.rs b/src/kernel/src/fs/item.rs index ef1ecf0f3..8a2899f06 100644 --- a/src/kernel/src/fs/item.rs +++ b/src/kernel/src/fs/item.rs @@ -1,4 +1,7 @@ -use super::{FsError, VFileOps, VPath, VPathBuf, dev::{dipsw::Dipsw, stdout::Stdout}}; +use super::{ + dev::{dipsw::Dipsw, stdout::Stdout}, + FsError, VFileOps, VPath, VPathBuf, +}; use crate::fs::dev::console::Console; use std::path::{Path, PathBuf}; @@ -86,7 +89,7 @@ impl HostFile { pub enum VDev { Console, Dipsw, - Stdout + Stdout, } impl VDev { diff --git a/src/kernel/src/fs/mod.rs b/src/kernel/src/fs/mod.rs index 8e7fb66aa..3722240cf 100644 --- a/src/kernel/src/fs/mod.rs +++ b/src/kernel/src/fs/mod.rs @@ -19,8 +19,8 @@ use std::sync::atomic::{AtomicI32, Ordering}; use std::sync::Arc; use thiserror::Error; -mod file; mod dev; +mod file; mod item; mod path; diff --git a/src/kernel/src/process/file.rs b/src/kernel/src/process/file.rs index 6d5316eec..239bd57ac 100644 --- a/src/kernel/src/process/file.rs +++ b/src/kernel/src/process/file.rs @@ -1,4 +1,8 @@ -use crate::{fs::{VFile, Fd}, syscalls::SysErr, errno::EBADF}; +use crate::{ + errno::EBADF, + fs::{Fd, VFile}, + syscalls::SysErr, +}; use gmtx::{GroupMutex, MutexGroup}; use std::sync::Arc;