The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Unix & Memory Management Units (MMU)
@ 2016-12-08 20:38 Noel Chiappa
  2016-12-08 22:39 ` Paul Ruizendaal
  0 siblings, 1 reply; 15+ messages in thread
From: Noel Chiappa @ 2016-12-08 20:38 UTC (permalink / raw)


    > Dennis Ritchie's home pages have some info on this

Yeah, I'd read that - I was hoping for some actual technical info on the KS11,
though.

(I'm assuming he has given the name there correctly, or if his memory has
dropped a bit - a thing which human memories do! :-) - since I've never been
able to find a single mention of it, including in the Spare Module Handbook,
which covers other Special Systems products).


    > I looked for (but did not find) information on what ""the classical
    > PDP-10 style "hi-seg" "low-seg" memory mapping unit"" was.

The best description is in the DECSystem-10 Hardware Reference Manual (mine is
EK-10/20-HR-001, but alas that version appears not to be online - I'll scan my
copy and put it online when I get a chance.) This version:

  http://pdp10.nocrew.org/docs/ad-h391a-t1.pdf

does appear to cover it: pp. 5-38 through 5-40 (pp. 352-354 of the PDF) for
the KA10, and pp. 5-15 to 5-30 (pp. 329-344) for the KI10.

The KA10 provided one (optionally) two base/bounds register pairs, where the
base register contains the location in real memory. With two pairs (the
second one applied to high user address space), the high part could be
write-protected, for sharing pure code.

The KI10 provided something similar to this, but more complicated; it included
paging, but also something called User 'Concealed', which allowed proprietary
subroutine packages to be used, while hidden from the rest of the user's code.

    > Does anyone have an idea what PDP-10 MMU Dennis may have been referring
    > to?

Almost certainly the KA10.

    > Here my hypothesis would be that in kernel mode mapping was off, and
    > that in user mode there were two segments, each with a base and limit
    > into physical memory

Hard to say. Kernel mode might or might not have mapping, and User mode might
have provided one, or two, segments; the KA10 did have an option for
single-segment.


    > this setup has an echo in how the later KL-11 MMU was used.

Sorry, what's a KL-11? The only 'KL11' I know of is the serial line board
(M780) which was the predecessor to the DL11.

       Noel



^ permalink raw reply	[flat|nested] 15+ messages in thread
* [TUHS] Unix & Memory Management Units (MMU)
@ 2016-12-08 19:44 Paul Ruizendaal
  0 siblings, 0 replies; 15+ messages in thread
From: Paul Ruizendaal @ 2016-12-08 19:44 UTC (permalink / raw)


Finally took a look at the V1 source.

Referring to http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/u2.s
Toward the end of the sysexec function there is:

	cmp	core,$405 / br .+14 is first instruction if file is
			  / standard a.out format
	bne	1f / branch, if not standard format
	mov	core+2,r5 / put 2nd word of users program in r5; number of
			  / bytes in program text
	sub	$14,r5 / subtract 12
	cmp	r5,u.count /
	bgt	1f / branch if r5 greater than u.count
	mov	r5,u.count
	jsr	r0,readi / read in rest of user's program text
	add	core+10,u.nread / add size of user data area to u.nread
	br	2f
1:
	jsr	r0,readi / read in rest of file
2:
	mov	u.nread,u.break / set users program break to end of 
				/ user code
	add	$core+14,u.break / plus data area
	jsr	r0,iclose / does nothing
	br	sysret3 / return to core image at $core

$core is equated to 040000 in another file (u0.s). In V1 apparently the a.out header was 6 words (http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man5/a.out.5), not 8, and hence the magic for a standard executable was 0405. It was already used as magic to distinguish a.out format files from other executables. It also shows that indeed 'exec' jumped to the first word of the header (at location $core).


^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <mailman.13.1481217534.3779.tuhs@minnie.tuhs.org>]
* [TUHS] Unix & Memory Management Units (MMU)
@ 2016-12-07 20:12 Noel Chiappa
  2016-12-07 21:00 ` Earl Baugh
  2016-12-08  8:50 ` Paul Ruizendaal
  0 siblings, 2 replies; 15+ messages in thread
From: Noel Chiappa @ 2016-12-07 20:12 UTC (permalink / raw)


    > From: Clem Cole

    > DEC's Custom Special Systems (CSS) group .. build a simple base/limi
    > register device, soon after the 11/20 was released.> ... So an early
    > version of after the original 11/20 port from the PDP-7 had this
    > however.....

Oh, right, I'd forgotten about that: the KS-11 - I've previously enquired to
see if anyone had _any_ documentation for this, but so far, nada.

    > I would look at Warren's First Edition work to see if there were dregs
    > of this in that code base

Alas, I'd already had that idea (to try and at least re-create a programming
spec, at least, for the KS11). There do not seem to be any traces there,
perhaps because that code came from a document entitled "Preliminary Release
of Unix Implementation", which argues that it's a very early 'version' of V0
(the early 'versions' weren't very formal, there was a continuous process of
change/improvement going on, apparently).


    > It is also noted that the 45 class system (45/55/70/44) had "17th"
    > address bit - i.e.  split I/D space.  I believe that this is when "magic
    > numbers" were really introduced so that could be supported.

No, they came in first for 'pure text' (0410):

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/nsys/ken/sys1.c

which I would expect arrived to minimize swapping on machines with small
amounts of real memmory.

Support for user split-I/D (411) didn't arrive until Version 6:

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/sys/ken/sys1.c

although IIRC split I/D in the kernel was supported supported slightly
before it was in user - although V5 didn't:

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/sys/conf/mch.s

so it couldn't have been much earlier than V6.

	 Noel


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [TUHS] Unix & Memory Management Units (MMU)
@ 2016-12-07 17:51 Noel Chiappa
  0 siblings, 0 replies; 15+ messages in thread
From: Noel Chiappa @ 2016-12-07 17:51 UTC (permalink / raw)


    > From: "Erik E. Fair" <f

    > One imagines that many pointer mistakes (bugs) in assembly or C were
    > discovered and squashed in that version, modulo the historical
    > unhappiness resulting from address zero containing a zero if
    > dereferenced ("NULL pointers") in process address space.

PS: PDP-11 Unix didn't, I think, do much (anything?) to solve the null pointer
problem. (This is for early C versions; I don't know about the later BSD
ones.)

Location 0 was a usable address for both read and write for everything except
'pure-text' (0410 magic word) processes; in those it was only legal for
read. Address 0 mostly did not contain a 0, either; for C programs using the
stock run-time, it contained a 'setd' instruction, except in split I+D
processes, in which case data space location 0 probably (I'm too busy to spin
up my V6 emulator to check) contained some of the program's initialized data
(unless special arrangements had been made).

	Noel



^ permalink raw reply	[flat|nested] 15+ messages in thread
* [TUHS] Unix & Memory Management Units (MMU)
@ 2016-12-07 17:10 Noel Chiappa
  0 siblings, 0 replies; 15+ messages in thread
From: Noel Chiappa @ 2016-12-07 17:10 UTC (permalink / raw)


    > From: "Erik E. Fair"

    > Which version of Unix first ran on a computer with virtual addressing

That would be the first version to run on the PDP-11/45; I'm not sure which one
that was, there's not enough left of Version 2 or Version 3 to see; Version 4
definitely ran on the 11/45:

  http://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/nsys/ken/45.s

    > My guess from a quick look at the history of the DEC PDP-11 is that the
    > target computer was likely a PDP-11/35 or PDP-11/40 with a KT11-D
    > "memory management" module.

No, they came after the -11/45 (with the KT11-C MMU).

    > What year did that come about?

They got one of the first -11/45's, per a Unix history document I'm too busy
to dig up, so 1972.

   Noel


^ permalink raw reply	[flat|nested] 15+ messages in thread
* [TUHS] Unix & Memory Management Units (MMU)
@ 2016-12-07 16:46 Erik E. Fair
  2016-12-07 17:31 ` Diomidis Spinellis
  2016-12-07 18:49 ` Clem Cole
  0 siblings, 2 replies; 15+ messages in thread
From: Erik E. Fair @ 2016-12-07 16:46 UTC (permalink / raw)


Which version of Unix first ran on a computer with virtual addressing (address translation) so that a process with non-position independent code (PIC) can be loaded anywhere in RAM that the kernel decided to put it, and memory protection such that no process could accidentally or deliberately access RAM not allocated to it by the kernel (or a SIGSEGV would be delivered to it)?

Put another way, when did Unix processes stop playing Core War with each other? (OK, so long as no more than one is resident at a time, they can't play Core War with each other, but there still needs to be a mechanism to protect the kernel from inadvertent (or advertent) pointer use).

Which is to say, when did Unix run on (and properly use) computers with memory management units (MMU)?

My guess from a quick look at the history of the DEC PDP-11 is that the target computer was likely a PDP-11/35 or PDP-11/40 with a KT11-D "memory management" module.

One imagines that many pointer mistakes (bugs) in assembly or C were discovered and squashed in that version, modulo the historical unhappiness resulting from address zero containing a zero if dereferenced ("NULL pointers") in process address space.

What year did that come about?

By the time I got to Unix (2.8BSD on the Cory Hall DEC PDP-11/70), those features (virtual addresses, memory protection from the kernel) had apparently been part of Unix for a long time - certainly earlier than Version 6.

This is distinct from demand-paged virtual memory which so far as I know was developed on the DEC VAX-11.

	curious,

	Erik <fair at netbsd.org>


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

end of thread, other threads:[~2016-12-08 22:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08 20:38 [TUHS] Unix & Memory Management Units (MMU) Noel Chiappa
2016-12-08 22:39 ` Paul Ruizendaal
  -- strict thread matches above, loose matches on Subject: below --
2016-12-08 19:44 Paul Ruizendaal
     [not found] <mailman.13.1481217534.3779.tuhs@minnie.tuhs.org>
2016-12-08 18:11 ` Johnny Billquist
2016-12-08 19:24   ` Paul Ruizendaal
2016-12-08 19:32     ` Lars Brinkhoff
2016-12-07 20:12 Noel Chiappa
2016-12-07 21:00 ` Earl Baugh
2016-12-08 10:39   ` Joerg Schilling
2016-12-08  8:50 ` Paul Ruizendaal
2016-12-07 17:51 Noel Chiappa
2016-12-07 17:10 Noel Chiappa
2016-12-07 16:46 Erik E. Fair
2016-12-07 17:31 ` Diomidis Spinellis
2016-12-07 18:49 ` Clem Cole

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