;+ ; ; HD: boot device driver. ; ; By John Wilson. This file is hereby released into the public domain. ; ; 11/16/95 JMBW Created. ; ;- hdcs= 00 ;(777110) control/status register hdbc= 02 ;(777112) byte count register hdblk= 04 ;(777114) starting block register hdba= 06 ;(777116) bus address register hdblke= 14 ;(777124) starting block register extension hdbae= 16 ;(777126) bus address extension ; ; Bits in HDCS: ; hderr= 100000 ;error hdunit= 7000 ;unit hdrdy= 200 ;ready hdgo= 1 ;go bit ; ; Function codes in CSFUN: ; hdack= 0*2 ;medium acknowledge hdrdd= 1*2 ;read data ; .btini ;HD: init code mov bcsr,r0 ;get base CSR mov (r0),r1 ;get unit # swab r1 ;right 9 bits asr r1 bic #^C,r1 ;isolate mov r1,bunit ;save .btfin ;finish up boot process ;+ ; ; Hypothetical disk bootstrap read driver. ; ; r5 memory addr ; r4 block count ; r3 starting block ; ;- read: mov bcsr,r2 ;get CSR addr clr hdbae(r2) ;clear extension clr hdblke(r2) add #hdba,r2 ;point at bus addr mov r5,(r2) ;set it mov r3,-(r2) ;set block swab r4 ;convert block count to word count asl r4 ;byte count mov r4,-(r2) ;set byte count mov bunit,r0 ;get unit swab r0 ;starting at bit 9 asl r0 bis #hdrdd!hdgo,r0 ;cmd=read data mov r0,-(r2) 10$: bit #hderr!hdrdy,(r2) ;poll beq 10$ bmi 20$ ;error rti 20$: bpt ;HD: device does its own retries, give up ; .end boot