Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!liuida!isy!lysator.liu.se!bellman From: bellman@lysator.liu.se (Thomas Bellman) Newsgroups: comp.arch Subject: Re: Segmented Architectures ( formerly Re: 48-bit computers) Message-ID: <575@lysator.liu.se> Date: 11 Apr 91 02:38:30 GMT References: <1991Apr04.023845.3501@kithrup.COM> <1991Apr04.230953.15294@kithrup.COM> <1991Apr06.030330.1533@kithrup.COM> <572@lysator.liu.se> <6435@bwdls58.bnr.ca> Sender: news@isy.liu.se (Lord of the News) Organization: Lysator Computer Club, Linkoping University, Sweden Lines: 43 mlord@bwdls58.bnr.ca (Mark Lord) writes: > In article <572@lysator.liu.se> bellman@lysator.liu.se (Thomas Bellman) writes: > < [Me describing an analogy between memory segments and disk files.] > Not at all the same thing. Files are read in large chunks to negate the > performance impact somewhat. Accessing largish data items in main memory > requires segment prefixing (or whatever one calls it) on *each* access, > barring loop optimisations. Quite the performance hit, in addition to being > a kludge to overcome limited addressing capability. I don't really see why it should hinder loop optimisation. At least not if it segmentation is done on a low enough level of hardware. I think of segmentation as part of the MMU. Sort of selecting which page table to use. From a restricted set of tables, though. (Restricted by the OS, i e the OS decides the contents of the page tables.) I am *not* saying that you should have to do a "select segment" and then index in that segment. Rather I would have the segment as part of the pointer. And I am definitely *not* wanting segments for overcoming limited addressing. I want it to be able to know what object I'm using. Consider mapping a file into memory. When using the file normally, you can extend the file by just writing at the end of it. How do you do that when the file is mapped? You might have something just after the mapped file. Or take a stack. How does the OS know if you're extending the stack or indexing outside your allocated memory by mistake? It doesn't. It just guesses. The *programmer* decides the sizes of the segments, and how many he wants. You should be able to fit the entire address space in one segment. Just like you can have one single file taking up all of your disk. The programmer should also be allowed to specify the attributes of each segment (read, write, execute permission, auto-extending on writes after the end, ...), but that is up to the OS to deal with, and not a hardware question. -- Thomas Bellman, Lysator Computer Club ! "Make Love - Nicht Wahr" Linkoping University, Sweden ! "Too much of a good thing is e-mail: Bellman@Lysator.LiU.Se ! WONDERFUL." -- Mae West