Bootstrapping
I created a boot device simulation and hooked it into the main circuit.
To support booting, I added a PIBD value (boot device to PIB) for the
IOSEL field, a CLRPC (clear program counter) operation and a
BDSTA (boot device start) I/O signal.
I also changed the sense of the BDRUN input and renamed it to BDFIN
(boot device finished), because it turned out I wanted to branch the
other way on it in the microcode.
Changes to main circuit
Boot Device Simulator
The boot device simulator is very similar to the paper tape simulator,
with the addition of a flip flop to keep track of whether the boot
device is running. The memory is 18 bits wide; 17 of them are
used for boot data, and one is used to flag the last word of the data.
Boot Timing
Boot Microcode
The boot sequence is entered when the Start button on the front panel
is pressed. It first clears the PC, starts the boot device and then
enters a loop reading words from the boot device and writing them to
memory. Along with reading each word, BDFIN is tested; when it is true,
the PC is cleared again and execution of the program begins.
# MISC values
CLRPC = 0011 # Clear PC
# PISEL values
PIBD = 01 # Boot device data to PIB
# IOSEL values for IOSIG
BDSTA = 00 # Start boot device
BDACK = 11 # Acknowledge boot device input
# IOSEL values for IOTST
BDFIN = 00 # Boot device is finished
BDRDY = 11 # Data available from boot device
# Boot
1 00010 0 0000 : - - -- --- - -- - - -- - - - - - - CLRPC - --- ---- # Clear PC
1 00010 0 0001 : - - -- --- - -- - - -- - - - - - - IOSIG - --- BDSTA -- # Start boot device
1 00010 0 0010 : - - -- --- - -- - - -- - - - - - - IOTST - --- BDRDY -- # Test for boot data
1 00010 0 0011 : - - -- --- - -- - - -- - - - - - - ---- - BNIOT 0100 # Loop until ready
1 00010 0 0100 : - - -- --- - -- - - -- - - - - - - PLS - --- PIBD -- # Load boot data into S
1 00010 0 0101 : SHS - -- XSR - -- - WMEM -- - - - - - - MAPC - --- ---- # Write S to memory at PC
1 00010 0 0110 : - - -- --- - -- - - -- - - - - - - IOTST - --- BDFIN -- # Test for boot finished
1 00010 0 0111 : - - -- --- - -- - - -- - - - - - - IOSIG - --- BDACK -- # Ack boot data
1 00010 0 1000 : - - -- --- - -- - - -- - - - - - - INCPC - BNIOT 0100 # Inc PC and loop if boot not finished
1 00010 0 1001 : - EOI -- --- - -- - - -- - - - - - - CLRPC - --- ---- # Clear PC and enter program