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

> On Wed, 15 Nov 2000, Johnny Billquist wrote:
> > The Kernel/Supervisor/User mode is a different issue and has nothing to do
> > with this. You can only be in one more at a time, and you only have 64 k
> > address range. The different modes only affect which set of registers used
> > by the MMU to map your virtual address to a physical address, nothing
> > else. And some machines only have kernel/user (no supervisor).
> > Incidentally, this coinside with which machines have split I/D space.
> > 
> 
> Yes, you need to have supervisor mode to use the the supervisor address space.

Yes.

> The supervisor space could be used to hold the code of libraries. This
> provided an additional 32Kword address space.

Yes, but that is no different from remapping your own 32kword of address
space. It in no way make it possible to address more than 32kword. It's
just a question of having another mapping available for another 32kword.

>  I do not know the glorous
> details on how it was done - the application programmer could just link (build
> task) against the "supervisor mode libraries" - and the instruction space did
> not have to hold the libraries. I do not know if any Unix variant ever had any
> similar feature, RSX-11M+ did have this option. Maybe what happened was that
> the supervisor mode pages were set to a different code but identical data.

Yes. That's exactly how it's done. The supervisor I-space is mapped
against the library code, while the supervisor D-space maps the same
addresses as the user D-space.

> I
> think I tried to be a bit too brief  above. What I meant is that this was the
> way to "sneak in" an additional 32Kword of code in a separate address space.

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.

> 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.
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?

And speaking of Unix. I suddenly can't remember for sure, but I think that
the networking stuff runs in supervisor mode.

One might ask why the supervisor mode even exist. The only point really is
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.
The same functionality could be done without supervisor mode by a system
call.

	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