home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / dec / 4204 < prev    next >
Encoding:
Internet Message Format  |  1992-07-26  |  2.9 KB

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!caen!nic.umass.edu!dime!dime.cs.umass.edu!moss
  2. From: moss@cs.umass.edu (Eliot Moss)
  3. Newsgroups: comp.sys.dec
  4. Subject: Re: VAX question (P0/P1 space)
  5. Message-ID: <MOSS.92Jul26183952@ibis.cs.umass.edu>
  6. Date: 26 Jul 92 22:39:52 GMT
  7. References: <1992Jul26.015003.1@matrix.cs.wright.edu> <1992Jul26.211939.25698@prl.dec.com>
  8. Sender: news@dime.cs.umass.edu
  9. Reply-To: moss@cs.umass.edu
  10. Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)
  11. Lines: 45
  12. In-reply-to: boyd@prl.dec.com's message of 26 Jul 92 21:19:39 GMT
  13.  
  14. A couple of remarks:
  15.  
  16. 1) P0 grows upwards from 0 and is where text, initialized data, and statically
  17. allocated uninitialized data are normally placed. Most libraries also put
  18. dynamically allocated data (malloc/free, etc.) in P0, but, if you're careful
  19. about your stack space, you can use P1 for dynamically allocated data (i.e.,
  20. the stack pointer need not be the low end of P1 space).
  21.  
  22. 2) P1 grows downwards from the middle of the address space, and is usually
  23. used for the stack, which the hardware instruction manage by moving towards
  24. lower addresses on pushes and calls, and higher addresses on pops and returns.
  25. One can allocate beyond the end of the stack (but be aware that at least a few
  26. words beyond the end of the stack may be used for emulation scratch space
  27. (e.g., floating point instructions not supported directly in hardware)).
  28.  
  29. 3) Kernel space is the third quarter of the address space, as previously
  30. noted, and is generally shared among all processes (but pages have different
  31. protections in user, exec, supervisor, and kernel modes, so this is safe,
  32. etc.)
  33.  
  34. 4) The fourth quarter of the address space is generally used for I/O devices
  35. and could be called "I/O space", though I am not sure if that is an "official"
  36. designation.
  37.  
  38. I have participated in the design and implementation of user mode threads
  39. packages, and we found we can place the multiple stacks in either P0 or P1
  40. space with no particular problems. The only way in which the spaces tend to
  41. impinge on design is this: all pages in P0 space up to the highest one
  42. allocated, and all pages in P1 space down to the lowest one allocated, MUST
  43. have a page table entry (PTE), even if it is set no access. The memory
  44. management hardware on many other machines allows sparse allocation, but the
  45. hardware on the VAX precludes that, and ultimately every page you have
  46. impinges on non-pageable kernel space (the page tables for your page tables),
  47. so this resource tends to be jealously guarded by any operating system,
  48. meaning you have to be careful about you allocate things for some kinds of
  49. languages (e.g., it's not as nice for heap management in a LISP system, etc.,
  50. as one might prefer).
  51. --
  52.  
  53.         J. Eliot B. Moss, Associate Professor
  54.         Department of Computer Science
  55.         Lederle Graduate Research Center
  56.         University of Massachusetts
  57.         Amherst, MA  01003
  58.         (413) 545-4206, 545-1249 (fax); Moss@cs.umass.edu
  59.