diff --git a/kaleid/kernel/ke/syscall.c b/kaleid/kernel/ke/syscall.c index 6dcc7cd..d22ea84 100644 --- a/kaleid/kernel/ke/syscall.c +++ b/kaleid/kernel/ke/syscall.c @@ -61,16 +61,38 @@ static error_t syscallStub(void *rdi, void *rsi, void *rdx, ISRFrame_t *regs) return ENOSYS; } -static error_t syscallRead(void *rdi, void *rsi, void *rdx, ISRFrame_t *regs) +static error_t syscallRead(void *descriptor, void *address, void *flags, ISRFrame_t *regs) { return ENOSYS; } -static error_t syscallWrite(void *rdi, void *rsi, void *rdx, ISRFrame_t *regs) +static error_t syscallWrite(void *descriptor, void *address, void *flags, ISRFrame_t *regs) { return ENOSYS; } +static error_t syscallOpen(void *descriptor, void *address, void *size, ISRFrame_t *regs) +{ + /* TODO + - lock the zone + - check if permitted + - modify descriptor according to what has been done + - return */ + + return ENOSYS; +} + +static error_t syscallClose(void *descriptor, void *address, void *flags, ISRFrame_t *regs) +{ + /* TODO + - lock the zone + - check if permitted using descriptor + - use flags to know what to do + - return */ + + return ENOSYS; +} + static error_t syscallKernelShell(void *rdi, void *rsi, void *rdx, ISRFrame_t *regs) { KeEnableIRQs(); @@ -86,7 +108,8 @@ void KeEnableSyscalls() { syscallTable[0] = syscallRead; syscallTable[1] = syscallWrite; - syscallTable[2] = syscallStub; - syscallTable[3] = syscallStub; + syscallTable[2] = syscallOpen; + syscallTable[3] = syscallClose; syscallTable[4] = syscallKernelShell; + syscallTable[5] = syscallStub; }