1: /*
2: * SCCS id @(#)boot.s 1.2 (Berkeley) 9/6/82
3: */
4: #include "whoami.h"
5:
6: #ifdef UCB_AUTOBOOT
7: / The boot options and device are placed in the last SZFLAGS bytes
8: / at the end of core for the bootstrap.
9: ENDCORE= 160000 / end of core, mem. management off
10: SZFLAGS= 6 / size of boot flags
11: BOOTOPTS= 2 / location of options, bytes below ENDCORE
12: BOOTDEV= 4
13: CHECKWORD= 6
14:
15: reset= 5
16:
17: .globl _doboot, hardboot
18: .text
19: _doboot:
20: mov 4(sp),r4 / boot options
21: mov 2(sp),r3 / boot device
22:
23: #ifndef KERN_NONSEP
24: / If running separate I/D, need to turn off memory management.
25: / Call the routine unmap in low text, after setting up a jump
26: / in low data where the PC will be pointing.
27: .globl unmap
28: mov $137,*$unmap+2 / jmp *$hardboot
29: mov $hardboot,*$unmap+4
30: jmp unmap
31: / "return" from unmap will be to hardboot in data
32: .data
33: #else
34: / Reset to turn off memory management
35: reset
36: #endif
37:
38: / On power fail, hardboot is the entry point (map is already off)
39: / and the args are in r4, r3.
40:
41: hardboot:
42: mov r4, ENDCORE-BOOTOPTS
43: mov r3, ENDCORE-BOOTDEV
44: com r4 / if CHECKWORD == ~bootopts, flags are believed
45: mov r4, ENDCORE-CHECKWORD
46: 1:
47: reset
48:
49: / The remainder of the code is dependent on the boot device.
50: / If you have a bootstrap ROM, just jump to the correct entry.
51: / Otherwise, use a BOOT opcode, if available;
52: / if necessary, read in block 0 to location 0 "by hand".
53:
54: / rk06/07 disk driver
55:
56: RK07 = 1 / 0 for RK06
57: WC = -256.
58:
59: hkcs1 = 177440 / control & status 1
60: hkda = 177446 / desired track/sector address
61: hkcs2 = 177450 / control & status 2
62: hkca = 177460 / desired cylinder
63:
64: .if RK07
65: / RK07 constants
66: ack = 02003 / pack acknowledge
67: clear = 040 / subsystem clear
68: iocom = 2021 / read + go
69: .endif
70:
71: .if RK07-1
72: / RK06 constants.
73: ack = 03 / pack acknowledge
74: clear = 040 / subsystem clear
75: iocom = 021 / read + go
76: .endif
77:
78: / initialize hk
79: mov $clear,hkcs2
80: mov $ack,hkcs1
81: 0:
82: tstb hkcs1
83: bpl 0b / wait for acknowledge to complete
84:
85: clr hkca
86: mov $hkda,r1
87: clr (r1) / sector and track
88: clr -(r1) / bus address
89: mov $WC,-(r1) / word count
90: mov $iocom,-(r1)
91: 1:
92: tstb (r1)
93: bge 1b / wait for iocom to complete
94: jmp *$0
95:
96: #endif UCB_AUTOBOOT
Defined functions
_doboot
declared in line
17; defined in line
19; used 1 times
Defined variables
RK07
defined in line
56; used 2 times
WC
defined in line
57; used 1 times
ack
defined in line
73; used 1 times
clear
defined in line
74; used 1 times
hardboot
declared in line
17; defined in line
41; used 2 times
hkca
defined in line
62; used 1 times
hkcs1
defined in line
59; used 2 times
hkcs2
defined in line
61; used 1 times
hkda
defined in line
60; used 1 times
iocom
defined in line
75; used 1 times