Subject: RE: PDP-11 thoughts
To: P.G. <pgaray@bigfoot.com>
From: Johnny Billquist <bqt@Update.UU.SE>
List: port-vax
Date: 11/16/2000 13:47:25
On Wed, 15 Nov 2000, P.G. wrote:

> On Wed, 15 Nov 2000, Johnny Billquist wrote:
> 
> > And you can do this without supervisor mode as well. Yuo can just as well
> > remap your address space to different parts of the memory as required.
> > Since you know RSX, the way you do it easiest there is to have memory
> > resident overlays. What happens is that the MMU will map different parts
> > of the memory into your 32kword space depending on what routine you
> > called. But you can do it by hand as well if you want to. The limit is how
> > much physical memory you have. But that don't change the limit of 32kword
> > address range. You're just manipulating the MMU mapping.
> 
> Well, setting up overlays was a major pain

Definitely a pain when your program becomes more complex.

> and the longest branch of the
> overlay had to fit in 32Kwords. (as you went down the call tree, you could not
> remove the top, to free space).

You also have co-trees which attack that problem.

> Supervisor libraries could add to that, as
> those things that were in supervisor space were on top of the 32Kword. So it
> was good for something. In theory, that could have been done by a kernel call
> - much slower.

Like I said. Supervisor mode makes it faster and easier, but it don't
really add anything else.

> And total amount of memory used up an by overlayed program was
> more than it was this way (many lower level functions were included several
> times in various overlay branches.)

Not if you use co-trees.

> > > This probably was not an option for kernel developers (I think you can not
> > call
> > > to supervisor mode from kernel mode), but I am not sure about that.
> > 
> > Two points:
> > 1) In kernel mode you can do anything you want.
> 
> Like crash the machine :-)  If you say you can set the MMU up the way you
> like, yes. But you only have 8 "regions" so you can not use this to make up
> for the missing address - setting up these kind of overlays as the code grew
> was a bigger task than writing the code itself.

Ummm. My point was that in kernel mode you have absolutely no problems
using a supervisor library, since you can do anything you want in kernel
mode. So I just refuted your assumption that supervisor mode libraries
couldn't be used by kernel hackers.

> > 2) Why changer to supervisor when you can do the same thing *in* kernel
> >    mode. Just remap the MMU as you see fit in the kernel. RSX do it all
> >    the time. Or did you think that the whole kernel fits within 20Kword?
> 
> extra registers can in general be replaced with memory and extra code.  The
> kernel had its own space so there was no gain maping out and keeping in
> memory parts of it if the total was under 32K.  RSTS could have parts of the
> kernel on disk, I do not recall RSX11M+, RSX-11 (versions???) were memory
> resident.

RSX is memory resident, but it's definitely more that 32K, unless you run
a small, unmapped -11M or -11S system.

A typical M+ system is probably close to 100Kword all parts counted...

> on PDP I do not recall the supervisor mode used for anything else. On the VAX
> it is extensively used by the CLI and debugger on VMS.

Don't forget RMS...

> In theory, that can be
> done other ways, but then why do we like the PDP11 or VAX instruction set?
> Everything can be done with 2 instructions: Branch on bit, flip bit :-)

Well, the way VMS, or RSX for that matter, treats supervisor mode is just
a convention. It's nothing special from the hardware point of view.
And that also means that you can replace it with other conventions. The
hardware don't care.

> > that this allows you a fast way to change your mappings, since you don't
> > need to reload the MMU registers, and each mode has it's own stack
> > pointer.
> 
> Correct, it saves times and complexity on overlay design.

Yup.

> > The same functionality could be done without supervisor mode by a system
> > call.
> 
> on PDP I do not recall the supervisor mode used for anything not
> mentioned yet.

The the PDP-11, the suprtvisor mode have been used in the following ways
that I know of:

o RSX:    An additional way of using libraries so that they don't use up
          address space.
o RSTS/E: The idle loop used supervisor mode to make the worm also run
          in the address lights (removed now I believe).
o Unix:   The networking parts of the kernel runs in supervisor mode.

> On the VAX it is extensively used by the CLI and debugger on VMS. When the
> alpha was designed it was a design requirement to have the 4 modes identical
> to VAX to ease porting VMS

Yes, but is only because VMS is written to use them that way. That don't
mean you cannot do it without these modes, just that you have to rewrite
the code to do it other ways.

	Johnny

Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt@update.uu.se           ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol