User Tools

Site Tools


developersguide:messagepassing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developersguide:messagepassing [2015/05/24 16:32]
jeanbaptisteboric created
developersguide:messagepassing [2016/01/27 16:03]
bertbrecht [Payload]
Line 30: Line 30:
  
 Messages have a 56 bytes fixed payload. Each message type has its own payload format, which are described at [[https://​github.com/​Stichting-MINIX-Research-Foundation/​minix/​blob/​master/​minix/​include/​minix/​ipc.h|minix/​include/​minix/​ipc.h]]. Messages have a 56 bytes fixed payload. Each message type has its own payload format, which are described at [[https://​github.com/​Stichting-MINIX-Research-Foundation/​minix/​blob/​master/​minix/​include/​minix/​ipc.h|minix/​include/​minix/​ipc.h]].
 +
 +You can transfer more than 56 bytes per message using grants ([[https://​github.com/​Stichting-MINIX-Research-Foundation/​minix/​blob/​master/​minix/​include/​minix/​safecopies.h|minix/​include/​minix/​safecopies.h]]). Grants are pointers to an allocated data block exported by the granter. ​
 +
 +Case 1: A needs to send more than 56 bytes to B
 +
 +The grantee receives the read only grant via message and maps it to memory in the target process. The target process can now read and process the payload transferred via grant. After processing the payload, the granter needs to be informed to revoke the grant.
 +
 +Case 2: A requests more than 56 bytes from B
 +
 +The grantee receives the read write grant via message and maps it to memory in the target process. The target process can now write to the memory transferred via grant. After writing, the grantee maps back the the memory to the grant address and send it back via message to the granter. The granter needs to revoke the grant.
 +
 +Case 3: A needs to send more than 56 bytes and expects to return more than 56 bytes
 +
 +The granter creates a grant for an already allocated memory. The grantee receives the read write grant via message and maps it to memory in the target process. The target process can now write to the memory transferred via grant. After writing, the grantee maps back the the memory to the grant address and send it back via message to the granter.
  
 ===== API ===== ===== API =====
developersguide/messagepassing.txt · Last modified: 2016/01/27 16:03 by bertbrecht