summaryrefslogtreecommitdiff
path: root/src/user/usys.S
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2025-12-28 01:48:50 +0800
committerRichard Qin <richard.qin.x@gmail.com>2025-12-28 01:48:50 +0800
commitf3c8918b13a5226f53e7870d60436f812e5d9015 (patch)
tree5a934b82f23916e67e8cac9d230af93645611f3a /src/user/usys.S
parenta82ab8ad6d277ededc128678aebabf5fbdb01c45 (diff)
downloadlume-f3c8918b13a5226f53e7870d60436f812e5d9015.tar.gz
lume-f3c8918b13a5226f53e7870d60436f812e5d9015.tar.xz
feat(user): add user-space build system and init process to test fork/wait
Diffstat (limited to 'src/user/usys.S')
-rw-r--r--src/user/usys.S31
1 files changed, 31 insertions, 0 deletions
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