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 --- include/user/user.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/user/user.h (limited to 'include/user/user.h') diff --git a/include/user/user.h b/include/user/user.h new file mode 100644 index 0000000..7ab4923 --- /dev/null +++ b/include/user/user.h @@ -0,0 +1,29 @@ +#pragma once +typedef unsigned long long uint64; + +extern "C" { + int fork(); + int exit(int status); + int wait(uint64 status_addr); + int pipe(int p[]); + int write(int fd, const void *buf, int n); + int read(int fd, void *buf, int n); + int close(int fd); + int kill(int pid); + int exec(char *, char **); + int open(const char *, int); + int mknod(const char *, short, short); + int unlink(const char *); + int fstat(int fd, void *st); + int link(const char *, const char *); + int mkdir(const char *); + int chdir(const char *); + int dup(int fd); + int getpid(); + char *sbrk(int n); + int sleep(int ticks); + int uptime(); + + + void putc(char c); +} \ No newline at end of file -- cgit v1.2.3