# HG changeset patch # User mir3636 # Date 1550154837 -32400 # Node ID a7144583914cce1149ed9d9569a81d51c7381c2e # Parent 7a63dacab7f8739d6fff518b231540cbbed303ad fix diff -r 7a63dacab7f8 -r a7144583914c src/console.c --- a/src/console.c Tue Jan 22 17:32:06 2019 +0900 +++ b/src/console.c Thu Feb 14 23:33:57 2019 +0900 @@ -289,15 +289,7 @@ release(&input.lock); ilock(ip); - //int r = target - n; - - //if (r > 0) - // f->off += r; - //iunlock(f->ip); - goto next(target - n); - - //goto next(r); } __code cbc_consoleread (struct inode *ip, char *dst, int n, __code(*next)(int ret)) @@ -312,20 +304,12 @@ if (n > 0) { proc->cbc_arg.cbc_console_arg.n = n; proc->cbc_arg.cbc_console_arg.target = target; - proc->cbc_arg.cbc_console_arg.dst = dst; - proc->cbc_arg.cbc_console_arg.ip = ip; - proc->cbc_arg.cbc_console_arg.next = next; - if (input.r == input.w) { - if (proc->killed) { - release(&input.lock); - ilock(ip); - goto next(-1); - } - - goto cbc_sleep(&input.r, &input.lock, cbc_consoleread2); - } + proc->cbc_arg.cbc_console_arg.dst = dst; + proc->cbc_arg.cbc_console_arg.ip = ip; + proc->cbc_arg.cbc_console_arg.next = next; + goto cbc_consoleread2(); + } goto cbc_consoleread1(); - } } int consoleread (struct inode *ip, char *dst, int n) diff -r 7a63dacab7f8 -r a7144583914c src/syscall.c --- a/src/syscall.c Tue Jan 22 17:32:06 2019 +0900 +++ b/src/syscall.c Thu Feb 14 23:33:57 2019 +0900 @@ -174,7 +174,7 @@ } - if((num > 0) && (num <= NELEM(syscalls)) && syscalls[num]) { + if((num > 0) && (num < NELEM(syscalls)) && syscalls[num]) { ret = syscalls[num](); // in ARM, parameters to main (argc, argv) are passed in r0 and r1