Implement mount/unmount

This commit is contained in:
Mark Poliakov 2023-07-20 12:00:22 +03:00
parent e88a2857e1
commit 5541cc3214
3 changed files with 20 additions and 0 deletions

View File

@ -10,6 +10,7 @@ primitive_enum!(pub enum Error: u32 {
IsADirectory = 7,
InvalidFile = 8,
NotImplemented = 9,
NotADirectory = 10,
});
pub trait FromSyscallResult: Sized {

View File

@ -1,11 +1,27 @@
use core::fmt;
#[derive(Clone, Copy, PartialEq, Debug, PartialOrd, Ord, Eq)]
#[repr(transparent)]
pub struct RawFd(pub u32);
#[derive(Clone, Copy, PartialEq, Eq)]
#[repr(transparent)]
pub struct OpenFlags(pub u32);
#[derive(Clone, Debug)]
#[repr(C)]
pub struct MountOptions {
pub source: Option<&'static str>,
pub filesystem: Option<&'static str>,
pub target: &'static str,
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct UnmountOptions {
pub mountpoint: &'static str,
}
const O_READ: u32 = 1 << 0;
const O_WRITE: u32 = 1 << 1;

View File

@ -10,5 +10,8 @@ primitive_enum!(pub enum SyscallFunction: usize {
Open = 7,
Close = 8,
Mount = 101,
Unmount = 102,
DebugTrace = 128,
});