aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/syscall/syscall.c
diff options
context:
space:
mode:
authorMarvin Borner2020-04-29 00:39:24 +0200
committerMarvin Borner2020-04-29 00:39:24 +0200
commit50858d043cbd6f61cc091c6772f981ca2d6cca6b (patch)
tree82afcc2daf9c4b67d29832923283654913490d06 /src/kernel/syscall/syscall.c
parent34c752f6fe4f71169172f1b3e46b1eddf69eba6e (diff)
Added basic exec calls for init and started libc
Diffstat (limited to 'src/kernel/syscall/syscall.c')
-rw-r--r--src/kernel/syscall/syscall.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/kernel/syscall/syscall.c b/src/kernel/syscall/syscall.c
index ca12118..d0b2b96 100644
--- a/src/kernel/syscall/syscall.c
+++ b/src/kernel/syscall/syscall.c
@@ -8,14 +8,15 @@
typedef uint32_t (*syscall_func)(uint32_t, ...);
uint32_t (*syscalls[])() = { [0] = (uint32_t(*)())halt_loop, // DEBUG!
- [1] = (uint32_t(*)())sys_putch,
- [2] = sys_getch,
- [3] = sys_malloc,
- [4] = sys_free };
+ [1] = sys_exec,
+ [2] = (uint32_t(*)())sys_putch,
+ [3] = sys_getch,
+ [4] = sys_malloc,
+ [5] = sys_free };
void syscall_handler(struct regs *r)
{
- sti();
+ cli();
log("Received syscall!");
if (r->eax >= sizeof(syscalls) / sizeof(*syscalls))
@@ -29,9 +30,10 @@ void syscall_handler(struct regs *r)
r->edx, r->esi, r->edi);
r->eax = location(r->ebx, r->ecx, r->edx, r->esi, r->edi);
+ sti();
}
void syscalls_install()
{
isr_install_handler(0x80, syscall_handler);
-} \ No newline at end of file
+}