Message passing / mail system
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m20s

This commit is contained in:
2026-02-18 17:18:03 +01:00
parent 35454a087e
commit ae0a6024da
19 changed files with 340 additions and 66 deletions

View File

@@ -16,8 +16,12 @@ static void clear_bss (void) {
void __premain (void) {
clear_bss ();
liballoc_init ();
app_main ();
liballoc_deinit ();
quit ();
}

View File

@@ -52,3 +52,15 @@ int read (const char* path, size_t off, uint8_t* buffer, size_t size) {
int describe (const char* path, struct fs_desc_buffer* desc) {
return (int)do_syscall (SYS_DESCRIBE, path, desc);
}
int mail_send (int pgid, void* mesg, size_t mesg_size) {
return (int)do_syscall (SYS_MAIL_SEND, pgid, mesg, mesg_size);
}
int mail_receive (void* mesg, size_t mesg_size) {
return (int)do_syscall (SYS_MAIL_RECEIVE, mesg, mesg_size);
}
int get_procgroup (int pid) { return (int)do_syscall (SYS_GET_PROCGROUP, pid); }
int get_exec_pid (void) { return (int)do_syscall (SYS_GET_EXEC_PID, 0); }

View File

@@ -65,4 +65,16 @@ int read (const char* path, size_t off, uint8_t* buffer, size_t size);
/* describe a file */
int describe (const char* path, struct fs_desc_buffer* desc);
/* send a message to a procgroup's mail */
int mail_send (int pgid, void* mesg, size_t mesg_size);
/* receive a message from mail */
int mail_receive (void* mesg, size_t mesg_size);
/* get procgroup id of a perticular process */
int get_procgroup (int pid);
/* get PID of process, which exec'ed the current process */
int get_exec_pid (void);
#endif // _LIBMSL_M_SYSTEM_H