add sbrk and a usertest

This commit is contained in:
闭浩扬 2023-02-04 22:15:17 +08:00
parent aaa42cfeb2
commit f45e14bfeb
8 changed files with 153 additions and 1 deletions

View file

@ -14,6 +14,7 @@ const SYSCALL_WRITE: usize = 64;
const SYSCALL_EXIT: usize = 93;
const SYSCALL_YIELD: usize = 124;
const SYSCALL_GET_TIME: usize = 169;
const SYSCALL_SBRK: usize = 214;
mod fs;
mod process;
@ -28,6 +29,7 @@ pub fn syscall(syscall_id: usize, args: [usize; 3]) -> isize {
SYSCALL_EXIT => sys_exit(args[0] as i32),
SYSCALL_YIELD => sys_yield(),
SYSCALL_GET_TIME => sys_get_time(),
SYSCALL_SBRK => sys_sbrk(args[0] as i32),
_ => panic!("Unsupported syscall_id: {}", syscall_id),
}
}