1: /*
2: * SCCS id @(#)rmboot.s 2.0 (2.11BSD) 4/13/91
3: */
4: #include "localopts.h"
5:
6: / The boot options and device are placed in the last SZFLAGS bytes
7: / at the end of core for the bootstrap.
8: ENDCORE= 160000 / end of core, mem. management off
9: SZFLAGS= 6 / size of boot flags
10: BOOTOPTS= 2 / location of options, bytes below ENDCORE
11: BOOTDEV= 4 / boot unit
12: CHECKWORD= 6
13:
14: .globl _doboot, hardboot, _bootcsr
15: .text
16: _doboot:
17: mov 4(sp),r4 / boot options
18: mov 2(sp),r3 / boot device
19:
20: #ifndef KERN_NONSEP
21: / If running separate I/D, need to turn off memory management.
22: / Call the routine unmap in low text, after setting up a jump
23: / in low data where the PC will be pointing.
24: .globl unmap
25: mov $137,*$unmap+2 / jmp *$hardboot
26: mov $hardboot,*$unmap+4
27: jmp unmap
28: / "return" from unmap will be to hardboot in data
29: .data
30: #else
31: / Reset to turn off memory management
32: reset
33: #endif
34:
35: / On power fail, hardboot is the entry point (map is already off)
36: / and the args are in r4 (RB_POWRFAIL), r3 (rootdev)
37:
38: hardboot:
39: mov r4, ENDCORE-BOOTOPTS
40: ash $-3,r3 / shift out the partition number
41: bic $!7,r3 / save only the drive number
42: mov r3, ENDCORE-BOOTDEV
43: com r4 / if CHECKWORD == ~bootopts, flags are believed
44: mov r4, ENDCORE-CHECKWORD
45: 1:
46: reset
47:
48: / The remainder of the code is dependent on the boot device.
49: / If you have a bootstrap ROM, just jump to the correct entry.
50: / Otherwise, use a BOOT opcode, if available;
51: / if necessary, read in block 0 to location 0 "by hand".
52:
53: / rm02/3/5 bootstrap - salkind@nyu
54:
55: WC = -256.
56: READ = 70
57: GO = 1
58: PRESET = 20
59: FMT22 = 10000
60: DRIVE = 0
61:
62: rmcs1 = 0
63: rmda = rmcs1+6
64: rmcs2 = rmcs1+10
65: rmds = rmcs1+12
66: rmof = rmcs1+32
67: rmca = rmcs1+34
68:
69: mov _bootcsr,r1
70: mov ENDCORE-BOOTDEV,rmcs2(r1)
71: mov $PRESET+GO,rmcs1(r1)
72: mov $FMT22,rmof(r1)
73: clr rmca(r1)
74: add $rmcs2,r1
75: mov ENDCORE-BOOTDEV,(r1)
76: clr -(r1)
77: clr -(r1)
78: mov $WC,-(r1)
79: mov $READ+GO,-(r1)
80: 1:
81: tstb (r1)
82: bge 1b
83: mov ENDCORE-BOOTDEV,r0
84: clr pc
Defined functions
_doboot
declared in line
14; defined in line
16; used 1 times
Defined variables
DRIVE
defined in line
60;
never used
FMT22
defined in line
59; used 1 times
GO
defined in line
57; used 2 times
READ
defined in line
56; used 1 times
WC
defined in line
55; used 1 times
hardboot
declared in line
14; defined in line
38; used 2 times
rmca
defined in line
67; used 1 times
rmcs1
defined in line
62; used 6 times
rmcs2
defined in line
64; used 2 times
rmda
defined in line
63;
never used
rmds
defined in line
65;
never used
rmof
defined in line
66; used 1 times