From a12e50e5a7dae52ed8bd5a24cc6576371e20985b Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 27 Dec 2021 20:40:44 +0200 Subject: Started work on syscalls --- include/apos/syscalls.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 include/apos/syscalls.h (limited to 'include/apos/syscalls.h') diff --git a/include/apos/syscalls.h b/include/apos/syscalls.h new file mode 100644 index 0000000..d2427cf --- /dev/null +++ b/include/apos/syscalls.h @@ -0,0 +1,36 @@ +#ifndef APOS_SYSCALLS_H +#define APOS_SYSCALLS_H + +/* enum for now, possibly macros in the future once I get an approximate idea of + * which syscalls are necessary etc. */ +enum { + /* memory management */ + SYS_REQ_MEM, /* request memory from anywhere */ + SYS_REQ_PMEM, /* request physical address */ + SYS_REQ_FIXMEM, /* request memory at fixed address */ + SYS_FREE_MEM, /* free memory */ + + /* IPC */ + /* I really should try to find my notes about the server/client + * structure of the OS, but these following syscalls are probably + * required */ + SYS_IPC_SERVER, /* inform kernel that process should be treated as a server */ + SYS_IPC_REQ, /* IPC request to server */ + SYS_IPC_RESP, /* IPC response from server */ + + /* process management */ + SYS_FORK, /* duplicate process */ + SYS_EXEC, /* execute new binary in process space */ + SYS_SIGNAL, /* send signal to process (kill etc.) */ + SYS_SWITCH, /* switch running process */ + SYS_SYNC, /* used by init process to synchronize running processes, maybe not used */ + + /* kernel management */ + SYS_CONF, /* config system parameters (stack size etc.) */ + SYS_POWEROFF, /* shutdown/reboot etc. */ +} + +/* function declarations should be somewhere else, this file could be used in + * userspace applications as well */ + +#endif /* APOS_SYSCALLS_H */ -- cgit v1.3