home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / minix / 5000 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  2.7 KB

  1. 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
  2. From: sadkins@bigbird.cs.ohiou.edu (Scott W. Adkins)
  3. Newsgroups: comp.os.minix
  4. Subject: Re: Interprocess communication at user level
  5. Message-ID: <1992Dec29.003225.14410@oucsace.cs.ohiou.edu>
  6. Date: 29 Dec 92 00:32:25 GMT
  7. References: <1992Dec28.225940.11565@udel.edu>
  8. Sender: usenet@oucsace.cs.ohiou.edu (Network News Poster)
  9. Organization: Ohio University CS Dept., Athens
  10. Lines: 38
  11.  
  12. HENRIKS@odin.uniras.dk (Henrik Schultz, Production Systems Group) writes:
  13. >After having read 'the book' carefully about how message handling is done
  14. >in Minix, it is not quite clear to me if two user processes can communicate
  15. >with each other using the send() and receive() calls with appropriate
  16. >process numbers. I've made a few small test programs, but it constantly
  17. >gives me a return code of -8 which means E_NO_PERM = no permission from
  18. >the kernel. I know that it is forbidden to send messages to device drivers
  19. >directly, and as far as I can see in the kernel/proc.c code only messages
  20. >to FS and MM are let through. That's ok, but I'm sending to another user
  21. >process so why it is rejected???
  22.  
  23. I don't know how things are with the newer versions of Minix... but I 
  24. know in the older versions (would you believe 1.3?), send() and receive()
  25. were specifically no allowed to be used by any user processes.  The call
  26. you need to use is sendrec(), which will send a message and then go to 
  27. sleep while waiting for a reply from the receiving process.  If you have
  28. 'the book', then take a look at pages 472 and 473 for where E_NO_PERM is
  29. coming from.
  30.  
  31. Another thing, make sure you understand the difference between Slot Numbers
  32. and Process Numbers.  Send() and receive() use slot numbers as the source
  33. and destinations.  Each user process will fill consecutive slots starting
  34. with the first available slot number, but each slot will have a different
  35. process number, usally increasing in size (eventually, though it will wrap
  36. back to zero).  If you were using process numbers instead of slot numbers
  37. for the user processes, then that is most certainly the problem.  If you
  38. can guarantee that one process will be in Slot 5, and another process will
  39. be in Slot 6, then you can easily send messages... but only if you can 
  40. guarantee the slot numbers.
  41.  
  42. Well, anyway.  Gotta go.  I hope this helps... when I was playing with Minix,
  43. I found it very enjoyably.  It was most certainly a fun learning process!
  44.  
  45. Scott
  46. -- 
  47.          Scott W. Adkins           Internet: sadkins@ohiou.edu
  48.          ~~~~~~~~~~~~~~~                     ak323@cleveland.freenet.edu
  49.     Ohio University of Athens        Bitnet: adkins@ouaccvma.bitnet
  50.