The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Re: [COFF] Re: Supervisor mode on ye olde PDP-11
@ 2024-06-19 16:17 Noel Chiappa
  2024-06-19 16:55 ` Phil Budne
  0 siblings, 1 reply; 3+ messages in thread
From: Noel Chiappa @ 2024-06-19 16:17 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

    > From: Warner Losh

    > 2.11BSD used a mode between kernel and user for the TCP stack to get
    > more effective address space...

Is there a document for 2.11 which explains in detail why they did that? I
suspect it's actually a little more complicated than just "more address
space".

The thing is that PDP-11 Unix had been using overlays in the kernel for quite
a while to provide more address space. I forget where they first came in (I
suspect there were a number of local hacks, before everyone started using the
BSD approach), but by 2.9 BSD they were a standard part of the system. (See:

  https://minnie.tuhs.org/cgi-bin/utree.pl?file=2.9BSD/usr/src/sys/conf/Ovmakefile

for some clues about how this works. There is unfortunately no documentation
that I know of which explains clearly how it works; if anyone knows of any,
can you please let me know? Otherwise you'll have to read the sources.)

I can think of two possible reasons they started using supervisor mode: i)
There were a limited number of the 2.9-type overlays, and they were not
large; trying to support all the networking code with the existing overlay
system may have been too hard. ii) I think this one is unlikely, but I'll
list it as a possibility. Switching overlays took a certain amount of
overhead (since mapping registers had to be re-loaded); if all the networking
code ran in supervisor mode, the supervisor mode mapping registers could be
loaded with the right thing and just left.

	Noel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [TUHS] Re: [COFF] Re: Supervisor mode on ye olde PDP-11
  2024-06-19 16:17 [TUHS] Re: [COFF] Re: Supervisor mode on ye olde PDP-11 Noel Chiappa
@ 2024-06-19 16:55 ` Phil Budne
  2024-06-19 17:20   ` Warner Losh
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Budne @ 2024-06-19 16:55 UTC (permalink / raw)
  To: tuhs; +Cc: jnc

JNC wrote:
> Is there a document for 2.11 which explains in detail why they did that? I
> suspect it's actually a little more complicated than just "more address
> space".
...
> ... Switching overlays took a certain amount of
> overhead (since mapping registers had to be re-loaded); if all the networking
> code ran in supervisor mode, the supervisor mode mapping registers could be
> loaded with the right thing and just left.

That's my understanding... It allows mbufs to be mapped only
in supervisor mode...

https://minnie.tuhs.org/PUPS/Setup/2.11bsd_setup.html says:

       The networking in 2.11BSD, runs in supervisor mode, separate
       from the mainstream kernel. There is room without overlaying to
       hold both a SL/IP and ethernet driver. This is a major win, as
       it allows the networking to maintain its mbufs in normal data
       space, among other things. The networking portion of the kernel
       resides in ``/netnix'', and is loaded after the kernel is
       running. Since the kernel only looks for the file ``/netnix'',
       it will not run if it is unable to load ``/netnix'' , sites
       should build and keep a non-networking kernel in ``/'' at all
       times, as a backup. NOTE: The ``/unix'' and ``/netnix''
       imagines must have been created at the same time, do not
       attempt to use mismatched images. The ability to have boot tell
       the kernel which network image to load is on the wish list (had
       to have something take the place of wishing for disklabels
       ;-)).

https://wfjm.github.io/home/ouxr/ shows the code path for the socket(2) syscall

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [TUHS] Re: [COFF] Re: Supervisor mode on ye olde PDP-11
  2024-06-19 16:55 ` Phil Budne
@ 2024-06-19 17:20   ` Warner Losh
  0 siblings, 0 replies; 3+ messages in thread
From: Warner Losh @ 2024-06-19 17:20 UTC (permalink / raw)
  To: Phil Budne; +Cc: tuhs, jnc

[-- Attachment #1: Type: text/plain, Size: 2276 bytes --]

On Wed, Jun 19, 2024 at 10:56 AM Phil Budne <phil@ultimate.com> wrote:

> JNC wrote:
> > Is there a document for 2.11 which explains in detail why they did that?
> I
> > suspect it's actually a little more complicated than just "more address
> > space".
> ...
> > ... Switching overlays took a certain amount of
> > overhead (since mapping registers had to be re-loaded); if all the
> networking
> > code ran in supervisor mode, the supervisor mode mapping registers could
> be
> > loaded with the right thing and just left.
>
> That's my understanding... It allows mbufs to be mapped only
> in supervisor mode...
>

Yea. that's a much better explanation than my glossed over 'more address
space'. It's both to get more text space (overlays weren't infinite, and
being a
separate image allowed more selective communication across the interface
boundary) and to provide some separation and allow for more data to be
around easily (the BSD kernel didn't overlay data, which is technically
possible
on PDP-11, but the linker didn't support it).


> https://minnie.tuhs.org/PUPS/Setup/2.11bsd_setup.html says:
>
>        The networking in 2.11BSD, runs in supervisor mode, separate
>        from the mainstream kernel. There is room without overlaying to
>        hold both a SL/IP and ethernet driver. This is a major win, as
>        it allows the networking to maintain its mbufs in normal data
>        space, among other things. The networking portion of the kernel
>        resides in ``/netnix'', and is loaded after the kernel is
>        running. Since the kernel only looks for the file ``/netnix'',
>        it will not run if it is unable to load ``/netnix'' , sites
>        should build and keep a non-networking kernel in ``/'' at all
>        times, as a backup. NOTE: The ``/unix'' and ``/netnix''
>        imagines must have been created at the same time, do not
>        attempt to use mismatched images. The ability to have boot tell
>        the kernel which network image to load is on the wish list (had
>        to have something take the place of wishing for disklabels
>        ;-)).
>
> https://wfjm.github.io/home/ouxr/ shows the code path for the socket(2)
> syscall
>

Oh, that's nice.

Warner

[-- Attachment #2: Type: text/html, Size: 3239 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-19 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-19 16:17 [TUHS] Re: [COFF] Re: Supervisor mode on ye olde PDP-11 Noel Chiappa
2024-06-19 16:55 ` Phil Budne
2024-06-19 17:20   ` Warner Losh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).