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
|
1315
|
77 fcc /"A CoCo Community Project"/
|
591
|
78 fcb C$CR,C$LF
|
1315
|
79 fcc /Visit us on the web:/
|
591
|
80 fcb C$CR,C$LF
|
1363
|
81 fcc !http://www.nitros9.org/!
|
591
|
82 fcb C$CR,C$LF
|
588
|
83 ENDC
|
0
|
84 fcb C$LF
|
1315
|
85 BannLen equ *-Banner
|
0
|
86
|
1228
|
87 IFEQ ROM
|
1315
|
88 DefDev equ *
|
1228
|
89 IFNE DD
|
|
90 fcc "/DD"
|
|
91 ELSE
|
|
92 fcc "/H0"
|
|
93 ENDC
|
0
|
94 fcb C$CR
|
1315
|
95 HDDev equ *
|
1228
|
96 IFNE DD
|
|
97 fcc "/DD/"
|
|
98 ELSE
|
|
99 fcc "/H0/"
|
|
100 ENDC
|
1315
|
101 ExecDir fcc "CMDS"
|
0
|
102 fcb C$CR
|
588
|
103 ENDC
|
0
|
104
|
|
105 Shell fcc "Shell"
|
1315
|
106 fcb C$CR
|
274
|
107 AutoEx fcc "AutoEx"
|
0
|
108 fcb C$CR
|
|
109
|
1228
|
110 IFEQ ROM
|
1316
|
111 Startup fcc "startup -p"
|
0
|
112 fcb C$CR
|
1316
|
113 StartupL equ *-Startup
|
588
|
114 ENDC
|
0
|
115
|
1315
|
116 ShellPrm equ *
|
|
117 IFGT Level-1
|
|
118 fcc "i=/1"
|
|
119 ENDC
|
|
120 CRtn fcb C$CR
|
|
121 ShellPL equ *-ShellPrm
|
|
122
|
0
|
123 * Default time packet
|
1315
|
124 * YY/MM/DD HH:MM:SS
|
|
125 DefTime fcb 103,09,01,00,00,59
|
0
|
126
|
1315
|
127 IFEQ Level-1
|
|
128 * BASIC reset code
|
0
|
129 BasicRst fcb $55
|
252
|
130 neg <$0074
|
76
|
131 nop
|
1300
|
132 clr >PIA0Base+3
|
1315
|
133 nop
|
76
|
134 nop
|
1315
|
135 sta >$FFDF turn off ROM mode
|
|
136 jmp >Bt.Start+2 jump to boot
|
252
|
137 BasicRL equ *-BasicRst
|
1315
|
138 ENDC
|
0
|
139
|
1315
|
140
|
|
141 * SysGo Entry Point
|
0
|
142 start leax >IcptRtn,pcr
|
|
143 os9 F$Icpt
|
1315
|
144 * Set priority of this process
|
|
145 os9 F$ID
|
|
146 ldb #DefPrior
|
|
147 os9 F$SPrior
|
|
148 * Show banner
|
|
149 leax >Banner,pcr
|
|
150 ldy #BannLen
|
|
151 lda #$01 standard output
|
|
152 os9 I$Write write out banner
|
|
153 * Set default time
|
|
154 leax >DefTime,pcr
|
|
155 os9 F$STime set time to default
|
|
156 IFEQ ROM
|
|
157 * Change EXEC and DATA dirs
|
|
158 leax >ExecDir,pcr
|
|
159 lda #EXEC.
|
|
160 os9 I$ChgDir change exec. dir
|
|
161 leax >DefDev,pcr
|
|
162 lda #READ.+WRITE.
|
|
163 os9 I$ChgDir change data dir.
|
|
164 bcs L0125
|
|
165 leax >HDDev,pcr
|
|
166 lda #EXEC.
|
|
167 os9 I$ChgDir change exec. dir to HD
|
|
168 ENDC
|
|
169
|
|
170 * Setup BASIC code
|
|
171 L0125 equ *
|
1316
|
172 pshs u,y
|
1315
|
173 IFEQ Level-1
|
0
|
174 leax >BasicRst,pcr
|
252
|
175 ldu #D.CBStrt
|
|
176 ldb #BasicRL
|
1315
|
177 CopyLoop lda ,x+
|
0
|
178 sta ,u+
|
|
179 decb
|
|
180 bne CopyLoop
|
1315
|
181 ELSE
|
|
182 os9 F$ID
|
|
183 bcs L01A9
|
|
184 leax ,u
|
|
185 os9 F$GPrDsc
|
|
186 bcs L01A9
|
|
187 leay ,u
|
|
188 ldx #$0000
|
|
189 ldb #$01
|
|
190 os9 F$MapBlk
|
|
191 bcs L01A9
|
0
|
192
|
1315
|
193 lda #$55 set flag for Color BASIC
|
|
194 sta <D.CBStrt,u
|
|
195 * Copy our default I/O ptrs to the system process
|
|
196 ldd <D.SysPrc,u
|
|
197 leau d,u
|
|
198 leau <P$DIO,u
|
|
199 leay <P$DIO,y
|
|
200 ldb #DefIOSiz-1
|
|
201 L0151 lda b,y
|
|
202 sta b,u
|
|
203 decb
|
|
204 bpl L0151
|
|
205 ENDC
|
274
|
206
|
1228
|
207 IFEQ ROM
|
1315
|
208 * Fork shell startup here
|
0
|
209 leax >Shell,pcr
|
|
210 leau >Startup,pcr
|
252
|
211 ldd #256
|
1316
|
212 ldy #StartupL
|
1315
|
213 os9 F$Fork
|
|
214 bcs DoAuto
|
|
215 os9 F$Wait
|
|
216 ENDC
|
|
217 * Fork AutoEx here
|
|
218 DoAuto leax >AutoEx,pcr
|
|
219 leau >CRtn,pcr
|
|
220 ldd #$0100
|
|
221 ldy #$0001
|
0
|
222 os9 F$Fork
|
1315
|
223 bcs L0186
|
0
|
224 os9 F$Wait
|
1316
|
225 L0186 equ *
|
|
226 puls u,y
|
|
227 FrkShell leax >ShellPrm,pcr
|
1315
|
228 leay ,u
|
|
229 ldb #ShellPL
|
|
230 L0190 lda ,x+
|
|
231 sta ,y+
|
|
232 decb
|
|
233 bne L0190
|
|
234 * Fork final shell here
|
|
235 leax >Shell,pcr
|
1316
|
236 lda #$01 D = 256 (B already 0 from above)
|
1315
|
237 ldy #ShellPL
|
1316
|
238 IFGT Level-1
|
1315
|
239 os9 F$Chain
|
|
240 ldb #$06
|
|
241 bra Crash
|
|
242 L01A9 ldb #$04
|
|
243 Crash clr >DPort+$08 turn off disk motor
|
|
244 jmp <D.Crash
|
1316
|
245 ELSE
|
|
246 os9 F$Fork
|
|
247 bcs DeadEnd
|
|
248 os9 F$Wait
|
|
249 bcc FrkShell
|
|
250 DeadEnd bra DeadEnd
|
588
|
251 ENDC
|
0
|
252
|
|
253 IcptRtn rti
|
|
254
|
|
255 emod
|
|
256 eom equ *
|
|
257 end
|