Virtual Memory, Processes and Sharing in Multics
Daley, Dennis 1968
What kind of paper is this?
- Describes a system.
- No analysis.
- No commentary.
- Multics takes sharing to an extreme.
Three objectives
- Large machine-independent virtual memory.
- Relieve burden of overlays.
- Eliminate tricky application buffering.
- Eliminate explicit movement of data between different
levels of storage hierarchy.
- Independent of various devices.
- Programming generality
- Call procedures by symbolic name.
- Obviate need to know all procedures/data referenced a priori.
- Sharing
- Avoid duplication of data and text.
- Allow recompilation of a segment without recompiling anything else .
Processes
- Map one to one with address spaces
- Processes are run via traffic controller
Address space
- Composed of 214 segments.
- Each segment contains 218 36-bit words.
- Segments have own access permissions.
- Two types of segments: data and procedure.
- Procedure segments are pure (no self-modifying code).
- No execution of data segments.
- No writes into procedures; sometimes reads disallowed.
- No explicit files.
- Files are just segments arranged into a hierarchical name space.
- Names are invariant across processes.
- One or more symbolic names per segment.
Addressing
- Generalized Address consists of segment number and word
address within segment (offset).
- Addresses are location independent (i.e. can reside anywhere in
memory ).
Registers
- Descriptor base register: Used to locate a process's descriptor segment
(which is a table of locations of segments).
- Procedure base register: Contains the segment number of the procedure
being executed.
- Four base register pairs: Contain a full GA in each
- ap argument pointer
- sp stack pointer
- lp linkage pointer
- bp base pointer
- PC incremented by 1 each instruction
Address Generation
- Instruction addresses: procedure base register + program counter
- Data references: two types, external and internal
- Internal
segment = procedure base register
offset = index reg + address from instruction +
word number in specified base register (base
register specified by instruction tag).
- External
offset = index reg + address from instruction +
word number in specified base register (base
register specified by instruction tag).
segment = base register in base pair indicated
by tag
- Indirect addressing
- construct GA (generalized address)
- read 2 36-bit words from memory
- construct new GA
Address translation (i.e., GA to physical)
- Descriptor base register points to a descriptor table.
- Descriptor table is indexed by segment number.
- Entry in table contains segment access information and enough
information to locate the segment.
- Segment numbers are different across processes.
- Paging is allowed.
Intersegment linking
- Requirements
- Pure procedure segments (i.e. no modification of procedure segments)
- Call by symbolic name without any prearrangement
- Segments must be invariant to recompilation of other segments
- Upon first reference to a segment, segment is assigned a number
and entered into descriptor table: called making segment known.
- First reference: symbolic name is found in directory hierarchy.
- Enter segment in descriptor table.
- After first reference, want to use segment number addressing.
- Implementation
- Each segment requires link data: describes how to get to
data/procedure references made from within a segment.
- All link data is gathered together into a linkage section for a
process
- When a segment is made known, a copy of its link data is
added to the linkage section.
- Use indirect addressing to get from symbolic name to GA.
- First reference, try to indirect through link data: take a trap.
- Trap sets up the link data (called linking).
- Future references succeed in the indirect reference through
the link data for the currently executing segment.
- Each segment contains a symbol table to map symbolic
names in the segment to word addresses.
- The link pointer (lp) contains the GA for the beginning of the
linkage data.
- External references are relative to link pointer (i.e. where
in the link data do you look).
Subroutine calling
- Transmit arguments.
- Arrange for return of control.
- Save and restore state.
- Allocate private storage (necessary since no storage in procedure).
- Use stack in a conventional manner (create stack frames).
- When making inter-segment procedure call, must write the GAs to
the link data to insure that the link pointer is set up correctly for the
new segment. Call through the callee's linkage section; set lp;
restore it from stack on return.