MORE ON SPEEDING UP 730 BOOTSTRAP

by Alex Wong
Automated Systems Pty Ltd
DECUS Pageswapper, Nov 1984


In the July 1984 issue of PAGESWAPPER, Bob Wilson of General Electric presented an article on how to reduce 730 bootstrap time by optimising file layout on the TU58. Essentially, all the required bootstrap files are written to the TU58 in the order in which they will be read each time the system is turned on. This cuts down the time the TU58 will spend searching for them if they are all over the tape. In addition to his methods, this article will describe the following ideas to shave more seconds off the total boot time at the loss of some flexibility.

  1. Instead of going through 3 command procedures POWER.CMD, CODE0n.CMD and DEFBOO.CMD, put everything into 1 command procedure, POWER.CMD.

  2. Use a program (GETVMB) to read in VMB.EXE from the system disk rather than the snail-like TU58. The system disk must be WRITEBOOTed so that the program will be able to locate VMB on it.
With these 2 techniques, I reduced the Microcode+Console boot time by 30 seconds from Bob's 2:38 to 2:08. However, life wasn't meant to be simple. Since everything is in POWER.CMD, you have to go through the entire bootstrap without stopping for a conversational boot or boot from the RL02, etc. It's likely that 90% of the time, you'll be only interested in booting up from the system disk anyway.

