Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!ubc-cs!alberta!calgary!radford
From: radford@calgary.UUCP (Radford Neal)
Newsgroups: comp.arch
Subject: Re: Is the Intel memory model safe from NO-ONE ?!?
Message-ID: <1574@vaxb.calgary.UUCP>
Date: 8 May 88 19:59:46 GMT
References: <1806@obiwan.mips.COM> <2904@omepd> <353@cf-cm.UUCP> <22830abd:a11@snark.UUCP>
Organization: U. of Calgary, Calgary, Ab.
Lines: 49
Summary: What a segment is


In article <2411@louie.udel.EDU>, rminnich@udel.EDU (Ron Minnich) writes:

> >    But having used segmented machines (done right, at Burroughs) and
> > non-segmented machines, i can say that i trust programs running
> > on segmented machines a whole lot more. And I trust C programs
> > running on non-segmented machines not-a-whit- just ask anybody
> > who knows about NULL pointers.

In article <22830abd:a11@snark.UUCP>, eric@snark.UUCP (Eric S. Raymond) writes

> Waaaait a second, here. It sounds to me like two very different issues are
> being confused. Let's have some definitions:
> 
>      Segmented architecture -- one in which the register width is not
>          sufficient to address all of memory, so that full addresses must
>          be base/offset or segment-descriptor/address pairs.

I think you're both wrong, here. My impression of the common (and most
useful) meaning of the word "segment", as used in MULTICS for instance, is
the following: 

   A segment is a contiguous portion of virtual memory that is conceptually
   separate from other portions of virtual memory. 

Typically, one gets to expand and shrink a segment independently of other
segments. For instance, one maybe gets to map two files to two segments
and be able to extend or truncate the mapped files as desired. Maybe one
also gets to set permissions differently for different segments, but I'd
consider that a side issue.

I would expect to be able to address any word of any segment by simply
following a pointer (i.e. i = *p). If you can't, you've got some sort
of "bank switched" addressing kludge. This definition is really language,
not machine, dependent - maybe you can do it in C but not Pascal - though
obviously the underlying hardware support determines the cost of doing it.

Typically, segments would begin at fixed distances in virtual address
space from each other. This distance in turn determines the maximum
size of a segment. (Other factors might limit a segment to less than
this of course.) The typical problem with segmented systems is that the
maximum size of a segment is too small - e.g. 64KB on an 8088, 1MB on
MULTICS (I think). Allowing too few segments also causes problems - e.g.
256 on MULTICS (I think). If you don't have either of these problems,
then segmentation is a great idea. Of course, you're inevitably paying
something for those extra address bits necessitated by your sparse
use of address space.

   Radford Neal