Difference between pages "PDP-11" and "PDP-11 Memory Management"

From Computer History Wiki
(Difference between pages)
Jump to: navigation, search
(More about UNIX)
 
(Segment/page naming)
 
Line 1: Line 1:
The '''PDP-11''' is a series of computers introduced in 1969 [1] by the [[Digital Equipment Corporation]] (DEC), in production there from 1970-1990. Their life-time spanned a period of momentous changes in the computer world: when they were first introduced (and for a little less than half their life), [[core memory]] was still the standard [[main memory]] technology; by the end, [[microprocessor]]s had become ubiquitous.
+
[[PDP-11]]s which provide [[memory management]] use a standard '''PDP-11 Memory Management''' architecture. When memory management is enabled, the basic 64 Kbyte [[address space]] of the [[PDP-11 architecture]] is divided into 8 '[[segment]]s' (the terminology used in the first version of the documentation; it was later changed to 'pages', for unknown reasons, but this is incorrrect - the functionality provided is that of segmentation, not [[virtual memory|paging]]). Each segment of a virtual address space can be assigned to any location in physical [[main memory]].
  
[[Image:PDP1123PLUS-01.jpeg|right|thumb|200px|A loaded QBUS PDP-11/23 PLUS]]
+
Each segment can be set to any length between 0 bytes and 8 Kbytes, in 0100 (64.) byte increments. Segments can grow either up from their base address, or down; the latter to accomodate PDP-11 [[stack]]s, which typically grow down (from higher addresses to lower).
  
