From 3886749b1c8d79d4701bf6b8e66249c4e1491648 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 4 Jan 2026 18:06:31 +0800 Subject: dev(shell): implement basic shell tools fixed(file-system): fixed read and write bugs --- src/kernel/syscall.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/kernel/syscall.cc') diff --git a/src/kernel/syscall.cc b/src/kernel/syscall.cc index 259a5e6..9f88649 100644 --- a/src/kernel/syscall.cc +++ b/src/kernel/syscall.cc @@ -503,7 +503,9 @@ static uint64_t sys_read() // get param: fd, buf, len if (argint(0, &fd) < 0 || argint(2, &n) < 0 || argint(1, (int *)&p) < 0) return -1; - + + p = argraw(1); + struct Proc* proc = myproc(); if (fd == 0 && proc->ofile[fd] == nullptr) { -- cgit v1.2.3