[comp.os.minix] Minix IPC

jds@mimsy.UUCP (James da Silva) (11/18/88)

In article <13142@ncoast.UUCP> allbery@ncoast.UUCP (Brandon S. Allbery) writes:
>As quoted from <1988Nov9.184419.3709@utzoo.uucp> by henry@utzoo.uucp (Henry Spencer):
>+---------------
>| In article <8811081753.AA18094@decwrl.dec.com> powers@cimbad.dec.com (Bill Powers) writes:
>| >  3) If I spawn a couple of processes from a program, is their a mechanism
>| >     for one process to send stuff to another process, like mailboxes in
>| >     VMS.
>| 
>| Pipes.
>+---------------
>
>Try again.  Minix is a message-passing OS; while I haven't tried it -- yet
>-- I haven't noticed anything that would prevent a process from doing
>sendmsg() to another non-kernel process.

Well.....

Notice the function mini_send() in kernel/proc.c; in the book it's page
473, source line 1986.  Here's the relevant part of it:

  /* User processes are only allowed to send to FS and MM.  Check for this */
  if (caller >= LOW_USER && (dest != FS_PROC_NR && dest != MM_PROC_NR))
	return(E_BAD_DEST);

Admittedly this appears to be an arbitrary restriction; just take out the
check and away you go.  However, I imagine there will be some other gotchas
lurking in the implementation, possibly as you suggest:

> ...  (Assuming the receiving process in
>question isn't already waiting on a message from the kernel, in which case
>things could get messy.)  I daresay some form of message queueing to
>non-kernel processes should be implemented to make this work properly.

So, for out-of-the-box Minix, pipes it is!

Now, if you build a Minix kernel with the amoeba networking compiled in,
you have a Remote Procedure Call merchanism to work with.  If you need to
send messages about under Minix, you are probably better off using the
Amoeba RPC calls than hacking away the above restriction on raw messages.
For one thing, RPC messages can be up to 30000 bytes long (according to
net.man) whereas the `normal' Minix messages are 24 bytes long; no more, no
less.

					- Jaime

----------------------------------------------------------------------
path:   uunet!mimsy!jds 				James da Silva
domain: jds@mimsy.umd.edu