This is an old revision of the document!
Message passing is Minix's native form of IPC. Together with memory grants, they are the only low-level IPC directly understood by the micro-kernel. POSIX-style IPC is implemented on top of them at a higher level of abstraction.
The messages are fixed-length 64 bytes of data. To transfer more effectively bigger amounts of data memory grants are used. Messages are composed of :
All available messages are enumerated at minix/include/minix/ipc.h.
A endpoint identifies a process uniquely among the operating system. It is composed of the process slot number concatenated with a generation number.
The reason behind this generation number is that a process slot may be recycled when a process dies, so unrelated processes may sequentially share the same process slot number, which would cause problems when delivering messages to a process which happened to share the same process slot than a unrelated predecessor.
A thorough explanation of endpoints is available at minix/include/minix/endpoint.h.
Message types identifies what kind of message is a particular message. They are enumerated at minix/include/minix/com.h
A special kind of messages is notifications : notifications allows one to notify a process about something (for example, a hard disk interrupt meant for the disk driver). They take priority over normal messages when a process tries to RECEIVE one. Due to their construction, they are not stored in the receive buffer and their payload is generated on-the-fly by the micro-kernel.
Messages have a 56 bytes fixed payload. Each message type has its own payload format, which are described at minix/include/minix/ipc.h.
The micro-kernel handles the delivery of messages. There are three basic primitives :
There are also NOTIFY, SENDNB (non-blocking SEND) and SENDA (asynchronous SEND) for specific purposes.
Each endpoint has a 1 message receive buffer inside the micro-kernel.
To prevent deadlocks (by error or by malicious processes), processes are limited by what kind of primitives they may use and to whom they may send messages to. Also, the order of messages and protocols built upon them are carefully designed to prevent them.