From f3c8918b13a5226f53e7870d60436f812e5d9015 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 28 Dec 2025 01:48:50 +0800 Subject: feat(user): add user-space build system and init process to test fork/wait --- src/user/usys.S | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/user/usys.S (limited to 'src/user/usys.S') diff --git a/src/user/usys.S b/src/user/usys.S new file mode 100644 index 0000000..e805d82 --- /dev/null +++ b/src/user/usys.S @@ -0,0 +1,31 @@ +#include "kernel/syscall.h" + +#define SYSCALL(name) \ + .global name; \ + name: \ + li a7, SYS_ ## name; \ + ecall; \ + ret + +SYSCALL(fork) +SYSCALL(exit) +SYSCALL(wait) +SYSCALL(pipe) +SYSCALL(read) +SYSCALL(write) +SYSCALL(close) +SYSCALL(kill) +SYSCALL(exec) +SYSCALL(open) +SYSCALL(mknod) +SYSCALL(unlink) +SYSCALL(fstat) +SYSCALL(link) +SYSCALL(mkdir) +SYSCALL(chdir) +SYSCALL(dup) +SYSCALL(getpid) +SYSCALL(sbrk) +SYSCALL(sleep) +SYSCALL(uptime) +SYSCALL(putc) \ No newline at end of file -- cgit v1.2.3