Second catch: GETVMB is written to grab VMB from the RB80 drive using the RB730 (IDC) controller. For those with only RL02s it is not that difficult to modify GETVMB to suit the drive. The main change would be the logical-to-physical disk address mapping. In the following steps, I'll only outline the major steps required to create a fast boot TU58. Refer to Bob's article for more background information and the necessary preparations.

  1. CONSCOPY all bootstrap files to disk

    Invoke the utility CONSCOPY to copy console TU58 to disk.
        $ CREATE/DIR DQA0:[CON]
        $ @SYS$UPDATE:CONSCOPY
        730
        SAVE
        DQA0:[CON]
        CSA2:
    
  2. Make a souped-up version of POWER.CMD

    Look at your console listing for the names of files involved in the bootstrap but ignore any command procedures eg. CODE01.CMD, etc. Use the editor to create a file called POWER.RNO that looks something like this:
        .BR;L/C CONSLE.CPU
        .BR;L/C/S:0800 MMIE.CPU
        .BR;L/C/S:0E00 POWER.CPU
        .BR;S/C 0B
        .BR;W
        .BR;L/C/S:0E00 FP.CPU
        .BR;L/C/S:1A00 BITFLD.CPU
        .BR;L/C/S:1D00 CM.CPU
        .BR;L/C/S:2200 BASIC.CPU
        .BR;L/C/S:3B00 QUEUE.CPU
        .BR;L/C/S:4000 IDC.CPU
        .BR;I
        .BR;L/P/S:0 GETVMB.EXE
        .BR;S 0
    
    Since the bootstrap command procedures are in RT-11 STREAM format where the record terminator is a CRLF, feed this file through RUNOFF to obtain such an attribute.

    $ RUNOFF/OUTPUT=POWER.CMD POWER.RNO

    Use the editor to remove any redundant newlines in the output file produced by RUNOFF.

  3. Mark the disk as a bootable system disk

    The VMS utility WRITEBOOT copies a program called BOOTBLOCK.EXE into the boot block (LBN 0) of a disk. It also writes the size of VMB, the logical block number of VMB on disk and the transfer address for VMB in memory into the first 3 longwords of that block.

        $ MCR WRITEBOOT
        DQA0:[SYS0.SYSEXE]VMB.EXE
        1
        200
    
  4. Write GETVMB which will read VMB from disk

    GETVMB works in a similar fashion to the booting of a VAX 11/750. The boot ROM in a 750 contains a skeleton device driver which enables the boot block to be brought into memory and executed. This program then locates VMB on disk from the data in the first 3 longwords of the boot block. GETVMB is a quick and dirty software version of an RB80 boot ROM for the 730.

    NOTE: GETVMB does not seem to work if you want to use it to reboot immediately after a shutdown. Use DEFBOO.CMD for that.
               .TITLE  GETVMB
               .IDENT  /V01/
        ;
        ; BOOTSTRAP PROGRAM TO READ THE BOOT BLOCK (LBN0)
        ; ON THE RB80 DRIVE ON A VAX 11/730 AND THEN GRAB
        ; THE REST OF VMB.EXE OFF THE DISK.
        ;
        ; AUTHOR:      ALEX WONG, TECHNICAL SPECIALIST
        ;              AUTOMATED SYSTEMS LTD, SINGAPORE.
        ; DATE:        12-OCT-1984     VAX/VMS V3.6
        ;
               MOVL    #^XF26200,R7            ; R7=IDC CSR
               MNEGL   #1,^X1C(R7)             ; INIT IDC
               BSBW    READY                   ; DRIVE ASLEEP ?
        ;
        ; READ BOOT BLOCK
        ;
               MOVL    #0,R0                   ; LBN OF BOOTBLOCK
               MOVL    #^X400,R2               ; XFER ADDRESS
               MOVL    #12,R3                  ; XFER SIZE IN BYTES
               BSBB    READ                    ; LET'S DO IT
        ;
        ; GET LBN OF VMB, XFER ADDRESS AND XFER SIZE.
        ;
               ROTL    #-16,@#^X404,R0         ; SWAP WORDS, R0=LBN
               MOVL    @#^X408,R2              ; XFER ADDRESS
               MOVL    R2,R9                   ; SAVE UP XFER ADDR
               MULL3   @#^X400,#512,R3         ; XFER SIZE IN BYTES
               BSBB    READ                    ; HIT IT
        ;
        ; VMB LOADED, NOW SET UP R0-R5 AS IN DEFBOO.CMD
        ;
               MOVL    #^X00A80003,R0
               MOVL    #3,R1
               MOVL    #^X3FB86,R2
               MOVL    #0,R3
               MOVL    #0,R4
               MOVL    #0,R5
               JMP     (R9)                    ; AWAY WE GO !
        ;
        ; CONVERT LBN TO DISK ADDRESS, SEEK TO CYLINDER
        ; AND THEN READ BLOCK OFF DISK INTO MEMORY.
        ; INPUT:       R0      LBN
        ;              R2      TRANSFER ADDRESS
        ;              R3      TRANSFER SIZE IN BYTES
        ;
        READ:  CLRL    R1                      ; HI WORD OF DIVIDEND
               CLRL    R5                      ; HI WORD OF DIVIDEND
               EDIV    #31*14,R0,R11,R4        ; R11=CYLINDER
               EDIV    #31,R4,R4,R6            ; R4=TRACK,R6=SECTOR
               SUBL3   R6,#31,R5               ; R5=SECTORS LEFT
               MULL    #512,R5                 ; R5=BYTES LEFT
               CMPL    R3,R5                   ; MORE XFERS ?
               BGTRU   20$                     ; BRANCH IF YES
               MOVL    R3,R5                   ; FINAL XFER COUNT
        20$:   INSV    R11,#16,#16,R6          ; HI WORD=CYLINDER
               INSV    R4,#8,#8,R6             ; 2ND BYTE=TRACK
        ;
        ; "...SEEK AND YE SHALL FIND"
        ;
               MOVL    #^X86,(R7)              ; LOAD FUNC, NO EXEC
               MOVL    R6,12(R7)               ; LOAD DISK ADDR REG
               MOVL    #6,(R7)                 ; GO
               BSBB    READY                   ; SIT ON IT
        ;
        ; NOW SUCK THE BITS OFF THE MAGNET.
        ;
               MOVL    #^X8C,(R7)              ; LOAD FUNC, NO EXEC
               MNEGL   R5,8(R7)                ; NEG XFER BYTE COUNT
               MOVL    R2,4(R7)                ; XFER ADDRESS (BAR)
               MOVL    R6,12(R7)               ; DISK ADDRESS (DAR)
               MOVL    #12,(R7)                ; TURN IT ON
               BSBB    READY                   ; COFFEE BREAK HERE
               MOVL    4(R7),R2                ; UPDATE XFER ADDR
               ADDL    8(R7),R5                ; GET ACTUAL BYTES XFER
               SUBL    R5,R3                   ; GET BYTES LEFT TO XFER
               ASHL    #-9,R5,R10              ; CONVERT TO BLOCK COUNT
               ADDL    R10,R0                  ; UPDATE LBN
               TSTL    R3                      ; MORE TO XFER ?
               BGTRU   READ                    ; BRANCH IF YES
               RSB
        ;
        ; WAIT FOR CONTROLLER AND DRIVE READY
        ;
        READY: MOVL    (R7),R10
               BBC     #7,R10,READY            ; LOOP UNTIL CRDY
               BBC     #0,R10,READY            ; LOOP UNTIL DRDY
               RSB                             ; DONE, PHEW !
               .END
    
    Compile and link the above program as follows:
        $ MACRO GETVMB
        $ LINK/SYSTEM=0 GETVMB
    
  5. Copy bootstrap files with FLX

    Use FLX to copy the files into a scratch TU58 in the order defined by your new POWER.CMD. On our system, the following files were added:
        $ MCR FLX
        CS1:/IM/RT=CONSOL.EXE/IM/RS
        CS1:/IM/RT=POWER.CMD/IM/RS
        CS1:/IM/RT=CONSLE.CPU/IM/RS
        CS1:/IM/RT=MMIE.CPU/IM/RS
        CS1:/IM/RT=POWER.CPU/IM/RS
        CS1:/IM/RT=FP.CPU/IM/RS
        CS1:/IM/RT=BITFLD.CPU/IM/RS
        CS1:/IM/RT=CM.CPU/IM/RS
        CS1:/IM/RT=BASIC.CPU/IM/RS
        CS1:/IM/RT=QUEUE.CPU/IM/RS
        CS1:/IM/RT=IDC.CPU/IM/RS
        CS1:/IM/RT=GETVMB.EXE/IM/RS            !  FAST BOOT PROGRAM
        CS1:/IM/RT=DEFBOO.CMD/IM/RS
        CS1:/IM/RT=VMB.EXE/IM/RS
        CS1:/IM/RT=DQ1BOO.CMD/IM/RS
    
    I have also retained all console tape capabilities by adding the rest of the boot files for different devices at the back of these frequently used ones.
It would also save time if the ANALYZE/CRASH command that people normally include in the SYSTARTUP.COM is done in a batch job. For references, look at the microfiche for VMB and DQBTDRIVER. The VAX/VMS Internals and Data Structures (1984) manual is also useful to some extent. The IDC is one of the grey areas in VMS. There is practically no documentation on it, unlike most device controllers. But once you work out the CSR address (F26200 hex), the rest is like falling off a bike.