|
|
@ -1,5 +1,6 @@
|
|
|
|
const SYSCALL_WRITE: usize = 64;
|
|
|
|
const SYSCALL_WRITE: usize = 64;
|
|
|
|
const SYSCALL_EXIT: usize = 93;
|
|
|
|
const SYSCALL_EXIT: usize = 93;
|
|
|
|
|
|
|
|
const SYSCALL_YIELD: usize = 124;
|
|
|
|
|
|
|
|
|
|
|
|
mod fs;
|
|
|
|
mod fs;
|
|
|
|
mod process;
|
|
|
|
mod process;
|
|
|
@ -12,6 +13,7 @@ pub fn syscall(syscall_id: usize, args: [usize; 3]) -> isize {
|
|
|
|
match syscall_id {
|
|
|
|
match syscall_id {
|
|
|
|
SYSCALL_WRITE => sys_write(args[0], args[1] as *const u8, args[2]),
|
|
|
|
SYSCALL_WRITE => sys_write(args[0], args[1] as *const u8, args[2]),
|
|
|
|
SYSCALL_EXIT => sys_exit(args[0] as i32),
|
|
|
|
SYSCALL_EXIT => sys_exit(args[0] as i32),
|
|
|
|
|
|
|
|
SYSCALL_YIELD => sys_yield(),
|
|
|
|
_ => panic!("Unsupported syscall_id: {}", syscall_id),
|
|
|
|
_ => panic!("Unsupported syscall_id: {}", syscall_id),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|