.title M9312 'DL' BOOT prom for RL11 controller ; This source code is an exact copy of the DEC M9312 23-751A9 boot PROM. ; ; This boot PROM is for the RL11 controller with RL01/RL02 drives. ; ; Multiple units and/or CSR addresses are supported via different entry points. ; ; Standard devices are 82S131, Am27S13, 74S571 or other compatible bipolar ; PROMs with a 512x4 TriState 16pin DIP architecture. This code resides in ; the low half of the device; the top half is blank and unused. ; ; Alternatively, 82S129 compatible 256x4 TriState 16pin DIP devices can be ; used, as the uppermost address line (hardwired low) is an active low chip ; select (and will be correctly asserted low). rlcsr =174400 ; std RL11 csrbase rlcs =+0 ; control/status rlba =+2 ; bus address rlda =+4 ; disk address rlmp =+6 ; multipurpose cmstat =2*2 ; get status cmseek =3*2 ; seek cmrdhd =4*2 ; read header cmrdda =6*2 ; read data diags =165564 ; console diags phase2 entry .asect .=173000 ; -------------------------------------------------- start: .ascii "LD" ; device code (reversed) .word last-. ; offset to next boot header dl0n: sec ; boot std csr, unit zero, no diags dl0d: mov #0,r0 ; boot std csr, unit zero, with diags dlNr: mov #rlcsr,r1 ; boot std csr, unit dlNb: mov pc,r4 ; boot csr , unit bcc diag ; br if diags requested br go ; return to (R4)+2 from diags ; then skip over pseudo reboot vector ; -------------------------------------------------- .word 173000 ; prom start addess @ 24 .word 340 ; and priority level @ 26 ; -------------------------------------------------- go: mov r0,r3 ; save unit number swab r3 ; unit number in upper byte mov r3,(r1) ; set unit, NOP cmd mov #013,rlda(r1) ; subcmd reset+getstatus bis #cmstat,r3 ; get status cmd (r3lo is 0) mov r3,(r1) ; execute 1$: tstb (r1) ; test for ready bpl 1$ ; wait clrb r3 ; unit number in upper byte bis #cmrdhd,r3 ; read header cmd mov r3,(r1) ; execute 2$: tstb (r1) ; test for ready bpl 2$ ; wait mov rlmp(r1),r2 ; retrieve cyl/head/sector bic #77,r2 ; set sector to zero inc r2 ; set head 0, seek to cyl 0 mov r2,rlda(r1) ; into da for seek clrb r3 ; unit number in upper byte bis #cmseek,r3 ; seek cmd mov r3,(r1) ; execute 3$: tstb (r1) ; test for ready bpl 3$ ; wait clr rlda(r1) ; select cyl0/head0/sector0 mov #-512.,rlmp(r1) ; set word count clrb r3 ; unit number in upper byte bis #cmrdda,r3 ; read data cmd mov r3,(r1) ; execute 4$: tstb (r1) ; test for ready bpl 4$ ; wait tst (r1) ; test for error bpl 5$ ; br if ok reset ; ERROR - reset the world jmp 2(r4) ; retry 5$: bic #377,(r1) ; execute nop cmd clr pc ; jump to bootstrap at zero ; -------------------------------------------------- diag: jmp @#diags ; jump to console diags ; -------------------------------------------------- .=start+176 crc16: .word <171540> ; CRC-16 will go here last: ; next boot prom starts here .end