From dbfa8cae66811247e5110e2e17f1c6ae5d1b2bcd Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Wed, 24 Mar 2010 15:40:16 +0100 Subject: IPC not tested but suposedly working. --- doc/objects-requests.txt | 20 +++++++++++++++++--- doc/syscalls.txt | 15 +++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/objects-requests.txt b/doc/objects-requests.txt index 9169552..e53c343 100644 --- a/doc/objects-requests.txt +++ b/doc/objects-requests.txt @@ -1,11 +1,25 @@ +The requests can be of two types : +- Blocking, IE the sender waits for an answer +- Nonblocking, the request is a simple message. + Requests are identified by a 32bit function number, composed as follows : (8 bit) parameter and return type ; (24bit) function number the first 8 bits are : - 2bit answer type ; 2bit parameter a ; 2bit parameter b ; 2bit parameter c + 2bit answer type ; 2bit parameter a type ; 2bit parameter b type ; 2bit parameter c type each two bit couple can be one of the following : - 00 : void - 01 : object descriptor number (will be copied with a new number to reciever) -- 10 : integer -- 11 : long long (replies), or shared memory offset (requests and messages) +- 10 : long +- 11 : long long (replies), or shared memory offset in sender's space (requests and messages) + +When shared memory segments are sent as request parameters from a process to the same process, the pointer +to the memory is kept and sent to the handler function. If handler is in another process, receiver will +have to call request_mapShm specifying a pointer. Shared memory is automatically unmapped when requests +yields an answer, and is kept when the request is nonblocking (message). + +When objects are sent as request parameters, the receiver process will get an immediately usable object +descriptor. The descriptor is closed in blocking requests after the request yields an answer (except if the +request is handled in the same process than the sender, OR if the receiver already had a descriptor to +this object). The descriptor is kept when sent by a nonblocking request (message). diff --git a/doc/syscalls.txt b/doc/syscalls.txt index 663618d..2972b97 100644 --- a/doc/syscalls.txt +++ b/doc/syscalls.txt @@ -16,5 +16,20 @@ id=eax Name Parameters Description 8 shm_create ebx: offset Create a shared memory segment at offset (ret = errcode) ecx: length 9 shm_delete ebx: offset Delete a shared memory segment at offset (ret = errcode) + 10 object_create none Creates an object for current process (returns a descriptor to it) + 11 object_owned ebx: object descriptor True (1) if object with this descriptor is ours, false(0) elsewhere + 12 object_close ebx: object descriptor Closes descriptor to an object (deleting it if necessary) + 13 request_get ebx: object descriptor Gets a request pending on object (only if we own it) + ecx: pointer to write request + edx: wait for a request ? + 14 request_has ebx: object descriptor Is there a request waiting on this object ? + 15 request_answer ebx: object descriptor + ecx, edx: answer Answer a request on object + 16 request_mapShm ebx: object descriptor Map shared memory sent with request to receiver's address space + ecx: offset + edx: parameter number (0, 1 or 2) + 17 request ebx: object descriptor Send a blocking request to object + ecx: pointer to user_sendrequest struct with information + 18 send_msg same as above Send a nonblocking request to object, same as above If a processes wishes to exit with an error code, it HAS to use process_exit. thread_exit will do nothing. -- cgit v1.2.3