From d94b024b73aeca06de417e0fd3c502495312a8b2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 7 Dec 2019 13:40:28 +0100 Subject: Added userspace libc and began userspace based shell --- src/kernel/syscall/syscall.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/kernel/syscall/syscall.c') diff --git a/src/kernel/syscall/syscall.c b/src/kernel/syscall/syscall.c index 0eac619..eb44c87 100644 --- a/src/kernel/syscall/syscall.c +++ b/src/kernel/syscall/syscall.c @@ -6,11 +6,14 @@ typedef uint32_t (*syscall_func)(unsigned int, ...); uint32_t (*syscalls[])() = { - [1] = sys_write + [1] = sys_write, + [2] = sys_read }; void syscall_handler(struct regs *r) { + serial_write("Received syscall!\n"); + if (r->eax >= sizeof(syscalls) / sizeof(*syscalls)) return; @@ -18,7 +21,6 @@ void syscall_handler(struct regs *r) if (!location) return; - serial_write("Received syscall!\n"); location(r->ebx, r->ecx, r->edx, r->esi, r->edi); } -- cgit v1.2.3