Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!philmtl!philabs!linus!munck From: munck@linus.UUCP (Robert Munck) Newsgroups: comp.arch Subject: Re: 386/486 Virtual Memory Question... Message-ID: <55957@linus.UUCP> Date: 12 Jun 89 20:20:17 GMT References: <243@mipos3.intel.com> <4056@ima.ima.isc.com> Reply-To: munck@faron.UUCP (Robert Munck) Organization: The MITRE Corporation, Bedford MA Lines: 38 In article <4056@ima.ima.isc.com> johnl@ima.UUCP (John R. Levine) writes: >Unfortunately, ... the 386's segmentation is considerably less >useful... If, for example, you did the obvious unix trick of putting your > static data and heap at the low end of a (2^32-byte) segment >and your stack at the high end ... >you have to map all 2^32 addresses in that segment into the >page table, but that doesn't leave room for anything else. Oops. > Boy, there's a limitation! You can't separate your heap and stack by the full four gigabytes!! I suppose that if you could only leave two gigabytes between them, there wouldn't be enough room for them to grow. >A single process' address space is limited to 2^32 simultaneously mapped >addresses. > Not true. The address space is limited to 2^14 segments, each of up to 2^32 bytes. That's not quite what you said with "simultaneously mapped." >In theory you could have a larger total address space and play >games with mapping segments in and out, but that puts strange limits on >applications as to which segments they can reference at the same time, so in >reality the limit translates to 2^32 total addresses per process. > The "games" are no stranger than mapping virtual pages into and out of real memory; in fact, the two are done exactly the same way. Your "in reality" should read "when you don't need to or want to use the chip's segmentation facilities." Note that there are NO limitations on the applications; all this is invisible to them. >Unix systems map all segments to the same place and just use the paging. > I'm happy for you that UNIX is sufficiently primitive that you can leave such a powerful facility unused, although I'm not sure you can do a secure UNIX with that limitation. I suggest you look into doing the coding to use full segmentation; it'll make the higher-level code much simpler. -- Bob Munck, MITRE Corporation -- munck@mitre.org, [backbone]!linus!munck