Difference between revisions of "PDP-11 Bootstrap Loader"

From Computer History Wiki
Jump to: navigation, search
(Initial coverage)
 
(Minor copyedits, +cat)
Line 1: Line 1:
The '''PDP-11 Bootstrap Loader''' is a short [[program]] designed to be loaded into [[main memory]] on a [[PDP-11]] via the [[front panel]]; it is then run to load an initial program into the machine. I.e it is a way of [[bootstrap]]ping a totally empty machine, one with no [[Read-only memory|ROM]].
+
The '''PDP-11 Bootstrap Loader''' is a short [[program]] designed to be loaded into the [[main memory]] on a [[PDP-11]] via the [[front panel]]; it is then run to load an initial program into the machine. I.e it is a way of [[bootstrap]]ping a totally empty machine, one with no [[Read-only memory|ROM]].
  
It is designed to be absolutely as short as possible (since it is manually toggled in via the [[switch register]]), and thus has limitations on how long a program can be loaded using it, and where in memory that program can be placed. The usual program to load with it is the [[PDP-11 Absolute Loader]], which relaxes both of those limitations.
+
It is designed to be absolutely as short as possible (since it is manually toggled in via the [[switch register]]), and therefore has limitations, including how long a program can be loaded using it, and where in memory that program can be placed. The usual program to load with it is the [[PDP-11 Absolute Loader]], which relaxes both of those limitations.
  
The original bootstrap loader is [[self-modifying code]], since this allows a very short program. The program is not directly self-modifying; rather, the format of its input is such that it modifies the bootstrap loader as the input is read. (Most bootstrap loader input files restore the bootstrap loader to its original condition, allowing it to be re-used.)
+
The original bootstrap loader is [[self-modifying code]], since this allows a very short program. The program is not directly self-modifying; rather, the nature of its input is such that it modifies the bootstrap loader as it is read in. (Most bootstrap loader input files eventually restore the bootstrap loader to its original condition, allowing it to be re-used.)
  
Several PDP-11 bootstrap ROMs, e.g. the [[BM792 ROM|M792-YA]], M792-YK and [[BM873 ROM]] are prepared to read programs in bootstrap loader format. The code in them is obviously not self-modifying, but reacts to the bootstrap loader format to produce the same effects.
+
Several PDP-11 bootstrap ROMs, e.g. the [[BM792 ROM|BM792-YA]], BM792-YK and [[BM873 ROM]] are prepared to read programs in bootstrap loader format. The code in them is obviously not self-modifying, but reacts to the bootstrap loader input format to produce the same effects.
  
 
==Structure==
 
==Structure==
  
The bootstrap loader contains two locations which are modified by reading the input: the first is a [[pointer]] to the [[buffer]] in which to place data being read in; the second is a [[conditional branch]] back to the beginning of the data input [[loop]].
+
The bootstrap loader contains two locations which are modified by reading the input: the first is a [[pointer]] to the [[buffer]] in which to place data being read in; the second is a [[branch]] back to the beginning of the data input [[loop]].
  
The program starts with the pointer set to itself, so the blank leader at the start of the data for the bootstrap loader (originally [[paper tape]]s) starts with a special leader code which causes this to be left un-changed.
+
The program starts with the pointer set to itself, so the blank leader at the start of the data for the bootstrap loader (originally contained on [[paper tape]]s) starts with a special leader code which causes this to be left un-changed.
  
The buffer pointer is then modified to place it immediately before the bootrap loader in memory, so at the end of the load the newly loaded code then progressively overlaps the first several [[instruction]]s of the bootstrap loader itself, finally patching the buffer pointer to point at the branch, which is then modified to jump to the newly loaded code.
+
The buffer pointer is then modified to point it immediately before the bootrap loader in memory, so at the end of the load the newly loaded code then progressively overlays the first several [[instruction]]s of the bootstrap loader itself, finally patching the buffer pointer to point at the branch instruction, which is then modified to jump to the newly loaded code.
  
 
==Bootstrap Loader format==
 
==Bootstrap Loader format==
  
The format of boostrap loader input is as follow:
+
The format of boostrap loader input is as follows:
  
 
* Leader (all bytes 0351)
 
* Leader (all bytes 0351)
Line 28: Line 28:
  
 
The Bootstrap Loader is documented in some detail in the "paper tape software programming handbook" (DEC-11-GGPB-D), pp. 6-1 to 6-8.
 
The Bootstrap Loader is documented in some detail in the "paper tape software programming handbook" (DEC-11-GGPB-D), pp. 6-1 to 6-8.
 +
 +
{{PDP-11}}
 +
 +
[[Category: PDP-11s]]

Revision as of 13:13, 13 August 2019

The PDP-11 Bootstrap Loader is a short program designed to be loaded into the main memory on a PDP-11 via the front panel; it is then run to load an initial program into the machine. I.e it is a way of bootstrapping a totally empty machine, one with no ROM.

It is designed to be absolutely as short as possible (since it is manually toggled in via the switch register), and therefore has limitations, including how long a program can be loaded using it, and where in memory that program can be placed. The usual program to load with it is the PDP-11 Absolute Loader, which relaxes both of those limitations.

The original bootstrap loader is self-modifying code, since this allows a very short program. The program is not directly self-modifying; rather, the nature of its input is such that it modifies the bootstrap loader as it is read in. (Most bootstrap loader input files eventually restore the bootstrap loader to its original condition, allowing it to be re-used.)

Several PDP-11 bootstrap ROMs, e.g. the BM792-YA, BM792-YK and BM873 ROM are prepared to read programs in bootstrap loader format. The code in them is obviously not self-modifying, but reacts to the bootstrap loader input format to produce the same effects.

Structure

The bootstrap loader contains two locations which are modified by reading the input: the first is a pointer to the buffer in which to place data being read in; the second is a branch back to the beginning of the data input loop.

The program starts with the pointer set to itself, so the blank leader at the start of the data for the bootstrap loader (originally contained on paper tapes) starts with a special leader code which causes this to be left un-changed.

The buffer pointer is then modified to point it immediately before the bootrap loader in memory, so at the end of the load the newly loaded code then progressively overlays the first several instructions of the bootstrap loader itself, finally patching the buffer pointer to point at the branch instruction, which is then modified to jump to the newly loaded code.

Bootstrap Loader format

The format of boostrap loader input is as follows:

  • Leader (all bytes 0351)
  • Load offset (1 byte)
  • Program to be loaded (up to 0344 bytes)
  • Copy of boostrap loader (first 7 bytes)
  • Branch offset (1 byte)

Further reading

The Bootstrap Loader is documented in some detail in the "paper tape software programming handbook" (DEC-11-GGPB-D), pp. 6-1 to 6-8.