diff options
author | Marvin Borner | 2020-08-01 20:55:53 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-01 20:55:53 +0200 |
commit | b7f59b28b380d55f9e7abd8e450f1f9c7f050221 (patch) | |
tree | c6b89fa0ff2bebd5ed06a4384d766990bcb42c0a /src/features/syscall.c | |
parent | 1686173757af4e453e7a32d152ec4bd20d789652 (diff) |
Added syscalls
Diffstat (limited to 'src/features/syscall.c')
-rw-r--r-- | src/features/syscall.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/features/syscall.c b/src/features/syscall.c new file mode 100644 index 0000000..ab1849c --- /dev/null +++ b/src/features/syscall.c @@ -0,0 +1,19 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#include <interrupts.h> +#include <load.h> +#include <print.h> +#include <proc.h> + +void syscall_handler(struct regs *r) +{ + printf("[SYSCALL] %d\n", r->eax); + + struct proc *a = proc_make(); + bin_load("/a", a); +} + +void syscall_install() +{ + isr_install_handler(0x80, syscall_handler); +} |