diff --git a/kernel/proc.h b/kernel/proc.h index 8ae5cf0..d48fd3f 100644 --- a/kernel/proc.h +++ b/kernel/proc.h @@ -111,4 +111,5 @@ struct proc { struct file *ofile[NOFILE]; // Open files struct inode *cwd; // Current directory char name[16]; // Process name (debugging) + int mask; // Process mask }; diff --git a/kernel/syscall.c b/kernel/syscall.c index 31b0326..075fb36 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -101,6 +101,7 @@ extern u64 sys_unlink(void); extern u64 sys_link(void); extern u64 sys_mkdir(void); extern u64 sys_close(void); +extern u64 sys_trace(void); // An array mapping syscall numbers from syscall.h // to the function that handles the system call. @@ -110,7 +111,7 @@ static u64 (*syscalls[])(void) = { [SYS_chdir] = sys_chdir, [SYS_dup] = sys_dup, [SYS_getpid] = sys_getpid, [SYS_sbrk] = sys_sbrk, [SYS_sleep] = sys_sleep, [SYS_uptime] = sys_uptime, [SYS_open] = sys_open, [SYS_write] = sys_write, [SYS_mknod] = sys_mknod, [SYS_unlink] = sys_unlink, [SYS_link] = sys_link, [SYS_mkdir] = sys_mkdir, - [SYS_close] = sys_close, + [SYS_close] = sys_close, [SYS_trace] = sys_trace, }; void diff --git a/kernel/syscall.h b/kernel/syscall.h index 7d671f0..dfc9645 100644 --- a/kernel/syscall.h +++ b/kernel/syscall.h @@ -22,3 +22,4 @@ #define SYS_link 19 #define SYS_mkdir 20 #define SYS_close 21 +#define SYS_trace 22 diff --git a/kernel/sysproc.c b/kernel/sysproc.c index 4274a9d..5645c72 100644 --- a/kernel/sysproc.c +++ b/kernel/sysproc.c @@ -89,3 +89,10 @@ sys_uptime(void) release(&tickslock); return xticks; } + +u64 +sys_trace(void) +{ + /* TODO: Implement sys_trace */ + return 0; +} diff --git a/user/usys.pl b/user/usys.pl index 01e426e..9c97b05 100755 --- a/user/usys.pl +++ b/user/usys.pl @@ -36,3 +36,4 @@ entry("getpid"); entry("sbrk"); entry("sleep"); entry("uptime"); +entry("trace");