0
|
1 ********************************************************************
|
1315
|
2 * SysGo - Kickstart program module
|
0
|
3 *
|
|
4 * $Id$
|
|
5 *
|
1316
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
0
|
8 * ------------------------------------------------------------------
|
1316
|
9 * 5 1998/10/12 Boisy G. Pitre
|
|
10 * Taken from OS-9 L2 Tandy distribution and modified banner for V3.
|
|
11 *
|
|
12 * 5r2 2003/01/08 Boisy G. Pitre
|
|
13 * Fixed fork behavior so that if 'shell startup' fails, system doesn't
|
|
14 * jmp to Crash, but tries AutoEx instead. Also changed /DD back to /H0
|
|
15 * for certain boot floppy cases.
|
|
16 *
|
|
17 * 2003/09/04 Boisy G. Pitre
|
|
18 * Back-ported to OS-9 Level One.
|
1315
|
19
|
0
|
20
|
|
21 nam SysGo
|
1315
|
22 ttl Kickstart program module
|
0
|
23
|
588
|
24 IFP1
|
0
|
25 use defsfile
|
|
26 use scfdefs
|
588
|
27 ENDC
|
0
|
28
|
1315
|
29 tylg set Prgrm+Objct
|
0
|
30 atrv set ReEnt+rev
|
1315
|
31 rev set $02
|
|
32 edition set $05
|
0
|
33
|
|
34 mod eom,name,tylg,atrv,start,size
|
|
35
|
1315
|
36 u0000 rmb 32
|
|
37 u0020 rmb 42
|
|
38 u004A rmb 33
|
|
39 u006B rmb 6
|
|
40 u0071 rmb 655
|
0
|
41 size equ .
|
|
42
|
|
43 name fcs /SysGo/
|
1315
|
44 fcb edition
|
|
45
|
|
46 * Default process priority
|
|
47 DefPrior set 128
|
0
|
48
|
1315
|
49 Banner equ *
|
1363
|
50 fcc "NitrOS-9/"
|
|
51 IFNE H6309
|
|
52 fcc /6309 /
|
|
53 ELSE
|
|
54 fcc /6809 /
|
1315
|
55 ENDC
|
1363
|
56 fcc /Level /
|
1315
|
57 IFEQ Level-3
|
1363
|
58 fcc /3/
|
1315
|
59 ENDC
|
|
60 IFEQ Level-2
|
1363
|
61 fcc /2/
|
1315
|
62 ENDC
|
|
63 IFEQ Level-1
|
1363
|
64 fcc /1/
|
1315
|
65 ENDC
|
1363
|
66 fcc / V0/
|
|
67 fcb 48+NOS9Vrsn
|
1315
|
68 fcc /.0/
|
1363
|
69 fcb 48+NOS9Major
|
1315
|
70 fcc /.0/
|
1363
|
71 fcb 48+NOS9Minor
|
1315
|
72 fcb C$CR,C$LF
|
274
|
73 * For ROM version, cut down on verbage
|
1228
|
74 IFEQ ROM
|
1363
|
75 fcc "Release Date: 10/01/2003"
|
591
|
76 fcb C$CR,C$LF
|
1364
|
77 fcc !www.nitros9.org!
|
591
|
78 fcb C$CR,C$LF
|
588
|
79 ENDC
|
0
|
80 fcb C$LF
|
1315
|
81 BannLen equ *-Banner
|
0
|
82
|
1228
|
83 IFEQ ROM
|
1315
|
84 DefDev equ *
|
1228
|
85 IFNE DD
|
|
86 fcc "/DD"
|
|
87 ELSE
|
|
88 fcc "/H0"
|
|
89 ENDC
|
0
|
90 fcb C$CR
|
1315
|
91 HDDev equ *
|
1228
|
92 IFNE DD
|
|
93 fcc "/DD/"
|
|
94 ELSE
|
|
95 fcc "/H0/"
|
|
96 ENDC
|
1315
|
97 ExecDir fcc "CMDS"
|
0
|
98 fcb C$CR
|
588
|
99 ENDC
|
0
|
100
|
|
101 Shell fcc "Shell"
|
1315
|
102 fcb C$CR
|
274
|
103 AutoEx fcc "AutoEx"
|
0
|
104 fcb C$CR
|
|
105
|
1228
|
106 IFEQ ROM
|
1316
|
107 Startup fcc "startup -p"
|
0
|
108 fcb C$CR
|
1316
|
109 StartupL equ *-Startup
|
588
|
110 ENDC
|
0
|
111
|
1315
|
112 ShellPrm equ *
|
|
113 IFGT Level-1
|
|
114 fcc "i=/1"
|
|
115 ENDC
|
|
116 CRtn fcb C$CR
|
|
117 ShellPL equ *-ShellPrm
|
|
118
|
0
|
119 * Default time packet
|
1315
|
120 * YY/MM/DD HH:MM:SS
|
|
121 DefTime fcb 103,09,01,00,00,59
|
0
|
122
|
1315
|
123 IFEQ Level-1
|
|
124 * BASIC reset code
|
0
|
125 BasicRst fcb $55
|
252
|
126 neg <$0074
|
76
|
127 nop
|
1300
|
128 clr >PIA0Base+3
|
1315
|
129 nop
|
76
|
130 nop
|
1315
|
131 sta >$FFDF turn off ROM mode
|
|
132 jmp >Bt.Start+2 jump to boot
|
252
|
133 BasicRL equ *-BasicRst
|
1315
|
134 ENDC
|
0
|
135
|
1315
|
136
|
|
137 * SysGo Entry Point
|
0
|
138 start leax >IcptRtn,pcr
|
|
139 os9 F$Icpt
|
1315
|
140 * Set priority of this process
|
|
141 os9 F$ID
|
|
142 ldb #DefPrior
|
|
143 os9 F$SPrior
|
|
144 * Show banner
|
|
145 leax >Banner,pcr
|
|
146 ldy #BannLen
|
|
147 lda #$01 standard output
|
|
148 os9 I$Write write out banner
|
|
149 * Set default time
|
|
150 leax >DefTime,pcr
|
|
151 os9 F$STime set time to default
|
|
152 IFEQ ROM
|
|
153 * Change EXEC and DATA dirs
|
|
154 leax >ExecDir,pcr
|
|
155 lda #EXEC.
|
|
156 os9 I$ChgDir change exec. dir
|
|
157 leax >DefDev,pcr
|
|
158 lda #READ.+WRITE.
|
|
159 os9 I$ChgDir change data dir.
|
|
160 bcs L0125
|
|
161 leax >HDDev,pcr
|
|
162 lda #EXEC.
|
|
163 os9 I$ChgDir change exec. dir to HD
|
|
164 ENDC
|
|
165
|
|
166 * Setup BASIC code
|
|
167 L0125 equ *
|
1316
|
168 pshs u,y
|
1315
|
169 IFEQ Level-1
|
0
|
170 leax >BasicRst,pcr
|
252
|
171 ldu #D.CBStrt
|
|
172 ldb #BasicRL
|
1315
|
173 CopyLoop lda ,x+
|
0
|
174 sta ,u+
|
|
175 decb
|
|
176 bne CopyLoop
|
1315
|
177 ELSE
|
|
178 os9 F$ID
|
|
179 bcs L01A9
|
|
180 leax ,u
|
|
181 os9 F$GPrDsc
|
|
182 bcs L01A9
|
|
183 leay ,u
|
|
184 ldx #$0000
|
|
185 ldb #$01
|
|
186 os9 F$MapBlk
|
|
187 bcs L01A9
|
0
|
188
|
1315
|
189 lda #$55 set flag for Color BASIC
|
|
190 sta <D.CBStrt,u
|
|
191 * Copy our default I/O ptrs to the system process
|
|
192 ldd <D.SysPrc,u
|
|
193 leau d,u
|
|
194 leau <P$DIO,u
|
|
195 leay <P$DIO,y
|
|
196 ldb #DefIOSiz-1
|
|
197 L0151 lda b,y
|
|
198 sta b,u
|
|
199 decb
|
|
200 bpl L0151
|
|
201 ENDC
|
274
|
202
|
1228
|
203 IFEQ ROM
|
1315
|
204 * Fork shell startup here
|
0
|
205 leax >Shell,pcr
|
|
206 leau >Startup,pcr
|
252
|
207 ldd #256
|
1316
|
208 ldy #StartupL
|
1315
|
209 os9 F$Fork
|
|
210 bcs DoAuto
|
|
211 os9 F$Wait
|
|
212 ENDC
|
|
213 * Fork AutoEx here
|
|
214 DoAuto leax >AutoEx,pcr
|
|
215 leau >CRtn,pcr
|
|
216 ldd #$0100
|
|
217 ldy #$0001
|
0
|
218 os9 F$Fork
|
1315
|
219 bcs L0186
|
0
|
220 os9 F$Wait
|
1316
|
221 L0186 equ *
|
|
222 puls u,y
|
|
223 FrkShell leax >ShellPrm,pcr
|
1315
|
224 leay ,u
|
|
225 ldb #ShellPL
|
|
226 L0190 lda ,x+
|
|
227 sta ,y+
|
|
228 decb
|
|
229 bne L0190
|
|
230 * Fork final shell here
|
|
231 leax >Shell,pcr
|
1316
|
232 lda #$01 D = 256 (B already 0 from above)
|
1315
|
233 ldy #ShellPL
|
1316
|
234 IFGT Level-1
|
1315
|
235 os9 F$Chain
|
|
236 ldb #$06
|
|
237 bra Crash
|
|
238 L01A9 ldb #$04
|
|
239 Crash clr >DPort+$08 turn off disk motor
|
|
240 jmp <D.Crash
|
1316
|
241 ELSE
|
|
242 os9 F$Fork
|
|
243 bcs DeadEnd
|
|
244 os9 F$Wait
|
|
245 bcc FrkShell
|
|
246 DeadEnd bra DeadEnd
|
588
|
247 ENDC
|
0
|
248
|
|
249 IcptRtn rti
|
|
250
|
|
251 emod
|
|
252 eom equ *
|
|
253 end
|