summaryrefslogtreecommitdiff
path: root/src/kernel/syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r--src/kernel/syscalls.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index 24706d3..1bc1a44 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -4,6 +4,13 @@
#include <kernel/syscalls.h>
#include <stdint.h>
+int sc_exit(const char *msg, size_t len) {
+ // the message is currently ignored
+
+ log_const("last process returned. ");
+ panic();
+}
+
int sc_debuglog(const char *msg, size_t len) {
struct pagedir *pages = process_current->pages;
void *phys = pagedir_virt2phys(pages, msg, true, false);
@@ -23,6 +30,9 @@ int syscall_handler(int num, int a, int b, int c, void *stack, void *eip) {
process_current->eip = eip;
switch (num) {
+ case SC_EXIT:
+ sc_exit((void*)a, b);
+ panic(); // sc_exit should never return
case SC_DEBUGLOG:
return sc_debuglog((void*)a, b);
default: