/* rlboot.c 4.1 83/02/16 */
* RL02 disk boot program to load "/boot" from
* a UNIX filesystem (starting at block 1 on pack on
* drive 0) into low core and to execute that file.
* This program can only read regular small 1k byte (3bsd+) files
* from the root of a UNIX filesystem.
* Hacked from a rk07 boot by Hank Trapnell, IMS.
* /sys/mdec/hlboot.s 4.1 82/12/17
.set BLKSIZ
,1024 /* file system block size */
.set BPSECT
,256 /* size of sector in bytes */
.set INOSIZ
,64 /* no. bytes/inode entry */
.set INOBLK
,BLKSIZ
/INOSIZ
/* no. inodes/disc block */
.set INOMSK
,0xfffffff0 /* changes with inode size */
.set NAMSIZ
,14 /* bytes in directory name */
.set ENTADR
,024 /* offset to entry addr in a.out */
.set DIRSIZ
,16 /* size of directory entry, bytes */
.set ROOTINO
,2 /* root dir inode no. */
.set NBOO
,1 /* no. of boot blocks */
.set NSUP
,1 /* no. of superblocks */
.set SID
,62 /* system ID register */
.set UBA_CNFGR
,0 /* UBA configuration register */
.set UBA_CR
,4 /* UBA control register offset */
.set UBA_MAP
,0x800 /* UBA offset to map reg's */
.set UBAinit
,1 /* UBA init bit in UBA control reg */
.set pUBIC
,16 /* Unibus init complete */
/* RL11 registers and bits */
.set HL
,0174400-0160000 /* address of RL11 */
.set HL_cs
,HL
+0 /* control and status */
.set HL_ba
,HL
+2 /* bus address */
.set HL_da
,HL
+4 /* disk address */
.set HL_mp
,HL
+6 /* word count */
.set HLSECT
,40 /* sectors per track */
.set HLTRAC
,2 /* tracks per cylinder */
.set HL_GO
,0 /* go bit */
.set HL_RCOM
,014 /* read command */
.set HL_SEEK
,06 /* seek */
.set HL_GSTAT
,04 /* get status command */
.set HL_RHDR
,010 /* read header */
.set HL_RESET
,013 /* reset drive */
.set HL_HS
,020 /* head select */
.set HL_DIR
,04 /* seek direction */
.set HL_pRDY
,7 /* position of ready bit */
.set HL_pERR
,15 /* position of error bit */
.word
0 /* entry mask for dec monitor */
nop
;nop
;nop
;nop
;nop
;nop
;nop
;nop
/* some no-ops for 750 boot to skip */
/* get cpu type and find the first uba */
extzv $
24,$
8,r0
,r0
/* get cpu type */
movab physUBA
,r2
/* get physUBA[cpu] */
movab physUMEM
,r2
/* get physUMEM[cpu] */
bbc $pUBIC
,UBA_CNFGR(r9
),1b
/* init rl11, and drive 0, don't check for any errors now */
movw $HL_RESET
,HL_da(r10
)
movw $HL_GSTAT
+HL_GO
,HL_cs(r10
)
/* relocate to high core */
movl r5
,r11
/* boot flags */
/* now running relocated */
/* search for ``boot'' in root inode */
clrw
*$bno
/* start with first block in inode */
beql getfil
/* found correct inode! */
bsbw rmblk
/* read inode from block now in memory */
acbl $buf
+BLKSIZ
-1,$DIRSIZ
,r7
,nxtent
/* found inode for desired file... read it in */
movl $
8,r10
/* major("/dev/hl0a") */
/* iget: get inode block whose # is in r0 */
addl3 $
(INOBLK
*(NBOO
+NSUP
))-1,r0
,r8
movc3 $time
-inode
,(r8
),*$inode
/* rmblk: read in bno into addr */
/* this boot assumes only small files (<=10k bytes, ie. no indirect blocks) */
/* rblk: read disk block whose number is in r4 */
movzbw $HL_RHDR
+HL_GO
,HL_cs(r10
)
extzv $
7,$
9,r0
,r3
/* get current cylinder */
ediv $HLST
,r4
,r0
,r1
/* get desired cylinder */
bisl2 $HL_DIR
,r5
/* move towards the spindle */
movw $HL_SEEK
+HL_GO
,HL_cs(r10
)
bisl3 $
0x80000000,r0
,UBA_MAP(r9
)
bisl3 $
0x80000000,r0
,UBA_MAP
+4(r9
)
movw $
-BLKSIZ
/2,HL_mp(r10
)
movw $HL_RCOM
+HL_GO
,HL_cs(r10
)
hlwait
: /* wait for controller ready */
names
: .byte
'b,'o
,'o,'t
,0,0,0,0,0,0,0,0,0,0
.long 0x20006000 /* 11/780 */
.long 0xf30000 /* 11/750 */
.long 0xf26000 /* 11/7ZZ */
.long 0x2013e000 /* 11/780 */
.long 0xffe000 /* 11/750 */
.long 0xffe000 /* 11/7ZZ */