Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/sysgo.asm @ 1666:64d9ab34e898
Added copyright string
author | boisy |
---|---|
date | Fri, 23 Jul 2004 03:58:58 +0000 |
parents | d696f50c0c67 |
children | e2ac12787e55 |
rev | line source |
---|---|
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. | |
1462
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
19 * |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
20 * 5r3 2003/12/14 Boisy G. Pitre |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
21 * Added SHIFT key check to prevent startup/autoex from starting if |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
22 * held down. Gene Heskett, this Bud's for you. |
0 | 23 |
24 nam SysGo | |
1315 | 25 ttl Kickstart program module |
0 | 26 |
588 | 27 IFP1 |
0 | 28 use defsfile |
29 use scfdefs | |
588 | 30 ENDC |
0 | 31 |
1315 | 32 tylg set Prgrm+Objct |
0 | 33 atrv set ReEnt+rev |
1462
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
34 rev set $03 |
1315 | 35 edition set $05 |
0 | 36 |
37 mod eom,name,tylg,atrv,start,size | |
38 | |
1315 | 39 u0000 rmb 32 |
40 u0020 rmb 42 | |
41 u004A rmb 33 | |
42 u006B rmb 6 | |
43 u0071 rmb 655 | |
0 | 44 size equ . |
45 | |
46 name fcs /SysGo/ | |
1315 | 47 fcb edition |
48 | |
49 * Default process priority | |
50 DefPrior set 128 | |
0 | 51 |
1315 | 52 Banner equ * |
1363 | 53 fcc "NitrOS-9/" |
54 IFNE H6309 | |
55 fcc /6309 / | |
56 ELSE | |
57 fcc /6809 / | |
1315 | 58 ENDC |
1363 | 59 fcc /Level / |
1519 | 60 fcb '0+Level |
1363 | 61 fcc / V0/ |
1519 | 62 fcb '0+NOS9Vrsn |
1315 | 63 fcc /.0/ |
1519 | 64 fcb '0+NOS9Major |
1315 | 65 fcc /.0/ |
1519 | 66 fcb '0+NOS9Minor |
1666 | 67 fcb C$CR,C$LF |
68 fcc /(C) 2004 The NitrOS-9 Project/ | |
1315 | 69 fcb C$CR,C$LF |
1651 | 70 IFNE DEVEL |
71 fcc "** DEVELOPMENT BUILD **" | |
72 fcb C$CR,C$LF | |
73 fcc "** NOT FOR DISTRIBUTION! **" | |
1615 | 74 fcb C$CR,C$LF |
75 ENDC | |
274 | 76 * For ROM version, cut down on verbage |
1228 | 77 IFEQ ROM |
1651 | 78 IFNE DEVEL |
1642 | 79 dts |
1651 | 80 ELSE |
81 fcc "September 1, 2004" | |
82 ENDC | |
591 | 83 fcb C$CR,C$LF |
1419 | 84 fcc !http://www.nitros9.org! |
591 | 85 fcb C$CR,C$LF |
588 | 86 ENDC |
0 | 87 fcb C$LF |
1315 | 88 BannLen equ *-Banner |
0 | 89 |
1228 | 90 IFEQ ROM |
1315 | 91 DefDev equ * |
1228 | 92 IFNE DD |
93 fcc "/DD" | |
94 ELSE | |
95 fcc "/H0" | |
96 ENDC | |
0 | 97 fcb C$CR |
1315 | 98 HDDev equ * |
1228 | 99 IFNE DD |
100 fcc "/DD/" | |
101 ELSE | |
102 fcc "/H0/" | |
103 ENDC | |
1315 | 104 ExecDir fcc "CMDS" |
0 | 105 fcb C$CR |
588 | 106 ENDC |
0 | 107 |
108 Shell fcc "Shell" | |
1315 | 109 fcb C$CR |
274 | 110 AutoEx fcc "AutoEx" |
0 | 111 fcb C$CR |
112 | |
1228 | 113 IFEQ ROM |
1316 | 114 Startup fcc "startup -p" |
0 | 115 fcb C$CR |
1316 | 116 StartupL equ *-Startup |
588 | 117 ENDC |
0 | 118 |
1315 | 119 ShellPrm equ * |
120 IFGT Level-1 | |
121 fcc "i=/1" | |
122 ENDC | |
123 CRtn fcb C$CR | |
124 ShellPL equ *-ShellPrm | |
125 | |
0 | 126 * Default time packet |
1642 | 127 DefTime dtb |
0 | 128 |
1315 | 129 IFEQ Level-1 |
130 * BASIC reset code | |
0 | 131 BasicRst fcb $55 |
252 | 132 neg <$0074 |
76 | 133 nop |
1300 | 134 clr >PIA0Base+3 |
1315 | 135 nop |
76 | 136 nop |
1315 | 137 sta >$FFDF turn off ROM mode |
138 jmp >Bt.Start+2 jump to boot | |
252 | 139 BasicRL equ *-BasicRst |
1315 | 140 ENDC |
0 | 141 |
1315 | 142 |
143 * SysGo Entry Point | |
0 | 144 start leax >IcptRtn,pcr |
145 os9 F$Icpt | |
1315 | 146 * Set priority of this process |
147 os9 F$ID | |
148 ldb #DefPrior | |
149 os9 F$SPrior | |
150 * Show banner | |
151 leax >Banner,pcr | |
152 ldy #BannLen | |
153 lda #$01 standard output | |
154 os9 I$Write write out banner | |
155 * Set default time | |
156 leax >DefTime,pcr | |
157 os9 F$STime set time to default | |
158 IFEQ ROM | |
159 * Change EXEC and DATA dirs | |
160 leax >ExecDir,pcr | |
161 lda #EXEC. | |
162 os9 I$ChgDir change exec. dir | |
163 leax >DefDev,pcr | |
164 lda #READ.+WRITE. | |
165 os9 I$ChgDir change data dir. | |
166 bcs L0125 | |
167 leax >HDDev,pcr | |
168 lda #EXEC. | |
169 os9 I$ChgDir change exec. dir to HD | |
170 ENDC | |
171 | |
172 * Setup BASIC code | |
173 L0125 equ * | |
1316 | 174 pshs u,y |
1315 | 175 IFEQ Level-1 |
0 | 176 leax >BasicRst,pcr |
252 | 177 ldu #D.CBStrt |
178 ldb #BasicRL | |
1315 | 179 CopyLoop lda ,x+ |
0 | 180 sta ,u+ |
181 decb | |
182 bne CopyLoop | |
1315 | 183 ELSE |
184 os9 F$ID | |
1467 | 185 lbcs L01A9 |
1315 | 186 leax ,u |
187 os9 F$GPrDsc | |
1467 | 188 lbcs L01A9 |
1315 | 189 leay ,u |
190 ldx #$0000 | |
191 ldb #$01 | |
192 os9 F$MapBlk | |
193 bcs L01A9 | |
0 | 194 |
1315 | 195 lda #$55 set flag for Color BASIC |
196 sta <D.CBStrt,u | |
197 * Copy our default I/O ptrs to the system process | |
198 ldd <D.SysPrc,u | |
199 leau d,u | |
200 leau <P$DIO,u | |
201 leay <P$DIO,y | |
202 ldb #DefIOSiz-1 | |
203 L0151 lda b,y | |
204 sta b,u | |
205 decb | |
206 bpl L0151 | |
207 ENDC | |
274 | 208 |
1228 | 209 IFEQ ROM |
1315 | 210 * Fork shell startup here |
1462
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
211 * Added 12/14/03: If SHIFT is held down, startup is not run |
1464 | 212 lda #$01 standard output |
1462
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
213 ldb #SS.KySns |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
214 os9 I$GetStt |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
215 bcs DoStartup |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
216 bita #SHIFTBIT SHIFT key down? |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
217 bne L0186 Yes, don't to startup or autoex |
062d65d5c132
Added check for SHIFT key which, if down, bypasses startup and AutoEx
boisy
parents:
1449
diff
changeset
|
218 DoStartup leax >Shell,pcr |
0 | 219 leau >Startup,pcr |
252 | 220 ldd #256 |
1316 | 221 ldy #StartupL |
1315 | 222 os9 F$Fork |
223 bcs DoAuto | |
224 os9 F$Wait | |
225 ENDC | |
226 * Fork AutoEx here | |
227 DoAuto leax >AutoEx,pcr | |
228 leau >CRtn,pcr | |
229 ldd #$0100 | |
230 ldy #$0001 | |
0 | 231 os9 F$Fork |
1315 | 232 bcs L0186 |
0 | 233 os9 F$Wait |
1316 | 234 L0186 equ * |
235 puls u,y | |
236 FrkShell leax >ShellPrm,pcr | |
1315 | 237 leay ,u |
238 ldb #ShellPL | |
239 L0190 lda ,x+ | |
240 sta ,y+ | |
241 decb | |
242 bne L0190 | |
243 * Fork final shell here | |
244 leax >Shell,pcr | |
1316 | 245 lda #$01 D = 256 (B already 0 from above) |
1315 | 246 ldy #ShellPL |
1316 | 247 IFGT Level-1 |
1315 | 248 os9 F$Chain |
249 ldb #$06 | |
250 bra Crash | |
251 L01A9 ldb #$04 | |
252 Crash clr >DPort+$08 turn off disk motor | |
253 jmp <D.Crash | |
1316 | 254 ELSE |
255 os9 F$Fork | |
256 bcs DeadEnd | |
257 os9 F$Wait | |
258 bcc FrkShell | |
259 DeadEnd bra DeadEnd | |
588 | 260 ENDC |
0 | 261 |
262 IcptRtn rti | |
263 | |
264 emod | |
265 eom equ * | |
266 end |