annotate level1/modules/kernel/krn.asm @ 2018:505c8d261ef6

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