* Copyright (c) 1980, 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
/* "@(#)rlboot.c 7.3 (Berkeley) %G%" */
#include <sys/disklabel.h>
.set MAJOR
,14 /* major("/dev/rl0a") */
* RL02 1st level boot program: loads next 7.5Kbytes from
* boot sector of file system and sets it up to run.
.set BOOTSIZE
,15 /* 15 ``sectors'' */
.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 */
/* RL11 registers and bits */
.set HL
,0174400-0160000 /* address of RL11 */
.set HLBPSECT
,512 /* sector size in bytes (kludge) */
.set HL_cs
,HL
+0 /* control and status */
.set HL_ba
,HL
+2 /* bus address */
.set HL_da
,HL
+4 /* disk address */
.set HL_wc
,HL
+6 /* word count */
.set HL_RDY
,0200 /* READY */
.set HL_RCOM
,014 /* read command */
.set HL_SEEK
,06 /* seek */
.set HL_RESET
,013 /* reset drive */
.set HL_GSTAT
,04 /* get status command */
.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 */
cvtbl $MAJOR
,r10
/* major("/dev/xx0a") */
extzv $
18,$
1,r1
,r9
/* get UBA number from R1 */
xorb2 $
0x01,r9
/* complement bit */
insv r9
,$
24,$
8,r10
/* set UBA number */
insv r3
,$
16,$
8,r10
/* drive number */
extzv $
12,$
4,r5
,r4
/* get partition from r5 */
bicw2 $
0xf000,r5
/* remove from r5 */
insv r4
,$
8,$
8,r10
/* set partition */
movl r5
,r11
/* boot flags */
movl r2
,r8
/* boot device CSR */
* Leave space for pack label.
.space LABELOFFSET
- (pad
- init
)
movl physUBA
[r9
],r9
/* UNIBUS adaptor address */
ashl $
8,r3
,r7
/* unit number, shifted for HL_cs */
/* init rl11, and drive, don't check for any errors now */
bisw3 r7
,$HL_GSTAT
,HL_cs(r8
)
/* relocate to high core */
/* now running relocated */
/* read in the boot program */
.set PROGSIZE
,(BOOTSIZE
*HLBPSECT
)
movw $
1,HL_da(r8
) /* seek to cylinder 0 */
bisw3 r7
,$HL_SEEK
,HL_cs(r8
)
/* Rl has 256 byte sectors */
movw $
2,HL_da(r8
) /* read program */
movw $
-PROGSIZE
/2,HL_wc(r8
)
bisl3 $
0x80000000,r0
,UBA_MAP(r9
)
bisw3 r7
,$HL_RCOM
,HL_cs(r8
)
.long 0xf30000 /* uba0 */
.long 0xf32000 /* uba1 */