aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/syscall/syscall.c
diff options
context:
space:
mode:
authorMarvin Borner2019-12-07 13:40:28 +0100
committerMarvin Borner2019-12-07 13:40:28 +0100
commitd94b024b73aeca06de417e0fd3c502495312a8b2 (patch)
treebff5cc1b757eeed7f58878cc13551c63464c5a31 /src/kernel/syscall/syscall.c
parent322167ceab19588473f9074e761390fdeb701790 (diff)
Added userspace libc and began userspace based shell
Diffstat (limited to 'src/kernel/syscall/syscall.c')
-rw-r--r--src/kernel/syscall/syscall.c6
1 files changed, 4 insertions, 2 deletions
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);
}