diff options
author | Marvin Borner | 2020-08-22 19:44:49 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-22 19:44:49 +0200 |
commit | 8bb7b5cceaaf96a5dd6321d35aae28748896d87b (patch) | |
tree | 9a4103fb1da636fdf0c5ec8f04425c0c388f527d /kernel/features/syscall.c | |
parent | 424dc57424ee17de77d689443f95d2e1bed72f4a (diff) |
Added *very* basic polling ipc
Diffstat (limited to 'kernel/features/syscall.c')
-rw-r--r-- | kernel/features/syscall.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c index c8da824..9bd5e9b 100644 --- a/kernel/features/syscall.c +++ b/kernel/features/syscall.c @@ -16,7 +16,9 @@ void syscall_handler(struct regs *r) { enum sys num = r->eax; r->eax = 0; - printf("[SYSCALL] %d: ", num); + + if (num != SYS_RECEIVE) + printf("[SYSCALL] %d: ", num); switch (num) { case SYS_LOOP: { @@ -87,6 +89,17 @@ void syscall_handler(struct regs *r) proc_resolve(proc_current()); break; } + case SYS_SEND: { + printf("send\n"); + proc_send(proc_current(), proc_from_pid(r->ebx), r->ecx, (void *)r->edx); + break; + } + case SYS_RECEIVE: { + /* printf("receive\n"); */ + struct proc_message *msg = proc_receive(proc_current()); + r->eax = (u32)(msg ? msg->msg : NULL); + break; + } default: { printf("unknown\n"); loop(); |