0 is not a system call (thanks to Peter Froehlich)
int num;
num = proc->tf->eax;
- if(num >= 0 && num < SYS_open && syscalls[num]) {
- proc->tf->eax = syscalls[num]();
- } else if (num >= SYS_open && num < NELEM(syscalls) && syscalls[num]) {
+ if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
proc->tf->eax = syscalls[num]();
} else {
cprintf("%d %s: unknown sys call %d\n",
#define SYS_sbrk 12
#define SYS_sleep 13
#define SYS_uptime 14
-
#define SYS_open 15
#define SYS_write 16
#define SYS_mknod 17