Subject: TC01/08 short bootstraps.

From: [email-masked] (Charles Lasner)
Date: Thu, 15 Apr 1993 17:31:45 GMT

Since there is renewed interest in DECtapes, I thought I would post the
various techniques to manually boot the TC01/08 system.  Many of these
peripherals wind up on pre-8/e machines where it's difficult to get an
auto-loader, so manual booting should be as "painless" as possible.

The easist way to get the machine booted to is to use P?S/8 or possibly
OS/8.  (OS/8 isn't necessarily compatible with the standard bootstrap, nor
are systems such as the Disk Monitor System.  There was a change in the 
OS/8 DECtape system handler to make it compatible with the "official" version
of the bootstrap that DEC distributed in the 32 word MI8E 8/e bootstrap card.)

Here's a walkthrough of how it's done:

Regardless of the code used to do it, the purpose is to get the contents of
DECtape block 0000 into memory starting at 007600.  Some systems (such as
P?S/8) support waiting at the semi-standard address of 007617 to eventually
get overlayed by the data that comes in over it through the DMA facility
(data break aka cycle stealing) and then what code has just been loaded
takes over.  Essentially what this means is that 007617 can contain something
like a JMP . that eventually gets overlayed with a JMP .-something to a routine
loaded a few microseconds ago.  Then that routine waits for the entire DMA
operation to finish, etc. and the system is essentially up after jumping to
the main routine start, etc.

In any case, all relevant DECtape systems support an alternative method, 
which is to do the same read via DMA, but from an external vantage point.
After the code is loaded, start it at 007600.  The code loaded there will
be able to accomplish whatever is necessary to continue the boot process.

To accomplish the latter, here's a typical example:

	*600			/PUT HERE TO SAVE A SWITCH REGISTER STEP

	LAS			/LOAD AC FROM SWITCHES
	6766			/DTLA; LOAD THE HARDWARE WITH THE COMMAND
	JMP	.		/WAIT FOR IT

	*7754			/WORD COUNT AND CURRENT ADDRESS AREA

	7600-1			/ANY REASONABLE NUMBER WOULD WORK
	7600-1			/THIS HAS TO BE 7577, SO WE MIGHT AS WELL
				/MAKE BOTH OF THEM THE SAME TO SAVE STEPS

Note that ALL boot versions demand that 7754 and 7755 be set to these values
namely that 7754 be between 0000 and 7600, not more, and that 7755 be set to
7577.

To use this particular one, set the switches to 0600, and start the program
there.  The switches are set to 0600, so this commands the controller to
rewind the tape on drive zero into the end zone.  The END ERROR automatically
terminates the rewind.  You just wait until the tape stops and appears to
be in the end zone.  If you have a status panel, it will indicate an END
ERROR.  Any other problem means it didn't work, so do it again.

Alternately, you can just "know" the tape is in the end zone my winding it
an appropriate amount, no more.  Exact position is unimportant, since there's
about 6 feet or more of end zone.

Then you stop the machine and start it at 0600 again, after first changing
the switches to 0220.  This is the command to read forward.  Since we are
at the end zone, this is implicitly for block 0000.  All of the end zone is
ignored, and the read starts automatically on the data; searching for it is
not required; it will wait until the mark code for DATA appears, etc.

Eventually, the tape will stop with a TIMING ERROR which is normal.  This is
because the little program is not attempting to do anything about the done
condition after the read completes.  However, the deed is done; the data is
now in 007600 and you just stop and start there.  The code just read in knows
what to do to continue the boot process, etc.

For P?S/8, POLY BASIC, MS/8, DECtape Library System, and possibly some newer
versions of OS/8 (certainly using my handler I wrote myself :-)) there is
a further simplification:

Moving the code to 007615 requires only one additional step: that the switches
have to be set to 0600 (if necessary) and later 0220.  All else is the same.
In this case, the handler is designed to wait at 007617 already, so it treats
the boot process as if it had started it all by itself, such as from 007600
had it already been read in previously.  The code at 007617 is a JMP .-some
to a wait routine that is normally in something like 007612-007616 or so.
That wait loop then does the appropriate thing to continue the boot process.

The reason all of these methods work is that certain words are preloaded
with "magic" values to cause the correct action.  For example, the words
that load over 7754 and 7755 have the proper values they should be in the
midst of the DMA, thus 7754 gets "corrected" as the DMA progresses, and
7755 is maintained.  (It is set to 7755 when it gets the DMA cycle since
that's the value it ought to be at that instant.  Thus, effectively the
DMA is "transparent" to the two locations.

P?S/8 takes the process one step further:  The subroutine headers are
preloaded to appear to be a boot started from a mythical subroutine call
to request an overlay of the handler code over itself called from within the
handler itself.  The appropriate variables are preloaded with the appropriate
values to "fake" this as well.  The contents of 7754 are set to a value that
causes overlay to continue for the rest of the bootstrap portion of the
system, etc.  The net effect of all of this is that unlike the other systems,
P?S/8 boots up without turning the tape around.  When OS/8 or whatever is
booted, the tape has to do a tape rock(s) to get multiple portions of the
O/S in, etc.

It's real cute using P?S/8 and the short bootstrap:

	*7615			/OVER WAIT ROUTINE

	7604			/READ SWITCHES
	6766			/DTLA TO LOAD THE REGISTER WITH THE COMMAND
	5217			/JMP . TO WAIT FOR DMA

	*7754			/OVER WC AND CA

	7577			/A GOOD NUMBER; SAME AS FOLLOWING
	7577			/MUST BE ONE LESS THAN 7600

Just mount the tape, give only a few turns to ensure being in the end zone.
Load adress 7615, change switches to 0220 and start it up.  The tape moves
forward and it just comes up :-).

At that point, you can run a booting program to any desired additional
software, etc.

BTW, P?S/8 supports booting to ANY TC01/08 unit, not just 0 as the rest of
the systems do.  (I believe there was a typeset-8 system convention of a
boot to unit 4.)

cj "Have boot, will travel" l