lint should get param.c
[unix-history] / usr / src / sys / vax / mdec / raboot.c
CommitLineData
b1078c35
KM
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
c7a945fd 7/* "@(#)raboot.c 6.3 (Berkeley) %G%" */
9495fedd
SL
8
9/*
2e6422fd
SL
10 * UDA50 1st level boot program: loads next 7.5Kbytes from
11 * boot sector of file system and sets it up to run.
9495fedd 12 */
2e6422fd 13 .set RELOC,0x50000
006cccbe 14 .set BOOTLAST,15 /* last boot sector */
2e6422fd 15 .set RABPSECT,512 /* bytes per sector */
9495fedd
SL
16
17init:
2e6422fd
SL
18 .word 0 /* entry mask for dec monitor */
19 nop;nop;nop;nop;nop;nop;nop;nop /* some no-ops for 750 boot to skip */
20 nop;nop;
9495fedd 21start:
006cccbe
SL
22 movl r1,r7 /* UNIBUS I/O page address */
23 movl r2,r8 /* boot device CSR */
24 movl r3,r9 /* unit number */
2e6422fd
SL
25 movl r5,r11 /* boot flags */
26 movl $RELOC,sp
006cccbe
SL
27 moval init,r10
28 movc3 $end,(r10),(sp)
29 movl r7,r1 /* UNIBUS I/O page address */
30 movl r8,r2 /* boot device CSR */
31 movl r9,r3 /* unit number */
2e6422fd
SL
32 jmp *$RELOC+start2
33/* now running relocated */
34/* bring in the boot program */
9495fedd 35start2: /* running relocated */
006cccbe
SL
36 pushr $0xffff /* BEGIN FIREWALL */
37 movl $1,r4 /* first boot sector */
2e6422fd 38 clrl r5 /* transfer address */
006cccbe 39 clrl -(sp) /* transfer address */
9495fedd 401:
006cccbe
SL
41 movl r4,r8 /* requested sector # */
42 jsb (r6) /* call ROM-based driver */
2e6422fd
SL
43 blbs r0,2f
44 halt /* read error */
9495fedd 452:
006cccbe
SL
46 addl2 $RABPSECT,r5 /* bump address */
47 movl r5,(sp)
48 aobleq $BOOTLAST,r4,1b
9495fedd 49
006cccbe 50 .set PROGSIZE,((BOOTLAST-1)*RABPSECT)
2e6422fd 51done:
006cccbe
SL
52 tstl (sp)+ /* pop address */
53 popr $0xffff /* END FIREWALL */
2e6422fd
SL
54 movl $PROGSIZE,r3
55clrcor:
56 clrq (r3)
57 acbl $RELOC,$8,r3,clrcor
58/* start loaded program */
59 movl $9,r10 /* major("/dev/ra0a") */
60 calls $0,*$0
61 brw start2
9495fedd 62end: