why different swapping modes on executables?
John F. Woods
jfw at ksr.com
Fri Mar 15 08:43:06 AEST 1991
martin at adpplz.UUCP (Martin Golding) writes:
>In the very bad old days, PDP 11's had two ways to map memory: one
>combined the data and program in a single 64k segment, and one had
>separate (64k) data and program spaces. Given the addressing modes,
>the difference between data and program accesses were a study in themselves.
>My impression is that the (original) version of the Magic Number was
>the actual value to load into the PDP 11 MMU control register, to select
>one or the other model.
Bzzt! But thanks for playing the game!
The Original Magic Number, 0407, is a PDP-11 branch instruction, whose span
is just enough to jump around the header information. This made it easy to
build and run standalone programs -- as long as they were position independant
(piece of cake on the 11) you just load the UNIX object file into memory and
start at 0 (or whereever). This executable type contained contiguous text
and data, just like you'd want on a PDP-11/20.
The Second Original Magic Number, 0410, stood for a sharable object (data
began at an 8K page boundary, so the text could be a bunch of shared, readonly
pages), and was chosen because it was (tada!) one greater than 0407. Note
that the header was exactly the same size.
The Third Original Magic Number, 0411, stood for separate I&D; how it was
chosen is left to the reader as an exercise.
While we're on PDP-11 trivia: my favorite instruction was
mov -(r7),-(r7)
for obvious reasons.
More information about the Comp.unix.questions
mailing list