A IPC Design
Posted: Mon Dec 30, 2013 7:47 pm
I think that implementing multiple IPCs will increase the difficulty to program both for applications, drivers and kernel developers. Thus, I came up with a design that only one IPC is needed in the kernel space. The unit of this IPC is a 4K-page, and every IPC calls will transport several 4K-pages.
Here are some prototypes of syscall:
ssize_t send(size_t pid, size_t type, void* address, size_t size, size_t flags);
This syscall will send `size` pages from `address` of sender's virtual address to `pid` process, and the target process will be interrupted by the sending.
ssize_t register_handler(size_t type, size_t (*handler)(size_t pid, size_t type, void* address, size_t size, size_t flags))
Receiver will bind a handler to a corresponding `type`, and when sender send the message, the receiver will be interrupted as the same as a coming signal. The receiver can either receive the message or abandon it.
Flags:
Bit 0: senders' ability to read/write
Bit 1: receiver's ability to read/write
Bit 2: whether the page should be duplicated
Bit 3&4: target of sending: specified/self/all/all excluding self
It is just like a memory sharing system but added some feature of signal
Here are some prototypes of syscall:
ssize_t send(size_t pid, size_t type, void* address, size_t size, size_t flags);
This syscall will send `size` pages from `address` of sender's virtual address to `pid` process, and the target process will be interrupted by the sending.
ssize_t register_handler(size_t type, size_t (*handler)(size_t pid, size_t type, void* address, size_t size, size_t flags))
Receiver will bind a handler to a corresponding `type`, and when sender send the message, the receiver will be interrupted as the same as a coming signal. The receiver can either receive the message or abandon it.
Flags:
Bit 0: senders' ability to read/write
Bit 1: receiver's ability to read/write
Bit 2: whether the page should be duplicated
Bit 3&4: target of sending: specified/self/all/all excluding self
It is just like a memory sharing system but added some feature of signal