* 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.
/* "@(#)upboot.s 7.1 (Berkeley) 6/5/86" */
.set MAJOR,2 /* major("/dev/up0a") */
* UP 1st level boot program: loads next 7.5Kbytes from
* boot sector of file system and sets it up to run.
* Always reads from drive 0.
.set BOOTSIZE,15 /* size of boot in sectors */
.set UPBPSECT,512 /* bytes per sector */
.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 */
/* UP registers and bits */
.set UP_cs1,0 /* control and status */
.set UP_wc,2 /* word count */
.set UP_ba,4 /* bus address */
.set UP_da,6 /* disk address */
.set UP_cs2,010 /* cs2 register */
.set UP_of,032 /* offset register */
.set UP_dc,034 /* desired cylinder */
.set UP_hr,036 /* holding register */
.set UP_GO,1 /* go bit */
.set UP_PACK,022 /* pack acknowledge */
.set UP_DCLR,010 /* drive clear */
.set UP_PRESET,020 /* read-in-preset */
.set UP_RCOM,070 /* read command */
.set UP_pRDY,7 /* position of ready bit */
.set UP_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 */
movl $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 physUBA[r9],r9 /* UNIBUS adaptor address */
movl r2,r8 /* boot device CSR */
movl r3,r7 /* unit number */
movl r9,r1 /* UNIBUS I/O page address */
movl r8,r2 /* boot device CSR */
movl r7,r3 /* unit number */
/* init up, set vv in drive; if any errors, give up */
bisw3 r7,$UPCS2_CLR,UP_cs2(r8)
movw $UP_DCLR+UP_GO,UP_cs1(r8)
movw $UP_PRESET+UP_GO,UP_cs1(r8)
/* relocate to high core */
movl r5,r11 /* boot flags */
/* now running relocated */
.set PROGSIZE,(BOOTSIZE*UPBPSECT)
movw $-PROGSIZE/2,UP_wc(r8)
bisl3 $0x80000000,r0,UBA_MAP(r9)
movw $UP_RCOM+UP_GO,UP_cs1(r8)
.long 0xf30000 /* uba0 */
.long 0xf32000 /* uba1 */