1
0
mirror of https://gitlab.os-k.eu/os-k-team/os-k.git synced 2023-08-25 14:03:10 +02:00

First syscall brainstorming

This commit is contained in:
Adrien Bourmault 2021-03-09 01:04:52 +01:00
parent dc2e2878d7
commit 9abb67a194
Signed by: neox
GPG Key ID: 6EB408FE0ACEC664

View File

@ -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;
}