Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!iggy.GW.Vitalink.COM!widener!netnews.upenn.edu!vax1.cc.lehigh.edu!lehi3b15!batman!halkoD From: halkoD@batman.moravian.EDU (David Halko) Newsgroups: comp.arch Subject: Re: Segmented Architectures ( formerly Re: 48-bit computers) Summary: Segmentation Message-ID: <4084@batman.moravian.EDU> Date: 23 Apr 91 15:59:45 GMT References: <1991Apr06.030330.1533@kithrup.COM> Organization: Moravian College, Bethlehem, PA Lines: 71 In article , fargo@iear.arts.rpi.edu (Irwin M. Fargo) writes: > In article <572@lysator.liu.se> bellman@lysator.liu.se (Thomas Bellman) writes: > > > > [a few paragraphs removed] > > > >Sometimes you don't want the segmentation. Sometimes you want the > >flat address modell. This is equivalent to accessing the physical > >disk in a file system. The file system it self want to do this, but > >will probably not want to let the user do that himself. Same for > >memory, the OS wants to address the memory as a flat space, but might > >not want the user programs to do this. > > With what I know of OSs, wouldn't segmentation be what the OS wants? > > In most of today's computer systems, virtual memory is the Big Thing (tm). > The idea behind virtual memory (correct me if I'm wrong), is that a program > can read/write to memory as if memory were directly connected, but it is > actually re-mapped to a previously specified location in physical memory. > > Obviously, virtual memory mappers of today use pages to allow more flexible > ways of memory mapping. Couldn't a virtual memory page be considered the > same as a segment? (a la the Intel 80386 in protected mode) > > If the OS (or any other program really wants, you can tell the MMU you want > one page that takes up all of memory of lots of little pages. > > My whole point is, if we consider virtual memory pages to be equivalent to > segments, then it would seem that quite a few systems do use segmentation > and that it really is not that outdated an idea. > From what little I have read on virtual memory and segmentation, segmentation seems to be an abstraction of Virtual Memory. Virtual memory is one dimensional because virtual addresses go from 0 to some maximum address, one address after another. This has a tendency of causing problems. If a compiler is building several tables (symbol table, parse tree, call stack, numeric constants table, etc.) and one table grows at a faster rate than it is supposed to, thus causing one table to collide with another, this can cause problems! Segmentation was designed to solve this problem. Instead of there baing 1 linear address space, there are multiples, allowing in this example, the symbol table, constants, parse tree, and call stack to take up separate address spaces starting at 0 and growing until the maximum of its segment is hit (which then causes a problem), but the point it the space can grow dymanamically, not taking up any extra address space, thus leaving lots of room for other processes taking up other segments, until memory eventually runs out (but this is what we have virtual memory built underneath segmentation for! Oh Baby!) Besides that, segments allow separate procedures or data to be distinguished separately from one another and protected. Sharing procedures in segments between users is facilitated. The programmer needs to be aware of segmentation to make use of it, however (at a lower leve, compiler designers, for example) to make full use of it. May I add, however, smart OS's have taken advantage of the theories behind segmentation before it existed in hardware practice (OS-9 used memory modules which could be distinguished from data/executable modules as well as these modules being available to be shared between processes... I still can't figure out why MS-Dos ever took a descent foothold in the market!) -- _______________________________________________________________________ / \ / "The use of COBOL cripples the mind; its teaching should, therefore, be \ / regarded as a criminal offence." E.W.Dijkstra, 18th June 1975. \ +-----------------------------------------------------------------------------+ \ "Have you purchased a multi- halkoD@moravian.edu Have you booted your / \ media machine from IMS yet?" David J. Halko OS-9 computer today?/ \_______________________________________________________________________/