Clear design. Small code. Consistent API. Technically speaking there's no message passing involved when communicating with kernel (message passed in registers), but from userspace point of view it's not noticeable. This is a hack to fix performance issues with microkernels and to avoid api hell of monolithic kernels. I have a special service (destination 0) which is not a real service with it's own thread, instead it's mapped in all address space, and performs like a monolithic kernel api. First 255 destination are reserved for services, like:OSwhatever wrote:Why messages to kernel? I understand that we use messages to services in user space but to the kernel normal call gates can be used. I know some kernels use messages as kernel interface but not really understood the benefit.
0-kernel services (mapped in)
1-filesystem services (separate thread)
2-networking services (separate thread)
...etc.
Init (first real userspace app) has the destination id of 256.
I have only 4 system calls as my kernel api to deal with messages (and won't change):
- async recv
- async send
- sync send (async send+async recv)
- sync recv (async recv+async send)
The 3rd is the remote procedure call, and the last is it's counterpart dispatcher.