home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewse!cbnewsd!att-out!oucsboss!oucsace!sadkins
- From: sadkins@bigbird.cs.ohiou.edu (Scott W. Adkins)
- Newsgroups: comp.os.minix
- Subject: Re: Interprocess communication at user level
- Message-ID: <1992Dec29.003225.14410@oucsace.cs.ohiou.edu>
- Date: 29 Dec 92 00:32:25 GMT
- References: <1992Dec28.225940.11565@udel.edu>
- Sender: usenet@oucsace.cs.ohiou.edu (Network News Poster)
- Organization: Ohio University CS Dept., Athens
- Lines: 38
-
- HENRIKS@odin.uniras.dk (Henrik Schultz, Production Systems Group) writes:
- >After having read 'the book' carefully about how message handling is done
- >in Minix, it is not quite clear to me if two user processes can communicate
- >with each other using the send() and receive() calls with appropriate
- >process numbers. I've made a few small test programs, but it constantly
- >gives me a return code of -8 which means E_NO_PERM = no permission from
- >the kernel. I know that it is forbidden to send messages to device drivers
- >directly, and as far as I can see in the kernel/proc.c code only messages
- >to FS and MM are let through. That's ok, but I'm sending to another user
- >process so why it is rejected???
-
- I don't know how things are with the newer versions of Minix... but I
- know in the older versions (would you believe 1.3?), send() and receive()
- were specifically no allowed to be used by any user processes. The call
- you need to use is sendrec(), which will send a message and then go to
- sleep while waiting for a reply from the receiving process. If you have
- 'the book', then take a look at pages 472 and 473 for where E_NO_PERM is
- coming from.
-
- Another thing, make sure you understand the difference between Slot Numbers
- and Process Numbers. Send() and receive() use slot numbers as the source
- and destinations. Each user process will fill consecutive slots starting
- with the first available slot number, but each slot will have a different
- process number, usally increasing in size (eventually, though it will wrap
- back to zero). If you were using process numbers instead of slot numbers
- for the user processes, then that is most certainly the problem. If you
- can guarantee that one process will be in Slot 5, and another process will
- be in Slot 6, then you can easily send messages... but only if you can
- guarantee the slot numbers.
-
- Well, anyway. Gotta go. I hope this helps... when I was playing with Minix,
- I found it very enjoyably. It was most certainly a fun learning process!
-
- Scott
- --
- Scott W. Adkins Internet: sadkins@ohiou.edu
- ~~~~~~~~~~~~~~~ ak323@cleveland.freenet.edu
- Ohio University of Athens Bitnet: adkins@ouaccvma.bitnet
-