Closed wake-0 closed 9 years ago
Implemented IPC in the above commits. The implementation is not tested yet. I suggest to review and test together in a coaching.
See commit https://github.com/Blackjack92/fhvOS/commit/af300495220aad46734e0a7de6493231404fcd4f
Tested and verified working.
Small code example:
void ping(void)
{
int res = IpcManagerRegisterNamespace("ping");
do {
res = IpcManagerSendMessage("ping", "pong", "PING");
} while(res <= 0);
printf("Ping sent...\n");
printf("Ping is ending now...\n");
}
void pong(void)
{
int res = IpcManagerRegisterNamespace("pong");
while(IpcManagerHasMessage("pong") <= 0)
{
}
char message[255];
char sender[255];
IpcManagerGetNextMessage("pong", message, 255, sender, 255);
printf("Pong received...\n");
printf("Message received from \"%s\": %s\n", sender, message);
printf("Pong is ending now...\n");
}
int main(void)
{
[...]
SchedulerStartProcess(&ConsoleProcess);
SchedulerStartProcess(&pong);
SchedulerStartProcess(&ping);
[...]
}
Implement the IPC. The minimal requirement is that the console is able to use IPC to communicate with the OS, so that the OS starts processes.