Remove cmdargs and i/o redirection.

This commit is contained in:
Yifan Wu 2022-01-18 04:19:05 -08:00
parent 5389b7adca
commit e9597d901b
12 changed files with 28 additions and 213 deletions

View file

@ -1,6 +1,5 @@
use core::arch::asm;
const SYSCALL_DUP: usize = 24;
const SYSCALL_OPEN: usize = 56;
const SYSCALL_CLOSE: usize = 57;
const SYSCALL_READ: usize = 63;
@ -27,10 +26,6 @@ fn syscall(id: usize, args: [usize; 3]) -> isize {
ret
}
pub fn sys_dup(fd: usize) -> isize {
syscall(SYSCALL_DUP, [fd, 0, 0])
}
pub fn sys_open(path: &str, flags: u32) -> isize {
syscall(SYSCALL_OPEN, [path.as_ptr() as usize, flags as usize, 0])
}
@ -68,8 +63,8 @@ pub fn sys_fork() -> isize {
syscall(SYSCALL_FORK, [0, 0, 0])
}
pub fn sys_exec(path: &str, args: &[*const u8]) -> isize {
syscall(SYSCALL_EXEC, [path.as_ptr() as usize, args.as_ptr() as usize, 0])
pub fn sys_exec(path: &str) -> isize {
syscall(SYSCALL_EXEC, [path.as_ptr() as usize, 0, 0])
}
pub fn sys_waitpid(pid: isize, exit_code: *mut i32) -> isize {