The machine word size was 16 bits, and it was a [[general register architecture]]. Although it was not the first to feature the latter, its wide distribution (in 1980, it was the world's best-selling computer) has helped influence almost all later machines to follow that path.
+
The [[Central Processing Unit|CPU]] can be in one of three modes; 'Kernel', 'Supervisor', and 'User'; each has its own separate set of mapping [[register]]s, to provide separate virtual address spaces for each mode.
  
(For more information about the architecture, including its innovative and much-copied [[stack]]-oriented [[addressing modes]], see [[PDP-11 architecture]].)
+
An additional enhancement is that [[instruction]] and data fetches can be set to go to separate 64 Kbyte address spaces, the so-called '''Split I+D space''' capability; this increases the memory available to the operating system, and each user, to 128 Kbytes.
  
PDP-11's came in two groups: those which used the [[UNIBUS]] for a bus, and the later ones which used the [[QBUS]]. Eventually DEC stopped producing [[UNIBUS]] PDP-11's (the last were the [[PDP-11/44]] and [[PDP-11/24]]); later 'UNIBUS' machines (the [[PDP-11/84]] and [[PDP-11/94]]) actually contained QBUS processors with a QBUS<->UNIBUS adapter board.
+
(Since immediate operands and absolute addresses are stored contiguous with their instructions, fetches of them are considered to be instruction fetches, for the purposes of deciding which space to use for them.)
  
It could run a variety of operating systems. Many were produced by [[DEC]] themselves, but several were produced by third-parties. (It was the machine which made [[UNIX]] widely known and popular, with [[UNIX Sizth Edition]].) Often DEC would purchase or re-brand this OS and re-sell it as their own product; for example, UNIX sold as [[Ultrix]] by DEC.
+
When split I+D is not enabled in any particular mode, only a single 64 Kbyte address space is provided, using only the I-space registers for that mode.
  
After DEC discontinued production of PDP-11's, the line was sold to [[Mentec]], who produced a few newer models.
+
If any instruction causes a [[fault]] (i.e. an attempt to perform a memory operation which cannot be completed, because of the settings of the memory management - e.g. an attempt to write into a segment set as 'read only'), execution of the instruction is aborted, and a memory management [[trap]] occurs.
  
== Operating Systems ==
+
===Simplified subset===
  
=== Unix based Operating Systems ===
+
A number of the smaller PDP-11's (notably the [[PDP-11/40]], [[PDP-11/34]], [[PDP-11/23]] and [[PDP-11/24]]) provide only a limited subset of the standard memory management facilities. In these machines, there is no support for Split I+D, and no Supervisor mode (just Kernel and User).
  
* [[UNIX First Edition]]
+
Also, there is no SSR1 register (below), which can make re-starting instructions which cause a fault laborious (the fault-handling code has to decipher the instruction and effectively simulate its operation, to work out which registers need to be 'backed out' to their state before the instruction started execution), and in some cases impossible (e.g. instructions which auto-increment the same register several times).
* [[UNIX Second Edition]]
 
* [[UNIX Third Edition]]
 
* [[UNIX Fourth Edition]]
 
* [[UNIX Fifth Edition]]
 
* [[UNIX Sixth Edition]]
 
* [[Unix Seventh Edition]]
 
  
These are the original Bell Laboratories releases of Unix; the first 4 were only internal to Bell, the Fifth saw limited distribution outside it, and the Sixth took over the world.
+
==Registers==
  
* [[System III]]
+
The memory management is entirely controlled by groups of registers in the CPU (unlike many virtual memory systems, which use page tables held in main memory, and cached in the CPU).
  
This was the first shipping Unix distro by AT&T. It only supported the PDP-11 and [[VAX]] computers.
+
===Control===
  
* [[2.9 BSD]]
+
There are four registers which control the overall operation of the Memory Management Unit:
  
This version was a port of the 4.3 feature set to the PDP-11. Although considered impossible by many, it accomplished this by using overlays for portions of the kernel, and to allow for user programs larger then 64kb.
+
{| class="wikitable"
 +
! Address !! Name !! Function
 +
|-
 +
| 777572 || SSR0 || Control and status
 +
|-
 +
| 777574 || SSR1 || Register increment/descrement record
 +
|-
 +
| 777576 || SSR2 || Virtual address associated with the fault (usually the instruction address)
 +
|-
 +
| 777516 || SSR3 || D-space enable/disable (per mode)
 +
|}
 +
 
 +
On the 'simplified subset' machines, SSR1 and SSR3 are not implemented.
 +
 
 +
SSR0 contains control bits (e.g. enabling memory management) and status bits (e.g. information about memory operations which caused a memory management fault, and the segment involved). The layout of SSR0 is:
 +
{{16bit-header}}
 +
| Non-resident || Length || Read-only || Trap || colspan=2 | Unused || Enable Trap || Maintenance || Instruction Completed || colspan=2 | CPU Mode || I/D || colspan=3 | Page || Enable
 +
{{16bit-bitout}}
 +
 
 +
When any of the first three bits (all error aborts) are set, bits 1-7, as well as SSR1 and SSR2, are frozen. On the 'simplified subset' machines, bits 12, 9, 7 and 4 are not implemented.
 +
 
 +
SSR1 contains information about register modifications (given there in [[two's complement]]) performed during the course of an instruction, to allow those modifications to be 'backed out' if the instruction needs to be restarted after a memory management fault. Its layout is:
 +
{{16bit-header}}
 +
| colspan=5 | Change || colspan=3 | Register || colspan=5 | Change || colspan=3 | Register
 +
{{16bit-bitout}}
  
* [[2.10 BSD]]
+
SSR2 contains the address of the instruction which caused the memory management fault.
* [[2.11 BSD]]
 
  
This version is still supported, and if one really felt the need to load a Unix for use on a PDP-11 this would be the best fit. It has support for TCP/IP, large memory space and is the best UNIX experence one can get going to get on a 16-bit mini.
+
SSR3 contains bits to enable Split I+D in the three modes; on machines which have [[UNIBUS map]]s, the enable for it is also here. Its layout is:
 +
{{16bit-header}}
 +
| colspan=10 | Unused || Enable UNIBUS Map || Enable 22-bit || Unused || Kernel || Supervisor || User
 +
{{16bit-bitout}}
 +
 
 +
The 'Enable 22-bit' bit only applies on machines which support larger memories, i.e. the [[PDP-11/70]], [[PDP-11/44]], and machines with the [[KDF11 CPUs]] and [[KDJ11 CPUs]].
 +
 
 +
===PARs and PDRs===
 +
 
 +
Each segment (up to 48 in total; 8 each Instruction and Data, for the three different modes) is described by a pair of registers, a Page Descriptor Register (PDR) and a Page Address Register (PAR).
 +
 
 +
The PAR contains the base physical address for the segment (in units of 0100/64. bytes). On machines which have only [[UNIBUS]] memory (e.g. PDP-11/40, [[PDP-11/45]], etc) these registers are 12 bits long, since the maximum amount of physical memory on these machines is 248 Kbytes. On machines which support up to 4 MBytes of physical memory (e.g. [[PDP-11/70]], [[PDP-11/44]], PDP-11/23, etc), they are 16 bits long.
 +
 
 +
The PDR contains the segment's length, along with the direction of growth, the access control field (read/only, read/write, etc), a 'dirty' bit (maintained by the hardware), etc. The layout of the PDR is:
 +
 
 +
{{16bit-header}}
 +
| Unused || colspan=7 | Length || Trapped || Written || colspan=2 | Unused || Direction || colspan=3 | Access Control
 +
{{16bit-bitout}}
 +
 
 +
The values of the 'Access Control' field are:
 +
{| class="wikitable"
 +
! Value !! Mode
 +
|-
 +
| 0 || Non-resident - abort all accesses
 +
|-
 +
| 1 || Read-only watched - abort on write, trap on read
 +
|-
 +
| 2 || Read-only - abort on write
 +
|-
 +
| 3 || Unused, reserved - abort all accesses
 +
|-
 +
| 4 || Read/write all watched - trap on read or write
 +
|-
 +
| 5 || Read/write watched - trap on write
 +
|-
 +
| 6 || Read/write - none
 +
|-
 +
| 7 || Unused, reserved - abort all accesses
 +
|}
  
=== Other OS's ===
+
On the 'simplified subset' machines, only modes 0, 2 and 6 are supported, and neither is the 'Trapped' bit (set on PDR's for memory references that trapped, on the other machines).
  
* [[RSX-11]]
+
The addresses of the PAR/PDR sets are:
* [[RSTS/E]]
 
* [[RT-11]]
 
  
== PDP-11 Models and notes ==
 
 
{| class="wikitable"
 
{| class="wikitable"
! Model !! Introduced !! Bus Type !! Addressing !! Notes !! Speed (VUPS)
+
! Address !! Name !! Function
 +
|-
 +
| 772200 || SISD0 || Supervisor I-Space PDR #0
 +
|-
 +
| colspan="2" style="text-align:center;" | ...
 +
|-
 +
| 772216 || SISD7 || Supervisor I-Space PDR #7
 +
|-
 +
| 772220 || SDSD0 || Supervisor D-Space PDR #0
 +
|-
 +
| colspan="2" style="text-align:center;" | ...
 +
|-
 +
| 772236 || SDSD7 || Supervisor D-Space PDR #7
 
|-
 
|-
| [[PDP-11/20|11/20]] || 1969[1] ||[[UNIBUS]] || 16-bit || ||
+
| 772240 || SISA0 || Supervisor I-Space PAR #0
 
|-
 
|-
| [[PDP-11/05|11/05]] || 1972 || UNIBUS || 16-bit || ||
+
| colspan="2" style="text-align:center;" | ...
 
|-
 
|-
| [[PDP-11/10|11/10]] || 1972 || UNIBUS || 16-bit || [[KD11-B]] processor[*] ||
+
| 772256 || SISA7 || Supervisor I-Space PAR #7
 
|-
 
|-
| [[PDP-11/15|11/15]] || 1972 || UNIBUS || 16-bit || OEM model ||
+
| 772260 || SDSA0 || Supervisor D-Space PAR #0
 
|-
 
|-
| [[PDP-11/40|11/40]] || 1973 || UNIBUS || 18-bit || ||
+
| colspan="2" style="text-align:center;" | ...
 
|-
 
|-
| [[PDP-11/45|11/45]] || 1973 || UNIBUS || 18-bit || core memory ||
+
| 772276 || SDSA7 || Supervisor D-Space PAR #7
 
|-
 
|-
| [[PDP-11/50|11/50]] || 1975 || UNIBUS || 18-bit || [[MOS]] memory ||
+
| 772300 || KISD0 || Kernel I-Space PDR #0
 
|-
 
|-
| [[PDP-11/70|11/70]] || 1975 || UNIBUS || 22-bit || || 0.6
+
| colspan="2" style="text-align:center;" | ...
 
|-
 
|-
| [[PDP-11/03|11/03]] || 1975 || [[QBUS]] || 16-bit || first QBUS model, first [[F-11]] || 0.5
+
| 772316 || KISD7 || Kernel I-Space PDR #7
 
|-
 
|-
| [[PDP-11/34|11/34]] || 1976 || UNIBUS || 18-bit || || 0.21
+
| 772320 || KDSD0 || Kernel D-Space PDR #0
 
|-
 
|-
| [[PDP-11/04|11/04]] || 1976 || UNIBUS || 16-bit || || 0.11
+
| colspan="2" style="text-align:center;" | ...
 
|-
 
|-
| [[PDP-11/55|11/55]] || 1976 || UNIBUS || 18-bit || fast bipolar memory ||
+
| 772336 || KDSD7 || Kernel D-Space PDR #7
 
|-
 
|-
| [[PDP-11/60|11/60]] || 1977 || UNIBUS || 18-bit || writable control store ||
+
| 772340 || KISA0 || Kernel I-Space PAR #0
 
|-
 
|-
| [[PDP-11/23|11/23]] || 1979 || QBUS || 18-bit ''or'' 22-bit || || 0.12
+
| colspan="2" style="text-align:center;" | ...
 
|-
 
|-
| [[PDP-11/24|11/24]] || 1979 || UNIBUS || 22-bit || first UNIBUS model to use F-11 chip || 0.18
+
| 772356 || KISA7 || Kernel I-Space PAR #7
 
|-
 
|-
| [[PDP-11/44|11/44]] || 1979 || UNIBUS || 22-bit || last non-LSI PDP-11 || 0.42
+
| 772360 || KDSA0 || Kernel D-Space PAR #0
 
|-
 
|-
|[[PDP-11/23 PLUS|11/23+]] || 1981 Nov || QBUS || 22-bit || || 0.18
+
| colspan="2" style="text-align:center;" | ...
 
|-
 
|-
| [[PDP-11/73|11/73]] || 1983 || QBUS || 22-bit || first [[J-11]] machine, 15MHz, integrated FPU, also first [[PMI]] PDP-11 || 0.45
+
| 772376 || KDSA7 || Kernel D-Space PAR #7
 
|-
 
|-
| [[PDP-11/53|11/53]] || 1984 || QBUS || 22-bit || S-box or standard QBUS, integrated FPU, 768KiW memory || 0.29
+
| 777600 || UISD0 || User I-Space PDR #0
 
|-
 
|-
| [[PDP-11/83|11/83]] || 1988 || QBUS || 22-bit || J-11 at 18MHz, integrated FPU || 0.72
+
| colspan="2" style="text-align:center;" | ...
 
|-
 
|-
| [[PDP-11/84|11/84]] || 1988 || UNIBUS || 22-bit || J-11 at 18MHz, integrated FPU || 0.72
+
| 777616 || UISD7 || User I-Space PDR #7
 
|-
 
|-
| [[PDP-11/93|11/93]] || 1990 || QBUS || 22-bit || J-11 at 18MHz, integrated FPU, 2MiW onboard memory || 1.0
+
| 777620 || UDSD0 || User D-Space PDR #0
 
|-
 
|-
| [[PDP-11/94|11/94]] || 1990 || UNIBUS || 22-bit || J-11 at 18MHz, integrated FPU, 2MiW onboard memory || 1.0
+
| colspan="2" style="text-align:center;" | ...
 +
|-
 +
| 777636 || UDSD7 || User D-Space PDR #7
 +
|-
 +
| 777640 || UISA0 || User I-Space PAR #0
 +
|-
 +
| colspan="2" style="text-align:center;" | ...
 +
|-
 +
| 777656 || UISA7 || User I-Space PAR #7
 +
|-
 +
| 777660 || UDSA0 || User D-Space PAR #0
 +
|-
 +
| colspan="2" style="text-align:center;" | ...
 +
|-
 +
| 777676 || UDSA7 || User D-Space PAR #7
 
|}
 
|}
 
''<span style="font-size:70%">[*]The name PDP-11/10 was recycled by DEC from an earlier [[KA11 CPU]]-based 11/10 from 1969, or at least it existed in advertisements[1]</span>''
 
 
==See also==
 
 
* [[PDP-11 Memory Management]]
 
* [[FP11 floating point]]
 
* [[UNIBUS memories]]
 
* [[QBUS memories]]
 
* [[UNIBUS boot ROMs]]
 
* [[QBUS boot ROMs]]
 
 
==References==
 
 
* [http://vintagecomputer.net/digital/PDP11-20/PDP11_Price-List_19691215.pdf PDP-11/20 Price List]
 
 
{{stub}}
 
  
 
{{PDP-11}}
 
{{PDP-11}}
  
 
[[Category: PDP-11s]]
 
[[Category: PDP-11s]]
[[Category: DEC Computer Systems]]
 
[[Category: DEC Architectures]]
 

Revision as of 17:34, 28 April 2018

PDP-11s which provide memory management use a standard PDP-11 Memory Management architecture. When memory management is enabled, the basic 64 Kbyte address space of the PDP-11 architecture is divided into 8 'segments' (the terminology used in the first version of the documentation; it was later changed to 'pages', for unknown reasons, but this is incorrrect - the functionality provided is that of segmentation, not paging). Each segment of a virtual address space can be assigned to any location in physical main memory.

Each segment can be set to any length between 0 bytes and 8 Kbytes, in 0100 (64.) byte increments. Segments can grow either up from their base address, or down; the latter to accomodate PDP-11 stacks, which typically grow down (from higher addresses to lower).

The CPU can be in one of three modes; 'Kernel', 'Supervisor', and 'User'; each has its own separate set of mapping registers, to provide separate virtual address spaces for each mode.

An additional enhancement is that instruction and data fetches can be set to go to separate 64 Kbyte address spaces, the so-called Split I+D space capability; this increases the memory available to the operating system, and each user, to 128 Kbytes.

(Since immediate operands and absolute addresses are stored contiguous with their instructions, fetches of them are considered to be instruction fetches, for the purposes of deciding which space to use for them.)

When split I+D is not enabled in any particular mode, only a single 64 Kbyte address space is provided, using only the I-space registers for that mode.

If any instruction causes a fault (i.e. an attempt to perform a memory operation which cannot be completed, because of the settings of the memory management - e.g. an attempt to write into a segment set as 'read only'), execution of the instruction is aborted, and a memory management trap occurs.

Simplified subset

A number of the smaller PDP-11's (notably the PDP-11/40, PDP-11/34, PDP-11/23 and PDP-11/24) provide only a limited subset of the standard memory management facilities. In these machines, there is no support for Split I+D, and no Supervisor mode (just Kernel and User).

Also, there is no SSR1 register (below), which can make re-starting instructions which cause a fault laborious (the fault-handling code has to decipher the instruction and effectively simulate its operation, to work out which registers need to be 'backed out' to their state before the instruction started execution), and in some cases impossible (e.g. instructions which auto-increment the same register several times).

Registers

The memory management is entirely controlled by groups of registers in the CPU (unlike many virtual memory systems, which use page tables held in main memory, and cached in the CPU).

Control

There are four registers which control the overall operation of the Memory Management Unit:

Address Name Function
777572 SSR0 Control and status
777574 SSR1 Register increment/descrement record
777576 SSR2 Virtual address associated with the fault (usually the instruction address)
777516 SSR3 D-space enable/disable (per mode)

On the 'simplified subset' machines, SSR1 and SSR3 are not implemented.

SSR0 contains control bits (e.g. enabling memory management) and status bits (e.g. information about memory operations which caused a memory management fault, and the segment involved). The layout of SSR0 is:

Non-resident Length Read-only Trap Unused Enable Trap Maintenance Instruction Completed CPU Mode I/D Page Enable
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00

When any of the first three bits (all error aborts) are set, bits 1-7, as well as SSR1 and SSR2, are frozen. On the 'simplified subset' machines, bits 12, 9, 7 and 4 are not implemented.

SSR1 contains information about register modifications (given there in two's complement) performed during the course of an instruction, to allow those modifications to be 'backed out' if the instruction needs to be restarted after a memory management fault. Its layout is:

Change Register Change Register
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00

SSR2 contains the address of the instruction which caused the memory management fault.

SSR3 contains bits to enable Split I+D in the three modes; on machines which have UNIBUS maps, the enable for it is also here. Its layout is:

Unused Enable UNIBUS Map Enable 22-bit Unused Kernel Supervisor User
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00

The 'Enable 22-bit' bit only applies on machines which support larger memories, i.e. the PDP-11/70, PDP-11/44, and machines with the KDF11 CPUs and KDJ11 CPUs.

PARs and PDRs

Each segment (up to 48 in total; 8 each Instruction and Data, for the three different modes) is described by a pair of registers, a Page Descriptor Register (PDR) and a Page Address Register (PAR).

The PAR contains the base physical address for the segment (in units of 0100/64. bytes). On machines which have only UNIBUS memory (e.g. PDP-11/40, PDP-11/45, etc) these registers are 12 bits long, since the maximum amount of physical memory on these machines is 248 Kbytes. On machines which support up to 4 MBytes of physical memory (e.g. PDP-11/70, PDP-11/44, PDP-11/23, etc), they are 16 bits long.

The PDR contains the segment's length, along with the direction of growth, the access control field (read/only, read/write, etc), a 'dirty' bit (maintained by the hardware), etc. The layout of the PDR is:


Unused Length Trapped Written Unused Direction Access Control
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00

The values of the 'Access Control' field are:

Value Mode
0 Non-resident - abort all accesses
1 Read-only watched - abort on write, trap on read
2 Read-only - abort on write
3 Unused, reserved - abort all accesses
4 Read/write all watched - trap on read or write
5 Read/write watched - trap on write
6 Read/write - none
7 Unused, reserved - abort all accesses

On the 'simplified subset' machines, only modes 0, 2 and 6 are supported, and neither is the 'Trapped' bit (set on PDR's for memory references that trapped, on the other machines).

The addresses of the PAR/PDR sets are:

Address Name Function
772200 SISD0 Supervisor I-Space PDR #0
...
772216 SISD7 Supervisor I-Space PDR #7
772220 SDSD0 Supervisor D-Space PDR #0
...
772236 SDSD7 Supervisor D-Space PDR #7
772240 SISA0 Supervisor I-Space PAR #0
...
772256 SISA7 Supervisor I-Space PAR #7
772260 SDSA0 Supervisor D-Space PAR #0
...
772276 SDSA7 Supervisor D-Space PAR #7
772300 KISD0 Kernel I-Space PDR #0
...
772316 KISD7 Kernel I-Space PDR #7
772320 KDSD0 Kernel D-Space PDR #0
...
772336 KDSD7 Kernel D-Space PDR #7
772340 KISA0 Kernel I-Space PAR #0
...
772356 KISA7 Kernel I-Space PAR #7
772360 KDSA0 Kernel D-Space PAR #0
...
772376 KDSA7 Kernel D-Space PAR #7
777600 UISD0 User I-Space PDR #0
...
777616 UISD7 User I-Space PDR #7
777620 UDSD0 User D-Space PDR #0
...
777636 UDSD7 User D-Space PDR #7
777640 UISA0 User I-Space PAR #0
...
777656 UISA7 User I-Space PAR #7
777660 UDSA0 User D-Space PAR #0
...
777676 UDSA7 User D-Space PAR #7