home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / minix / 4308 < prev    next >
Encoding:
Text File  |  1992-08-25  |  5.3 KB  |  109 lines

  1. Newsgroups: comp.os.minix
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!udel!louie!minix
  3. From: Steve_Kilbane@gec-epl.co.uk
  4. Subject: Re: Basic MINIX ST questions
  5. Message-ID: <1992Aug26.084119.28794@udel.edu>
  6. Originator: mmdf@louie.udel.edu
  7. Sender: usenet@udel.edu (USENET News Service)
  8. Nntp-Posting-Host: louie.udel.edu
  9. Organization: DSDIC
  10. Date: Wed, 26 Aug 1992 07:47:18 GMT
  11. Approved: usenet=relay@louie.udel.EDU
  12. Lines: 95
  13.  
  14. In article <1992Aug25.185004.13946@vampire> you write:
  15. > I've purchased Andy T.'s Minix textbook, and I found it interesting and
  16. >a sight better more informative than the dull and boring OS book I used
  17. >for an OS class I took. I especially appreciated the extra detail in file
  18. >systems, somtheing that was glossed over in the class.
  19.  
  20. It's a damn good book, yes. Its biggest failing now is that Minix has moved
  21. on quite a bit from the original version. But it's still fairly valid.
  22.  
  23. >      I know there is no paging of memory for Minix, as there isn't
  24. >    any good hardware support. However, is memory accesses outside
  25. >    the process space restricted? Can I write an user program to
  26. >    diddle with the kernel or file system space? If so, is this
  27. >    just one of those things you're not supposed to do but can
  28. >    do anyway? If I access memory outside my program space, will a
  29. >    core dump be generated?
  30.  
  31. Kinda hard to say. I hope you'll get a more authoritive answer on the question
  32. of Minix-ST memory management, because I'd really like to know more about it
  33. myself. But as I understand it, the executable file contains (GEM-DOS)
  34. relocation information, so that the executable can fit anywhere into memory
  35. when it's first exec'ed. fork() is handled by "shadowing", and I've a horrible
  36. suspicion this basically means that each process shares the same tex segment
  37. (which is good), and that they also have to "share" the same data area, which
  38. means that on each context switch, the data areas are swapped as a unit. I'm
  39. not convinced of this (haven't seen the code to do it, for a start), but it's
  40. all I can think of to explain the slow performance of programs that fork but
  41. don't exec, and I don't know of another way of doing fork without making all
  42. memory references relative to the contents of (say) A5.
  43.  
  44. ANYWAY - you do get core dumps, yes. Mostly for things the ST can trap for:
  45. illegal instruction, bus errors, etc. You also get SEGV signals, which I
  46. presume mean that you're out of the memory range altogether (or are writing
  47. to ROM), because there's nothing in the hardware to stop you overwriting
  48. Minix itself.
  49.  
  50. Core dumps themselves aren't actually any use, because there isn't anything
  51. you can do with them (at least, not at *my* level of Minix hacking). But
  52. you do get mdb, which is a useful debugger.
  53.  
  54. >    How are memory holes handled? I'm afraid I'm not clear on this
  55. >    feature. Is memory compacted as the holes become too small or
  56. >    too numerous, or does one have to reboot Minix when no new
  57. >    processes can be created due to none of the holes being big enough?
  58.  
  59. I don't think there's any compaction of memory, since the relocation of
  60. processes is only done when they're first loaded. You don't have to reboot,
  61. though - you just kill off processes until you're left with enough space to
  62. run what you need.
  63.  
  64. >    On the Atari, how is program expansion handled? For the IBM PC
  65. >    in the minix book, there is a system call called "brk" which will
  66. >    allow the program to grow upward toward the program stack. I think
  67. >    this was due to a limitation of the 286's 64k segmentation. I would
  68. >    think that Atari Minix won't have this limitation. Do I use a
  69. >    malloc() call, and the memory manager will allocate any free memory for
  70. >    my process, and not just the memory between my process and the stack?
  71.  
  72. No, the memory allocation system is the same as is described in the book,
  73. with the exception that a fork doesn't need to copy the text segment -
  74. the executable contains the total amount of memory required, and that gets
  75. allocated at the start. All brk() does is increase the top-of-heap pointer
  76. *towards* that limit - the pages are already allocated to the process. There's
  77. nothing to stop your process going beyond the limit, though, which can lead
  78. to some very strange behaviour.
  79.  
  80. >    I was thinking of building a memory mangler for the ST, based on
  81. >    my understanding of how Minix works. If a process has a lower and
  82. >    upper limit that it can access (if my supposition about malloc()
  83. >    above doesn't hold true), then perhaps when the cpu is in user mode
  84. >    and it tries to access memory outside this range, an interrupt is
  85. >    generated and the kernel kills the process and generates a core
  86. >    dump.
  87.  
  88. That'd be nice, but personally I'm entirely a software person; someone else
  89. can solder the beasties:-).
  90.  
  91. > Well, I think that's enough questions to ask for now. I would be deeply
  92. >appreciative to hear from other Atari (or any other computer) Minix
  93. >hackers!
  94.  
  95. Well, if you get any *decent* answers on how the ST shadowing works (or 
  96. indeed any other answers), I'd really like to see them.
  97.  
  98. Hope this has been of some help, though.
  99.  
  100. Steve.
  101. -- 
  102. -----------------------------------------------------------------------------
  103. Steve Kilbane, MDD, CEGELEC PROJECTS Ltd, Boughton Road, Rugby, CV21 1BU,
  104. England. Tel: +44 788 563563 x3493. email:Steve_Kilbane@gec-epl.co.uk
  105. Disclaimer: I don't speak for my employers. I don't speak for me. I mutter.
  106.                        "(the_winds)caution();"
  107. -- 
  108. Mail System (MMDF)
  109.