Commit a0d2f4d2 authored by Shetty Yttehs's avatar Shetty Yttehs :yum:
Browse files

chore: dummy implement syscall mount/umount

No related merge requests found
Showing with 16 additions and 2 deletions
+16 -2
......@@ -58,13 +58,13 @@ fn run_test() -> ! {
"getcwd",
// "munmap",
"pipe",
// "umount",
"umount",
"close",
"getppid",
"chdir",
"open",
// "clone",
// "mount",
"mount",
"exit",
"sleep",
// "mmap",
......
......@@ -132,3 +132,13 @@ pub fn sys_pipe(pipe_ptr: *mut i32) -> isize {
}
0
}
pub fn sys_mount(_source_ptr: *const u8, _target_ptr: *const u8, _fs_type_ptr: *const u8) -> isize {
// unsupported for rust-fatfs
0
}
pub fn sys_umount(_target_ptr: *const u8) -> isize {
// unsupported for rust-fatfs
0
}
......@@ -24,6 +24,8 @@ const SYSCALL_CLOSE: usize = 57;
const SYSCALL_MKDIR: usize = 34;
const SYSCALL_PIPE: usize = 59;
const SYSCALL_NANO_SLEEP: usize = 101;
const SYSCALL_MOUNT: usize = 40;
const SYSCALL_UMOUNT: usize = 39;
pub fn syscall(id: usize, args: [usize; 6]) -> isize {
match id {
......@@ -45,6 +47,8 @@ pub fn syscall(id: usize, args: [usize; 6]) -> isize {
SYSCALL_MKDIR => sys_mkdir(args[0], args[1] as *const u8, args[2]),
SYSCALL_PIPE => sys_pipe(args[0] as *mut i32),
SYSCALL_NANO_SLEEP => sys_nanosleep(args[0] as *const u8, args[1]),
SYSCALL_MOUNT => sys_mount(args[0] as *const u8, args[1] as *const u8, args[2] as *const u8),
SYSCALL_UMOUNT => sys_umount(args[0] as *const u8),
_ => {
error!("Unsupported syscall id: {}", id);
sys_exit(-1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment