Implement mount/unmount
This commit is contained in:
parent
e88a2857e1
commit
5541cc3214
@ -10,6 +10,7 @@ primitive_enum!(pub enum Error: u32 {
|
|||||||
IsADirectory = 7,
|
IsADirectory = 7,
|
||||||
InvalidFile = 8,
|
InvalidFile = 8,
|
||||||
NotImplemented = 9,
|
NotImplemented = 9,
|
||||||
|
NotADirectory = 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
pub trait FromSyscallResult: Sized {
|
pub trait FromSyscallResult: Sized {
|
||||||
|
16
src/io.rs
16
src/io.rs
@ -1,11 +1,27 @@
|
|||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Debug, PartialOrd, Ord, Eq)]
|
#[derive(Clone, Copy, PartialEq, Debug, PartialOrd, Ord, Eq)]
|
||||||
|
#[repr(transparent)]
|
||||||
pub struct RawFd(pub u32);
|
pub struct RawFd(pub u32);
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||||
|
#[repr(transparent)]
|
||||||
pub struct OpenFlags(pub u32);
|
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_READ: u32 = 1 << 0;
|
||||||
const O_WRITE: u32 = 1 << 1;
|
const O_WRITE: u32 = 1 << 1;
|
||||||
|
|
||||||
|
@ -10,5 +10,8 @@ primitive_enum!(pub enum SyscallFunction: usize {
|
|||||||
Open = 7,
|
Open = 7,
|
||||||
Close = 8,
|
Close = 8,
|
||||||
|
|
||||||
|
Mount = 101,
|
||||||
|
Unmount = 102,
|
||||||
|
|
||||||
DebugTrace = 128,
|
DebugTrace = 128,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user