wip: IPC and Runtime

This commit is contained in:
karina
2026-05-03 21:57:20 +04:00
parent 5f343c991b
commit 39b2af7626
25 changed files with 371 additions and 66 deletions
+25
View File
@@ -0,0 +1,25 @@
#include <OS/Syscall.h>
#include <OS/IPC.h>
#include <OS/Scheduler.h>
#include <OS/Panic.h>
#include <Arch/Exceptions.h>
Address SyscallDispatch(ExceptionsContext* frame) {
UInt64 syscallNumber = frame->x8;
OSTask* current = SchedulerGetCurrentTask();
switch (syscallNumber) {
case kSyscallSend:
frame->x0 = IPCSend(current, frame->x0, frame->x1);
break;
case kSyscallReceive:
IPCReceive(frame);
break;
default:
frame->x0 = -1;
break;
}
if (current->state != OSTaskStateRunning) return SchedulerNext((Address)frame);
return (Address)frame;
}