From 50858d043cbd6f61cc091c6772f981ca2d6cca6b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 29 Apr 2020 00:39:24 +0200 Subject: Added basic exec calls for init and started libc --- src/kernel/syscall/syscall.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/kernel/syscall/syscall.c') 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 +} -- cgit v1.2.3