Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/kernel/krn.asm @ 3057:1a76d7b57aa6
level 1 krn: Fix stack injection on 6309
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Sun, 25 Jan 2015 22:36:04 +0100 |
parents | dde1b2fc79fc |
children | fa4b4ae537c1 |
rev | line source |
---|---|
1453 | 1 ******************************************************************** |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1460
diff
changeset
|
2 * Krn - NitrOS-9 Level 1 Kernel |
1453 | 3 * |
4 * $Id$ | |
5 * | |
6 * This is how the memory map looks after the kernel has initialized: | |
7 * | |
8 * $0000----> ================================== | |
9 * | | | |
10 * | | | |
11 * $0020-$0111 | System Globals (D.FMBM-D.XNMI) | | |
12 * | | | |
13 * | | | |
14 * $0200---->|==================================| | |
15 * | Free Memory Bitmap | | |
16 * $0200-$021F | (1 bit = 256 byte page) | | |
17 * |----------------------------------| | |
2012 | 18 * $0220-$0221 | IOMan I/O Call Pointer | |
19 * |----------------------------------| | |
1453 | 20 * | System Dispatch Table | |
21 * $0222-$0291 | (Room for 56 addresses) | | |
22 * |----------------------------------| | |
23 * $0292-$02FF | User Dispatch Table | | |
24 * | (Room for 56 addresses) | | |
25 * $0300---->|==================================| | |
26 * | | | |
27 * | | | |
28 * $0300-$03FF | Module Directory Entries | | |
29 * | (Room for 64 entries) | | |
30 * | | | |
31 * $0400---->|==================================| | |
32 * | | | |
33 * $0400-$04FF | System Stack | | |
34 * | | | |
35 * $0500---->|==================================| | |
2618 | 36 * | | |
37 * | | | |
38 * | | | |
39 * $0500-$08FF | Screen Memory (Atari Only) | | |
40 * | | | |
41 * | | | |
42 * | | | |
43 * $0900---->|==================================| | |
1453 | 44 * |
45 * Edt/Rev YYYY/MM/DD Modified by | |
46 * Comment | |
47 * ------------------------------------------------------------------ | |
48 * 14 1985/??/?? | |
49 * From Tandy OS-9 Level One VR 02.00.00 | |
50 * | |
51 * 15 2002/07/21 Boisy G. Pitre | |
52 * Module validation consists only of module header parity check. | |
53 * CRC check is not done unless D.CRC is set to 1, which is NOT the | |
54 * default case. By default, D.CRC is set to 0, thus there is no | |
55 * CRC checking. Speeds up module loads quite a bit. The Init module | |
56 * has a bit in a compatibility byte that can turn on/off CRC checking | |
57 * | |
58 * 15r1 2003/12/09 Boisy G. Pitre | |
1460 | 59 * Kernel no longer scans for modules in I/O space. Also, F$PrsNam now |
60 * allows _ and 0-9 as first chars of a filename. | |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1460
diff
changeset
|
61 * |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1460
diff
changeset
|
62 * 15r1 2004/05/23 Boisy G. Pitre |
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1460
diff
changeset
|
63 * Renamed to 'krn' |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
64 * |
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
65 * 16 2004/05/23 Boisy G. Pitre |
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
66 * Added changes for Atari port |
1453 | 67 |
1587
5f18094d961d
kernel modules renamed to krn, updated makefiles, clock2_tc3 now clock2_cloud9...
boisy
parents:
1460
diff
changeset
|
68 nam krn |
1453 | 69 ttl NitrOS-9 Level 1 Kernel |
70 | |
71 ifp1 | |
72 use defsfile | |
2618 | 73 IFNE atari |
2622
1df7d248bb24
Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2620
diff
changeset
|
74 use atari.d |
2618 | 75 ENDC |
1453 | 76 endc |
77 | |
78 tylg set Systm+Objct | |
79 atrv set ReEnt+rev | |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
80 rev set $00 |
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
81 edition set 16 |
1453 | 82 |
2012 | 83 ModTop mod eom,name,tylg,atrv,OS9Cold,size |
1453 | 84 |
85 size equ . | |
86 | |
1663 | 87 name fcs /Krn/ |
1453 | 88 fcb edition |
89 | |
90 * | |
91 * OS-9 Genesis! | |
1460 | 92 |
1453 | 93 OS9Cold equ * |
2618 | 94 |
2252 | 95 * clear out system globals from $0000-$0400 |
96 * ldx #D.FMBM | |
97 ldx #$0000 | |
1460 | 98 IFNE H6309 |
2252 | 99 * ldw #$400-D.FMBM |
100 ldw #$400 | |
1460 | 101 leay Zoro,pc |
102 tfm y,x+ | |
103 ELSE | |
2252 | 104 * ldy #$400-D.FMBM |
105 ldy #$400 | |
1453 | 106 clra |
107 clrb | |
108 L007F std ,x++ | |
109 leay -2,y | |
110 bne L007F | |
1460 | 111 ENDC |
112 | |
1453 | 113 * set up system globals |
1460 | 114 IFNE H6309 |
115 ldd #$200 | |
116 ELSE | |
1453 | 117 inca |
118 inca D = $200 | |
1460 | 119 ENDC |
1453 | 120 std <D.FMBM $200 = start of free memory bitmap |
121 addb #$20 | |
122 std <D.FMBM+2 $220 = end of free memory bitmap | |
123 addb #$02 | |
124 std <D.SysDis $222 = addr of sys dispatch tbl | |
125 addb #$70 | |
126 std <D.UsrDis $292 = addr of usr dispatch tbl | |
127 clrb | |
128 inca D = $300 | |
129 std <D.ModDir $300 = mod dir start | |
130 stx <D.ModDir+2 X = $400 = mod dir end | |
131 leas >$0100,x S = $500 (system stack?) | |
132 | |
2653
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
133 * NOTE: This routine checks for RAM by writing a pattern at an address |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
134 * then reading it back for validation. On the CoCo, we pretty much know |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
135 * that we are in all-RAM mode at this point, and the same goes for the |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
136 * other supported platforms. So I am taking this code out for the time being. |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
137 |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
138 IFNE CHECK_FOR_VALID_RAM |
1453 | 139 * Check for valid RAM starting at $400 |
140 ChkRAM leay ,x | |
141 ldd ,y store org contents in D | |
142 ldx #$00FF | |
143 stx ,y write pattern to ,Y | |
144 cmpx ,y same as what we wrote? | |
145 bne L00C2 nope, not RAM here! | |
146 ldx #$FF00 try different pattern | |
147 stx ,y write it to ,Y | |
148 cmpx ,y same as what we wrote? | |
149 bne L00C2 nope, not RAM here! | |
150 std ,y else restore org contents | |
151 leax >$0100,y check top of next 256 block | |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
152 IFNE atari |
2625
d1ea3dc90082
More progress... now booting with DriveWire
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
153 cmpx #$8000 stop short of ROM starting at $8000 |
d1ea3dc90082
More progress... now booting with DriveWire
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
154 ELSE |
1453 | 155 cmpx #Bt.Start stop short of boot track mem |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
156 ENDC |
1453 | 157 bcs ChkRAM |
158 leay ,x | |
159 * Here, Y = end of RAM | |
160 L00C2 leax ,y X = end of RAM | |
2653
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
161 |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
162 ELSE |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
163 |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
164 IFNE atari |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
165 ldx #$8000 |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
166 ELSE |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
167 ldx #Bt.Start |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
168 ENDC |
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
169 ENDC |
1453 | 170 stx <D.MLIM save off memory limit |
171 | |
172 * Copy vector code over to address $100 | |
2653
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
173 pshs x |
1460 | 174 IFNE H6309 |
175 leax >VectCode,pcr | |
176 ldy #D.XSWI3 | |
177 ldw #VectCSz | |
178 tfm x+,y+ | |
179 ELSE | |
1453 | 180 leax >VectCode,pcr |
181 ldy #D.XSWI3 | |
182 ldb #VectCSz | |
183 L00D2 lda ,x+ | |
184 sta ,y+ | |
185 decb | |
186 bne L00D2 | |
1460 | 187 ENDC |
2653
40d55004f686
o krn.asm: Conditionalized out code in kernel to check for top of RAM
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2649
diff
changeset
|
188 puls x |
1460 | 189 |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
190 IFNE atari |
2620 | 191 ldy #$D000 |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
192 |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
193 inc <D.Boot |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
194 stx <D.BTLO |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
195 ldx #$FFFF |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
196 stx <D.BTHI |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
197 |
2625
d1ea3dc90082
More progress... now booting with DriveWire
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
198 ELSE |
2620 | 199 ldy #Bt.Start+Bt.Size |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
200 ENDC |
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
201 |
2620 | 202 lbsr ValMods |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
203 IFNE atari |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
204 |
2620 | 205 ldx #$D800 |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
206 ldy #$F400 |
2620 | 207 lbsr ValMods |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
208 ENDC |
2620 | 209 |
1460 | 210 * Copy vectors to system globals |
1453 | 211 L00EE leay >Vectors,pcr |
2012 | 212 leax >ModTop,pcr |
1453 | 213 pshs x |
214 ldx #D.SWI3 | |
215 L00FB ldd ,y++ | |
216 addd ,s | |
217 std ,x++ | |
2012 | 218 cmpx #D.NMI |
1453 | 219 bls L00FB |
220 leas 2,s restore stack | |
221 | |
222 * fill in more system globals | |
223 leax >URtoSs,pcr | |
224 stx <D.URtoSs | |
225 leax >UsrIRQ,pcr | |
226 stx <D.UsrIRQ | |
227 leax >UsrSvc,pcr | |
228 stx <D.UsrSvc | |
229 leax >SysIRQ,pcr | |
230 stx <D.SysIRQ | |
231 stx <D.SvcIRQ | |
232 leax >SysSvc,pcr | |
233 stx <D.SysSvc | |
234 stx <D.SWI2 | |
2023 | 235 leax >Poll,pcr point to default poll routine |
236 stx <D.Poll and save it | |
237 leax >Clock,pcr get default clock routine | |
238 stx <D.Clock and save it to the vector | |
239 stx <D.AltIRQ and in the alternate IRQ vector | |
1453 | 240 |
241 * install system calls | |
242 leay >SysTbl,pcr | |
243 lbsr InstSSvc | |
244 | |
245 * link to init module | |
246 lda #Systm+0 | |
247 leax >InitNam,pcr | |
248 os9 F$Link | |
249 lbcs OS9Cold | |
250 stu <D.Init | |
251 lda Feature1,u get feature byte 1 | |
252 bita #CRCOn CRC on? | |
253 beq GetMem branch if not (already cleared earlier) | |
254 inc <D.CRC else turn on CRC checking | |
2770
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2710
diff
changeset
|
255 *GetMem ldd MaxMem+1,u I don't think this exists for Level1 RG |
2732
43300b4f840a
Robert Gault submitted changes to the level1/modules/kernel/krn.asm file related to free pages being less than what they should be.
drencor-xeen
parents:
2731
diff
changeset
|
256 * clrb |
2770
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2710
diff
changeset
|
257 * cmpd <D.MLIM starts as $EE00 |
2732
43300b4f840a
Robert Gault submitted changes to the level1/modules/kernel/krn.asm file related to free pages being less than what they should be.
drencor-xeen
parents:
2731
diff
changeset
|
258 * bcc L0158 |
43300b4f840a
Robert Gault submitted changes to the level1/modules/kernel/krn.asm file related to free pages being less than what they should be.
drencor-xeen
parents:
2731
diff
changeset
|
259 * std <D.MLIM |
2770
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2710
diff
changeset
|
260 GetMem equ * Initially I tried GetMem clra |
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2710
diff
changeset
|
261 * that is redundant. See last line. RG |
1453 | 262 L0158 ldx <D.FMBM |
2618 | 263 IFNE atari |
264 * In the Atari, memory $0000-$08FF is used by the system | |
265 ldb #%11111111 | |
2619
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
266 stb ,x mark $0000-$07FF as allocated |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
267 stb $1A,x mark $D000-$D7FF I/O area as allocated |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
268 ldb #%10000000 |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
269 stb 1,x mark $0800-$08FF as allocated |
2618 | 270 ELSE |
271 * In the CoCo, memory $0000-$04FF is used by the system | |
272 ldb #%11111000 | |
273 stb ,x | |
274 ENDC | |
1453 | 275 clra |
276 ldb <D.MLIM | |
277 negb | |
278 tfr d,y | |
279 negb | |
280 lbsr L065A | |
281 | |
2012 | 282 * jump into krnp2 here |
1453 | 283 leax >P2Nam,pcr |
284 lda #Systm+Objct | |
285 os9 F$Link | |
286 lbcs OS9Cold | |
287 jmp ,y | |
2012 | 288 |
1453 | 289 SWI3 pshs pc,x,b |
290 ldb #P$SWI3 | |
291 bra L018C | |
292 SWI2 pshs pc,x,b | |
293 ldb #P$SWI2 | |
294 bra L018C | |
2622
1df7d248bb24
Made progress... clock is running, fixed some stuff, things are working
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2620
diff
changeset
|
295 SVCNMI jmp [>D.NMI] |
2620 | 296 DUMMY rti |
1453 | 297 SVCIRQ jmp [>D.SvcIRQ] |
298 SWI pshs pc,x,b | |
299 ldb #P$SWI | |
300 L018C ldx >D.Proc | |
301 ldx b,x get SWI entry | |
302 stx 3,s put in PC on stack | |
303 puls pc,x,b | |
304 | |
2023 | 305 UsrIRQ leay <DoIRQPoll,pcr |
1453 | 306 * transition from user to system state |
307 URtoSs clra | |
308 tfr a,dp clear direct page | |
2012 | 309 ldx <D.Proc get current process desc |
2023 | 310 * Note that we are putting the system state service routine address into |
311 * the D.SWI2 vector. If a system call is made while we are in system state, | |
312 * D.SWI2 will be vectored to the system state service routine vector. | |
2012 | 313 ldd <D.SysSvc get system state system call vector |
314 std <D.SWI2 store in D.SWI2 | |
2023 | 315 * The same comment above applies to the IRQ service vector. |
2012 | 316 ldd <D.SysIRQ get system IRQ vector |
317 std <D.SvcIRQ store in D.SvcIRQ | |
318 leau ,s point U to S | |
319 stu P$SP,x and save in process P$SP | |
320 lda P$State,x get state field in proc desc | |
321 ora #SysState mark process to be in system state | |
322 sta P$State,x store it | |
323 jmp ,y jump to ,y | |
1453 | 324 |
2023 | 325 DoIRQPoll |
326 jsr [>D.Poll] call vectored polling routine | |
327 bcc L01BD branch if carry clear | |
328 ldb ,s get the CC on the stack | |
329 orb #IRQMask mask IRQs | |
330 stb ,s and save it back | |
331 L01BD lbra ActivateProc | |
332 | |
333 | |
1453 | 334 |
335 SysIRQ clra | |
2023 | 336 tfr a,dp make DP be 0 |
337 jsr [>D.Poll] call the vectored IRQ polling routine | |
338 bcc L01CF branch if carry is clear | |
339 ldb ,s get the CC on the stack | |
340 orb #IRQMask mask IRQs | |
341 stb ,s and save it back | |
1453 | 342 L01CF rti |
2023 | 343 |
1453 | 344 Poll comb |
345 rts | |
346 | |
2017
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
347 * Default clock routine - executed 60 times/sec |
2023 | 348 Clock ldx <D.SProcQ get pointer to sleeping proc queue |
349 beq L01FD branch if no process sleeping | |
350 lda P$State,x get state of that process | |
351 bita #TimSleep timed sleep? | |
352 beq L01FD branch if clear | |
353 ldu P$SP,x else get process stack pointer | |
354 ldd R$X,u get the value of the process X reg | |
355 subd #$0001 subtract one from it | |
3054
22ddd48b4ec2
level1 krn: Fix scheduler bug that only affected 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
2898
diff
changeset
|
356 std R$X,u and store it back |
2023 | 357 bne L01FD branch if not zero (still will sleep) |
358 L01E7 ldu P$Queue,x get process current queue pointer | |
359 bsr L021A | |
1453 | 360 leax ,u |
361 beq L01FB | |
2023 | 362 lda P$State,x get process state byte |
363 bita #TimSleep bit set? | |
364 beq L01FB branch if not | |
365 ldu P$SP,x get process stack pointer | |
366 ldd R$X,u then get process X register | |
367 beq L01E7 branch if zero | |
1453 | 368 L01FB stx <D.SProcQ |
2017
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
369 L01FD dec <D.Slice decrement slice |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
370 bne ClockRTI if not 0, exit ISR |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
371 lda <D.TSlice else get default time slice |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
372 sta <D.Slice and save it as slice |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
373 ldx <D.Proc get proc desc of current proc |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
374 beq ClockRTI if none, exit ISR |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
375 lda P$State,x get process state |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
376 ora #TimOut set timeout bit |
f273e28ea8d0
Breaking kernel down into individual files... added comments
boisy
parents:
2012
diff
changeset
|
377 sta P$State,x and store back |
1453 | 378 bpl L0212 branch if not system state |
379 ClockRTI rti | |
380 | |
2023 | 381 L0212 leay >ActivateProc,pcr |
1453 | 382 bra URtoSs |
383 | |
2006 | 384 |
385 *FAProc ldx R$X,u Get ptr to process to activate | |
386 *L0D11 clrb | |
387 * pshs cc,b,x,y,u | |
388 * lda P$Prior,x Get process priority | |
389 * sta P$Age,x Save it as age (How long it's been around) | |
390 * orcc #IntMasks Shut down IRQ's | |
391 * ldu #(D.AProcQ-P$Queue) Get ptr to active process queue | |
392 * bra L0D29 Go through the chain | |
393 ** Update active process queue | |
394 ** X=Process to activate | |
395 ** U=Current process in queue links | |
396 *L0D1F inc P$Age,u update current process age | |
397 * bne L0D25 wrap? | |
398 * dec P$Age,u yes, reset it to max. | |
399 *L0D25 cmpa P$Age,u match process ages?? | |
400 * bhi L0D2B no, skip update | |
401 *L0D29 leay ,u point Y to current process | |
402 *L0D2B ldu P$Queue,u get pointer to next process in chain | |
403 * bne L0D1F Still more in chain, keep going | |
404 * ldd P$Queue,y | |
405 * stx P$Queue,y save new process to chain | |
406 * std P$Queue,x | |
407 * puls cc,b,x,y,u,pc | |
408 | |
409 | |
2049 | 410 use faproc.asm |
2018 | 411 |
2012 | 412 * User-State system call entry point |
2023 | 413 * |
414 * All system calls made from user-state will go through this code. | |
415 UsrSvc leay <MakeSysCall,pcr | |
1453 | 416 orcc #IntMasks |
417 lbra URtoSs | |
418 | |
2023 | 419 MakeSysCall |
420 andcc #^IntMasks unmask IRQ/FIRQ | |
421 ldy <D.UsrDis get pointer to user syscall dispatch table | |
422 bsr DoSysCall go do the system call | |
423 ActivateProc | |
424 ldx <D.Proc get current proc desc | |
1453 | 425 beq FNProc branch to FNProc if none |
2012 | 426 orcc #IntMasks mask interrupts |
427 ldb P$State,x get state value in proc desc | |
428 andb #^SysState turn off system state flag | |
429 stb P$State,x save state value | |
430 bitb #TimOut timeout bit set? | |
431 beq L02D1 branch if not | |
432 andb #^TimOut else turn off bit | |
433 stb P$State,x in state value | |
1453 | 434 bsr L021A |
435 bra FNProc | |
436 | |
2012 | 437 * System-State system call entry point |
1453 | 438 SysSvc clra |
439 tfr a,dp set direct page to 0 | |
2012 | 440 leau ,s point U to SP |
441 ldy <D.SysDis get system state dispatch table ptr | |
442 bsr DoSysCall | |
1453 | 443 rti |
444 | |
2012 | 445 * Entry: Y = Dispatch table (user or system) |
446 DoSysCall | |
447 pshs u | |
1453 | 448 ldx R$PC,u point X to PC |
449 ldb ,x+ get func code at X | |
450 stx R$PC,u restore updated PC | |
2012 | 451 lslb high bit set? |
452 bcc L0288 branch if not (non I/O call) | |
453 rorb else restore B (its an I/O call) | |
454 ldx -2,y grab IOMan vector | |
455 * Note: should check if X is zero in case IOMan was not installed. | |
1453 | 456 bra L0290 |
2012 | 457 L0288 cmpb #$37*2 |
1453 | 458 bcc L02A7 |
459 ldx b,y X = addr of system call | |
460 beq L02A7 | |
461 L0290 jsr ,x jsr into system call | |
462 L0292 puls u | |
463 tfr cc,a | |
464 bcc FixCC branch if no error | |
465 stb R$B,u store error code | |
466 FixCC ldb R$CC,u get caller's CC | |
467 andb #^(Negative+Zero+TwosOvfl+Carry) | |
468 stb R$CC,u | |
469 anda #Negative+Zero+TwosOvfl+Carry | |
470 ora R$CC,u | |
471 sta R$CC,u | |
472 rts | |
473 L02A7 comb | |
474 ldb #E$UnkSvc | |
475 bra L0292 | |
476 | |
477 * no signal handler, exit with signal value as exit code | |
478 L02AC ldb P$State,x | |
479 orb #SysState | |
480 stb P$State,x | |
481 ldb <P$Signal,x | |
482 andcc #^(IntMasks) | |
483 os9 F$Exit | |
484 | |
485 FNProc clra | |
486 clrb | |
487 std <D.Proc | |
488 bra L02C2 | |
489 * execution goes here when there are no active processes | |
490 L02C0 cwai #^(IntMasks) | |
491 L02C2 orcc #IntMasks | |
492 ldx <D.AProcQ get next active process | |
493 beq L02C0 CWAI if none | |
494 ldd P$Queue,x get queue ptr | |
495 std <D.AProcQ store in Active Q | |
496 stx <D.Proc store in current process | |
497 lds P$SP,x get process' stack ptr | |
498 L02D1 ldb P$State,x get state | |
499 bmi L0308 branch if system state | |
500 bitb #Condem process condemned? | |
501 bne L02AC branch if so... | |
502 ldb <P$Signal,x get signal no | |
503 beq L02FF branch if none | |
504 decb decrement | |
505 beq L02FC branch if wake up | |
506 ldu <P$SigVec,x get signal handler addr | |
507 beq L02AC branch if none | |
508 ldy <P$SigDat,x get data addr | |
3055
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
509 ldd R$Y,s |
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
510 * set up new return stack for RTI |
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
511 pshs u,y,d new PC (sigvec), new U (sigdat), same Y |
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
512 ldu 6+R$X,s old X via U |
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
513 lda <P$Signal,x signal ... |
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
514 ldb 6+R$DP,s and old DP ... |
3056
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
515 IFEQ H6309 |
3055
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
516 tfr d,y via Y |
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
517 ldd 6+R$CC,s old CC and A via D |
35db67ca1302
level1 krn: Fix signal dispatch code to use R$ macros
Tormod Volden <debian.tormod@gmail.com>
parents:
3054
diff
changeset
|
518 pshs u,y,d same X, same DP / new B (signal), same A / CC |
3056
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
519 ELSE |
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
520 pshs u,b same X, same DP |
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
521 pshsw same W |
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
522 pshs a new B (signal) |
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
523 ldd 6+6+R$CC,s |
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
524 pshs d same A / CC |
dde1b2fc79fc
level1 krn: Fix signal dispatch for 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3055
diff
changeset
|
525 ENDC |
1453 | 526 clrb |
527 L02FC stb <P$Signal,x | |
528 L02FF ldd <P$SWI2,x | |
529 std <D.SWI2 | |
530 ldd <D.UsrIRQ | |
531 std <D.SvcIRQ | |
532 L0308 rti | |
533 | |
534 FLink pshs u save caller regs | |
535 ldd R$A,u | |
536 ldx R$X,u | |
537 lbsr L0443 | |
538 bcc FLinkOK | |
539 ldb #E$MNF | |
540 bra L033D | |
541 * U = module dir entry | |
542 FLinkOK ldy ,u get module ptr | |
543 ldb M$Revs,y | |
544 bitb #ReEnt reentrant? | |
545 bne L032A branch if so | |
546 tst $02,u link count zero? | |
547 beq L032A yep, ok to link to nonreent | |
548 comb else module is busy | |
549 ldb #E$ModBsy | |
550 bra L033D | |
551 L032A inc $02,u increment link count | |
552 ldu ,s get caller regs from stack | |
553 stx R$X,u | |
554 sty R$U,u | |
555 ldd M$Type,y | |
556 std R$D,u | |
557 ldd M$IDSize,y | |
558 leax d,y | |
559 stx R$Y,u | |
560 L033D puls pc,u | |
561 | |
562 FVModul pshs u | |
563 ldx R$X,u | |
564 bsr ValMod | |
565 puls y | |
566 stu R$U,y | |
567 rts | |
2620 | 568 |
1453 | 569 * X = address of module to validate |
570 ValMod bsr ChkMHCRC | |
2620 | 571 bcs ValModEx |
1453 | 572 lda M$Type,x |
573 pshs x,a | |
574 ldd M$Name,x | |
575 leax d,x X = addr of name in mod | |
2710
ab3a2531c000
Fixed makefiles and assembly for ATARI port
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2653
diff
changeset
|
576 IFNE atari |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
577 * jsr [>$FFE8] |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
578 * lda #$20 |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
579 * jsr [>$FFE4] |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
580 ENDC |
1453 | 581 puls a |
582 lbsr L0443 | |
583 puls x | |
2620 | 584 bcs ValLea |
1453 | 585 ldb #E$KwnMod |
586 cmpx ,u | |
2620 | 587 beq errex@ |
1453 | 588 lda M$Revs,x |
589 anda #RevsMask | |
590 pshs a | |
591 ldy ,u | |
592 lda M$Revs,y | |
593 anda #RevsMask | |
594 cmpa ,s+ same revision as other mod? | |
2620 | 595 bcc errex@ |
1453 | 596 pshs y,x |
597 ldb M$Size,u | |
2620 | 598 bne ValPul |
1453 | 599 ldx ,u |
600 cmpx <D.BTLO | |
2620 | 601 bcc ValPul |
1453 | 602 ldd $02,x |
603 addd #$00FF | |
604 tfr a,b | |
605 clra | |
606 tfr d,y | |
607 ldb ,u | |
608 ldx <D.FMBM | |
609 os9 F$DelBit | |
610 clr $02,u | |
2620 | 611 ValPul puls y,x |
612 ValSto stx ,u | |
1453 | 613 clrb |
2620 | 614 ValModEx rts |
615 ValLea leay ,u | |
616 bne ValSto | |
1453 | 617 ldb #E$DirFul |
2620 | 618 errex@ coma |
1453 | 619 rts |
620 | |
621 * check module header and CRC | |
622 * X = address of potential module | |
623 ChkMHCRC ldd ,x | |
624 cmpd #M$ID12 sync bytes? | |
2620 | 625 bne ChkMHEx nope, not a module here |
1453 | 626 leay M$Parity,x |
627 bsr ChkMHPar check header parity | |
2620 | 628 bcc Chk4CRC branch if ok |
629 ChkMHEx comb | |
1453 | 630 ldb #E$BMID |
631 rts | |
632 | |
2620 | 633 Chk4CRC |
1453 | 634 * Following 4 lines added to support no CRC checks - 2002/07/21 |
635 lda <D.CRC is CRC checking on? | |
636 bne DoCRCCk branch if so | |
637 clrb | |
638 rts | |
639 | |
640 DoCRCCk pshs x | |
641 ldy M$Size,x | |
642 bsr ChkMCRC checkm module CRC | |
643 puls pc,x | |
2620 | 644 |
1453 | 645 * check module header parity |
646 * Y = pointer to parity byte | |
647 ChkMHPar pshs y,x | |
648 clra | |
649 ChkM010 eora ,x+ | |
650 cmpx 2,s compare to addr of M$Parity | |
651 bls ChkM010 | |
652 cmpa #$FF | |
653 puls pc,y,x | |
654 * X = address of potential module | |
655 * Y = size of module | |
656 ChkMCRC ldd #$FFFF | |
657 pshs b,a | |
658 pshs b,a | |
659 leau 1,s | |
660 L03D4 lda ,x+ | |
661 bsr CRCAlgo | |
662 leay -1,y dec Y (size of module) | |
663 bne L03D4 continue | |
664 clr -1,u | |
665 lda ,u | |
666 cmpa #CRCCon1 | |
667 bne L03EC | |
668 ldd 1,u | |
669 cmpd #CRCCon23 | |
670 beq L03EF | |
671 L03EC comb | |
672 ldb #E$BMCRC | |
673 L03EF puls pc,y,x | |
674 | |
2049 | 675 use fcrc.asm |
1453 | 676 |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
677 L0443 |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
678 ldu #$0000 |
1453 | 679 tfr a,b |
680 anda #TypeMask | |
681 andb #LangMask | |
682 pshs u,y,x,b,a | |
683 bsr EatSpace | |
684 cmpa #PDELIM pathlist char? | |
685 beq L049C branch if so | |
686 lbsr ParseNam parse name | |
687 bcs L049D return if error | |
688 ldu <D.ModDir | |
689 L045B pshs u,y,b | |
690 ldu ,u | |
691 beq L048B | |
692 ldd $04,u | |
693 leay d,u | |
694 ldb ,s | |
695 lbsr L07AB | |
696 bcs L0493 | |
697 lda $05,s | |
698 beq L0476 | |
699 eora $06,u | |
700 anda #$F0 | |
701 bne L0493 | |
702 L0476 lda $06,s | |
703 beq L0480 | |
704 eora $06,u | |
705 anda #$0F | |
706 bne L0493 | |
707 L0480 puls u,x,b | |
708 stu $06,s | |
709 bsr EatSpace | |
710 stx $02,s | |
711 clra | |
712 bra L049D | |
713 L048B ldd $0B,s | |
714 bne L0493 | |
715 ldd $03,s | |
716 std $0B,s | |
717 L0493 puls u,y,b | |
718 leau $04,u | |
719 cmpu <D.ModDir+2 | |
720 bcs L045B | |
721 L049C comb | |
722 L049D puls pc,u,y,x,b,a | |
723 | |
724 EatSpace lda #C$SPAC | |
725 EatSpc10 cmpa ,x+ | |
726 beq EatSpc10 | |
727 lda ,-x | |
728 rts | |
729 | |
730 FFork ldx <D.PrcDBT | |
731 os9 F$All64 | |
732 bcs L0517 | |
733 ldx <D.Proc | |
734 pshs x save calling proc desc on stack | |
735 ldd P$User,x | |
736 std P$User,y | |
737 lda P$Prior,x | |
738 clrb | |
739 std P$Prior,y | |
740 ldb #SysState | |
741 stb P$State,y | |
742 sty <D.Proc | |
743 ldd <P$NIO,x | |
744 std <P$NIO,y | |
745 ldd <P$NIO+2,x | |
746 std <P$NIO+2,y | |
747 leax <P$DIO,x | |
748 leay <P$DIO,y | |
749 ldb #DefIOSiz | |
750 * copy I/O stuff from parent to child | |
751 L04D7 lda ,x+ | |
752 sta ,y+ | |
753 decb | |
754 bne L04D7 | |
755 * X/Y = address of path table in respective proc desc | |
756 * Dup stdin/stdout/stderr | |
757 ldb #$03 | |
758 L04E0 lda ,x+ | |
759 os9 I$Dup | |
760 bcc L04E8 | |
761 clra | |
762 L04E8 sta ,y+ | |
763 decb | |
764 bne L04E0 | |
765 bsr L0553 | |
766 bcs L050C | |
767 puls y get parent proc desc | |
768 sty <D.Proc | |
769 lda P$ID,x get ID of new process | |
770 sta R$A,u store in caller's A | |
771 ldb P$CID,y get child id of parent | |
772 sta P$CID,y store new proc in parent's CID | |
773 lda P$ID,y get ID of parent | |
774 std P$PID,x store in child proc desc | |
775 ldb P$State,x update state of child | |
776 andb #^SysState | |
777 stb P$State,x | |
778 os9 F$AProc insert child in active Q | |
779 rts | |
780 L050C pshs b | |
781 os9 F$Exit | |
782 comb | |
783 puls x,b | |
784 stx <D.Proc | |
785 rts | |
786 L0517 comb | |
787 ldb #E$PrcFul | |
788 rts | |
789 | |
790 FChain bsr L0543 | |
791 bcs L0531 | |
792 orcc #IntMasks | |
793 ldb $0D,x | |
794 andb #$7F | |
795 stb $0D,x | |
796 L0527 os9 F$AProc | |
797 os9 F$NProc | |
798 | |
799 SFChain bsr L0543 | |
800 bcc L0527 | |
801 L0531 pshs b | |
802 stb <P$Signal,x | |
803 ldb P$State,x | |
804 orb #Condem | |
805 stb P$State,x | |
806 ldb #$FF | |
807 stb P$Prior,x | |
808 comb | |
809 puls pc,b | |
810 L0543 pshs u | |
811 ldx <D.Proc | |
812 ldu <P$PModul,x | |
813 os9 F$UnLink | |
814 ldu ,s | |
815 bsr L0553 | |
816 puls pc,u | |
817 L0553 ldx <D.Proc | |
818 pshs u,x | |
819 ldd <D.UsrSvc | |
820 std <P$SWI,x | |
821 std <P$SWI2,x | |
822 std <P$SWI3,x | |
823 clra | |
824 clrb | |
825 sta <P$Signal,x | |
826 std <P$SigVec,x | |
827 lda R$A,u | |
828 ldx R$X,u | |
829 os9 F$Link | |
830 bcc L0578 | |
831 os9 F$Load | |
832 bcs L05E7 | |
833 L0578 ldy <D.Proc | |
834 stu <P$PModul,y | |
835 cmpa #Prgrm+Objct | |
836 beq L058B | |
837 cmpa #Systm+Objct | |
838 beq L058B | |
839 comb | |
840 ldb #E$NEMod | |
841 bra L05E7 | |
842 L058B leay ,u Y = addr of module | |
843 ldu 2,s get U off stack (caller regs) | |
844 stx R$X,u | |
845 lda R$B,u | |
846 clrb | |
847 cmpd M$Mem,y compare passed mem to module's | |
848 bcc L059B branch if less than | |
849 ldd M$Mem,y | |
850 L059B addd #$0000 | |
851 bne L05A0 | |
852 L05A0 os9 F$Mem | |
853 bcs L05E7 | |
854 subd #R$Size subtract registers | |
855 subd R$Y,u subtract parameter area | |
856 bcs L05E5 | |
857 ldx R$U,u get parameter area | |
858 ldd R$Y,u get parameter size | |
859 pshs b,a | |
860 beq L05BE | |
861 leax d,x point to end of param area | |
862 L05B6 lda ,-x get byte, dec X | |
863 sta ,-y save byte in data area, dec X | |
864 cmpx R$U,u at top of param area? | |
865 bhi L05B6 | |
866 * set up registers for return of F$Fork/F$Chain | |
867 L05BE ldx <D.Proc | |
3057
1a76d7b57aa6
level 1 krn: Fix stack injection on 6309
Tormod Volden <debian.tormod@gmail.com>
parents:
3056
diff
changeset
|
868 sty -R$Size+R$X,y put in X on caller stack |
1453 | 869 leay -R$Size,y back up register size |
870 sty P$SP,x | |
871 lda P$ADDR,x | |
872 clrb | |
873 std R$U,y lowest address | |
874 sta R$DP,y set direct page | |
875 adda P$PagCnt,x | |
876 std R$Y,y | |
877 puls b,a | |
878 std R$D,y size of param area | |
879 ldb #Entire | |
880 stb R$CC,y | |
881 ldu <P$PModul,x get addr of prim. mod | |
882 ldd M$Exec,u | |
883 leau d,u | |
884 stu R$PC,y put in PC on caller reg | |
885 clrb | |
886 L05E5 ldb #E$IForkP | |
887 L05E7 puls pc,u,x | |
888 | |
2619
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
889 use fsrqmem.asm |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
890 |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
891 use fallbit.asm |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
892 |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
893 use fprsnam.asm |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
894 |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
895 use fcmpnam.asm |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
896 |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
897 use fssvc.asm |
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
898 |
2620 | 899 * Validate modules subroutine |
900 * Entry: X = address to start searching | |
901 * Y = address to stop (actually stops at Y-1) | |
902 ValMods pshs y | |
903 valloop@ lbsr ValMod | |
904 bcs valerr | |
905 ldd M$Size,x | |
906 leax d,x go past module | |
907 bra valcheck | |
908 valerr cmpb #E$KwnMod | |
909 beq valret | |
910 leax 1,x | |
911 valcheck cmpx ,s | |
912 bcs valloop@ | |
913 valret puls y,pc | |
914 | |
2619
d888412d8118
o Fixed assembler issue in init.asm
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2618
diff
changeset
|
915 |
2620 | 916 VectCode bra SWI3Jmp $0100 |
917 nop | |
918 bra SWI2Jmp $0103 | |
919 nop | |
2630
e310e8613606
Fixed earlier change from yesterday due to misunderstanding of ordering of 6809 vectors on CoCo 1/2...
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2625
diff
changeset
|
920 bra SWIJmp $0106 |
2620 | 921 nop |
2630
e310e8613606
Fixed earlier change from yesterday due to misunderstanding of ordering of 6809 vectors on CoCo 1/2...
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2625
diff
changeset
|
922 bra NMIJmp $0109 |
2620 | 923 nop |
2630
e310e8613606
Fixed earlier change from yesterday due to misunderstanding of ordering of 6809 vectors on CoCo 1/2...
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2625
diff
changeset
|
924 bra IRQJmp $010C |
2620 | 925 nop |
2630
e310e8613606
Fixed earlier change from yesterday due to misunderstanding of ordering of 6809 vectors on CoCo 1/2...
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2625
diff
changeset
|
926 bra FIRQJmp $010F |
2620 | 927 |
928 SWI3Jmp jmp [>D.SWI3] | |
929 SWI2Jmp jmp [>D.SWI2] | |
930 SWIJmp jmp [>D.SWI] | |
931 NMIJmp jmp [>D.NMI] | |
2630
e310e8613606
Fixed earlier change from yesterday due to misunderstanding of ordering of 6809 vectors on CoCo 1/2...
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2625
diff
changeset
|
932 IRQJmp jmp [>D.IRQ] |
e310e8613606
Fixed earlier change from yesterday due to misunderstanding of ordering of 6809 vectors on CoCo 1/2...
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2625
diff
changeset
|
933 FIRQJmp jmp [>D.FIRQ] |
2620 | 934 VectCSz equ *-VectCode |
935 | |
936 | |
937 SysTbl fcb F$Link | |
938 fdb FLink-*-2 | |
939 fcb F$Fork | |
940 fdb FFork-*-2 | |
941 fcb F$Chain | |
942 fdb FChain-*-2 | |
943 fcb F$Chain+SysState | |
944 fdb SFChain-*-2 | |
945 fcb F$PrsNam | |
946 fdb FPrsNam-*-2 | |
947 fcb F$CmpNam | |
948 fdb FCmpNam-*-2 | |
949 fcb F$SchBit | |
950 fdb FSchBit-*-2 | |
951 fcb F$AllBit | |
952 fdb FAllBit-*-2 | |
953 fcb F$DelBit | |
954 fdb FDelBit-*-2 | |
955 fcb F$CRC | |
956 fdb FCRC-*-2 | |
957 fcb F$SRqMem+SysState | |
958 fdb FSRqMem-*-2 | |
959 fcb F$SRtMem+SysState | |
960 fdb FSRtMem-*-2 | |
961 fcb F$AProc+SysState | |
962 fdb FAProc-*-2 | |
963 fcb F$NProc+SysState | |
964 fdb FNProc-*-2 | |
965 fcb F$VModul+SysState | |
966 fdb FVModul-*-2 | |
967 fcb F$SSvc | |
968 fdb FSSvc-*-2 | |
969 fcb $80 | |
970 | |
971 IFNE H6309 | |
972 Zoro fcb $00 | |
973 ENDC | |
974 | |
975 InitNam fcs /Init/ | |
976 | |
977 P2Nam fcs /krnp2/ | |
978 | |
2618 | 979 emod |
980 eom equ * | |
1453 | 981 |
2012 | 982 Vectors fdb SWI3 SWI3 |
983 fdb SWI2 SWI2 | |
984 fdb DUMMY FIRQ | |
985 fdb SVCIRQ IRQ | |
986 fdb SWI SWI | |
2620 | 987 fdb SVCNMI NMI |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
988 |
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
989 |
2710
ab3a2531c000
Fixed makefiles and assembly for ATARI port
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2653
diff
changeset
|
990 IFNE atari |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
991 fdb $F3FE-(*-OS9Cold) |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
992 ENDC |
2649
928b4a062979
Atari: Made mods to the kernel to boot with new Liber809 firmware
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2630
diff
changeset
|
993 |
2617
b1145d2cb659
Adding atari port folder and modifications to init and krn to accommodate
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2252
diff
changeset
|
994 eomem equ * |
1453 | 995 end |