* 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.
/* "@(#)hpboot.c 7.1 (Berkeley) %G%" */
#define PARTITION /* Partition is in bits 12 to 15 of R5
* RP??/RM?? 1st level boot program: loads next 7.5Kbytes from
* boot sectors of file system and sets it up to run.
* Reads from the controller and drive passed in from the boot
* R1: address of the boot device's adapter
* R2: controller number of the boot device
* R3: unit number of the boot device
* R5: software boot control flags
* R6: address of driver subroutine from ROM
* SP: base address of usable memory + 0x200
.set BOOTSIZE
,15 /* size of boot in sectors */
.set M_cr
,4 /* MBA control reg */
.set M_sr
,8 /* MBA status reg */
.set M_var
,12 /* MBA virt addr reg */
.set M_bc
,16 /* MBA byte count reg */
.set M_map
,0x800 /* start of MBA map reg's */
.set MBAinit
,1 /* MBA init bit in MBA control reg */
.set MBABUSY
,0x80000000 /* MBA SR: data transfer busy */
.set pMBABUSY
,31 /* bit position of MBABUSY */
.set RP
,0x400 /* start of drive registers */
.set RPDR
,0x80 /* offset per drive unit */
.set RP_cr
,0 /* control status register */
.set RP_sr
,4 /* drive status reg */
.set RP_stk
,0x14 /* desired track/sector reg */
.set RP_dt
,0x18 /* drive type reg */
.set RP_off
,0x24 /* RP offset reg */
.set RP_cyl
,0x28 /* desired cyl reg */
.set RPBPSECT
,512 /* bytes per sector */
/* RP?? function codes, status bits */
.set RP_RED
,070 /* read */
.set RP_DC
,010 /* drive clear */
.set RP_RIP
,020 /* read in preset */
.set RP_FMT
,0x1000 /* format 22 */
.set RP_MOL
,0x1000 /* medium on line */
.set RP_DRY
,0200 /* drive ready */
.set RP_ERR
,040000 /* composite error */
.set RP_pDRY
,7 /* bit position of RP_DRY */
.set RP_pERR
,14 /* bit position of RP_ERR */
.word
0 /* entry mask for DEC monitor */
nop
;nop
;nop
;nop
;nop
;nop
;nop
;nop
/* some no-ops for 750 boot to skip */
clrl r10
/* major("/dev/hp0a") */
extzv $
13,$
2,r1
,r4
/* get MBA number from R1 */
insv r4
,$
24,$
8,r10
/* set MBA 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,$
4,r10
/* set partition */
movl r1
,r9
/* save adaptor address */
movl r3
,r8
/* and unit number */
/* read-in-preset the drive and set format */
movl $RP_RIP
+RP_GO
,RP_cr(r8
)
.set PROGSIZE
,(BOOTSIZE
*RPBPSECT
)
/* set up MASSBUS map for DMA */
bisl3 $
0x80000000,r0
,M_map(r9
)[r0
]
movl $RP_RED
+RP_GO
,RP_cr(r8
)
bbs $pMBABUSY
,M_sr(r9
),rprdy2
/* Eagles are too fast for the controller. Slow the thing down. */
/* (May not be needed with wait for mba above.) */
buzz
: acbl $
2000,$
1,r3
,buzz
/* clear core and execute program */