diff options
author | Marvin Borner | 2020-08-09 16:51:01 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-09 16:51:01 +0200 |
commit | 162d024a53e1e31e00ff0b6f47dd4590edebc551 (patch) | |
tree | 711d3886c300dfaddffdafaa89b690b45eb2101d /kernel/features/syscall.c | |
parent | 79f2fa136f26a0b87917336e089485712ee49bd6 (diff) |
Heavy restructuring of libc, kernel and apps
Diffstat (limited to 'kernel/features/syscall.c')
-rw-r--r-- | kernel/features/syscall.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c new file mode 100644 index 0000000..3d012cf --- /dev/null +++ b/kernel/features/syscall.c @@ -0,0 +1,25 @@ +// MIT License, Copyright (c) 2020 Marvin Borner + +#include <cpu.h> +#include <interrupts.h> +#include <load.h> +#include <print.h> +#include <proc.h> +#include <str.h> + +int i = 0; +void syscall_handler(struct regs *r) +{ + printf("[SYSCALL] %d\n", r->eax); + + struct proc *a = proc_make(); + bin_load(++i ? "/a" : "/b", a); + strcpy(a->name, "a"); + proc_print(); +} + +void syscall_init() +{ + idt_set_gate(0x80, (u32)isr128, 0x08, 0x8E); + isr_install_handler(0x80, syscall_handler); +} |