annotate level1/modules/kernel/krn.asm @ 2152:74fb212cb659

Changelog comes from higher up
author boisy
date Wed, 14 May 2008 02:13:22 +0000
parents 0cf8513d33d7
children 41a797492324
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
2020
9dafc4b4c6dd Mild format changes
boisy
parents: 2018
diff changeset
108 fcb F$Chain+SysState
1453
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
2020
9dafc4b4c6dd Mild format changes
boisy
parents: 2018
diff changeset
122 fcb F$SRqMem+SysState
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
123 fdb FSRqMem-*-2
2020
9dafc4b4c6dd Mild format changes
boisy
parents: 2018
diff changeset
124 fcb F$SRtMem+SysState
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
125 fdb FSRtMem-*-2
2020
9dafc4b4c6dd Mild format changes
boisy
parents: 2018
diff changeset
126 fcb F$AProc+SysState
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
127 fdb FAProc-*-2
2020
9dafc4b4c6dd Mild format changes
boisy
parents: 2018
diff changeset
128 fcb F$NProc+SysState
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
129 fdb FNProc-*-2
2020
9dafc4b4c6dd Mild format changes
boisy
parents: 2018
diff changeset
130 fcb F$VModul+SysState
1453
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
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
254 leax >Poll,pcr point to default poll routine
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
255 stx <D.Poll and save it
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
256 leax >Clock,pcr get default clock routine
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
257 stx <D.Clock and save it to the vector
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
258 stx <D.AltIRQ and in the alternate IRQ vector
1453
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
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
311 UsrIRQ leay <DoIRQPoll,pcr
1453
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
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
316 * Note that we are putting the system state service routine address into
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
317 * the D.SWI2 vector. If a system call is made while we are in system state,
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
318 * D.SWI2 will be vectored to the system state service routine vector.
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
319 ldd <D.SysSvc get system state system call vector
775551ca320f Added comments
boisy
parents: 2006
diff changeset
320 std <D.SWI2 store in D.SWI2
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
321 * The same comment above applies to the IRQ service vector.
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
322 ldd <D.SysIRQ get system IRQ vector
775551ca320f Added comments
boisy
parents: 2006
diff changeset
323 std <D.SvcIRQ store in D.SvcIRQ
775551ca320f Added comments
boisy
parents: 2006
diff changeset
324 leau ,s point U to S
775551ca320f Added comments
boisy
parents: 2006
diff changeset
325 stu P$SP,x and save in process P$SP
775551ca320f Added comments
boisy
parents: 2006
diff changeset
326 lda P$State,x get state field in proc desc
775551ca320f Added comments
boisy
parents: 2006
diff changeset
327 ora #SysState mark process to be in system state
775551ca320f Added comments
boisy
parents: 2006
diff changeset
328 sta P$State,x store it
775551ca320f Added comments
boisy
parents: 2006
diff changeset
329 jmp ,y jump to ,y
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
330
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
331 DoIRQPoll
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
332 jsr [>D.Poll] call vectored polling routine
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
333 bcc L01BD branch if carry clear
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
334 ldb ,s get the CC on the stack
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
335 orb #IRQMask mask IRQs
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
336 stb ,s and save it back
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
337 L01BD lbra ActivateProc
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
338
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
339
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
340
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
341 SysIRQ clra
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
342 tfr a,dp make DP be 0
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
343 jsr [>D.Poll] call the vectored IRQ polling routine
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
344 bcc L01CF branch if carry is clear
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
345 ldb ,s get the CC on the stack
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
346 orb #IRQMask mask IRQs
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
347 stb ,s and save it back
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
348 L01CF rti
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
349
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
350 Poll comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
351 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
352
2017
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
353 * Default clock routine - executed 60 times/sec
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
354 Clock ldx <D.SProcQ get pointer to sleeping proc queue
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
355 beq L01FD branch if no process sleeping
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
356 lda P$State,x get state of that process
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
357 bita #TimSleep timed sleep?
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
358 beq L01FD branch if clear
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
359 ldu P$SP,x else get process stack pointer
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
360 ldd R$X,u get the value of the process X reg
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
361 subd #$0001 subtract one from it
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
362 std P$SP,u and store it
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
363 bne L01FD branch if not zero (still will sleep)
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
364 L01E7 ldu P$Queue,x get process current queue pointer
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
365 bsr L021A
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
366 leax ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
367 beq L01FB
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
368 lda P$State,x get process state byte
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
369 bita #TimSleep bit set?
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
370 beq L01FB branch if not
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
371 ldu P$SP,x get process stack pointer
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
372 ldd R$X,u then get process X register
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
373 beq L01E7 branch if zero
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
374 L01FB stx <D.SProcQ
2017
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
375 L01FD dec <D.Slice decrement slice
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
376 bne ClockRTI if not 0, exit ISR
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
377 lda <D.TSlice else get default time slice
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
378 sta <D.Slice and save it as slice
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
379 ldx <D.Proc get proc desc of current proc
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
380 beq ClockRTI if none, exit ISR
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
381 lda P$State,x get process state
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
382 ora #TimOut set timeout bit
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
383 sta P$State,x and store back
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
384 bpl L0212 branch if not system state
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
385 ClockRTI rti
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
386
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
387 L0212 leay >ActivateProc,pcr
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
388 bra URtoSs
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
389
2006
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
390
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
391 *FAProc ldx R$X,u Get ptr to process to activate
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
392 *L0D11 clrb
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
393 * pshs cc,b,x,y,u
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
394 * lda P$Prior,x Get process priority
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
395 * sta P$Age,x Save it as age (How long it's been around)
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
396 * orcc #IntMasks Shut down IRQ's
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
397 * ldu #(D.AProcQ-P$Queue) Get ptr to active process queue
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
398 * bra L0D29 Go through the chain
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
399 ** Update active process queue
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
400 ** X=Process to activate
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
401 ** U=Current process in queue links
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
402 *L0D1F inc P$Age,u update current process age
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
403 * bne L0D25 wrap?
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
404 * dec P$Age,u yes, reset it to max.
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
405 *L0D25 cmpa P$Age,u match process ages??
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
406 * bhi L0D2B no, skip update
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
407 *L0D29 leay ,u point Y to current process
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
408 *L0D2B ldu P$Queue,u get pointer to next process in chain
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
409 * bne L0D1F Still more in chain, keep going
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
410 * ldd P$Queue,y
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
411 * stx P$Queue,y save new process to chain
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
412 * std P$Queue,x
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
413 * puls cc,b,x,y,u,pc
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
414
31ca1a8e9a3a Added comments
boisy
parents: 1663
diff changeset
415
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
416 use faproc.asm
2018
505c8d261ef6 Futher division of krn, commnents added
boisy
parents: 2017
diff changeset
417
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
418 * User-State system call entry point
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
419 *
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
420 * All system calls made from user-state will go through this code.
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
421 UsrSvc leay <MakeSysCall,pcr
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
422 orcc #IntMasks
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
423 lbra URtoSs
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
424
2023
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
425 MakeSysCall
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
426 andcc #^IntMasks unmask IRQ/FIRQ
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
427 ldy <D.UsrDis get pointer to user syscall dispatch table
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
428 bsr DoSysCall go do the system call
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
429 ActivateProc
dbaeafb56535 Added comments and renamed some labels
boisy
parents: 2020
diff changeset
430 ldx <D.Proc get current proc desc
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
431 beq FNProc branch to FNProc if none
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
432 orcc #IntMasks mask interrupts
775551ca320f Added comments
boisy
parents: 2006
diff changeset
433 ldb P$State,x get state value in proc desc
775551ca320f Added comments
boisy
parents: 2006
diff changeset
434 andb #^SysState turn off system state flag
775551ca320f Added comments
boisy
parents: 2006
diff changeset
435 stb P$State,x save state value
775551ca320f Added comments
boisy
parents: 2006
diff changeset
436 bitb #TimOut timeout bit set?
775551ca320f Added comments
boisy
parents: 2006
diff changeset
437 beq L02D1 branch if not
775551ca320f Added comments
boisy
parents: 2006
diff changeset
438 andb #^TimOut else turn off bit
775551ca320f Added comments
boisy
parents: 2006
diff changeset
439 stb P$State,x in state value
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
440 bsr L021A
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
441 bra FNProc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
442
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
443 * System-State system call entry point
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
444 SysSvc clra
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
445 tfr a,dp set direct page to 0
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
446 leau ,s point U to SP
775551ca320f Added comments
boisy
parents: 2006
diff changeset
447 ldy <D.SysDis get system state dispatch table ptr
775551ca320f Added comments
boisy
parents: 2006
diff changeset
448 bsr DoSysCall
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
449 rti
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
450
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
451 * Entry: Y = Dispatch table (user or system)
775551ca320f Added comments
boisy
parents: 2006
diff changeset
452 DoSysCall
775551ca320f Added comments
boisy
parents: 2006
diff changeset
453 pshs u
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
454 ldx R$PC,u point X to PC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
455 ldb ,x+ get func code at X
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
456 stx R$PC,u restore updated PC
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
457 lslb high bit set?
775551ca320f Added comments
boisy
parents: 2006
diff changeset
458 bcc L0288 branch if not (non I/O call)
775551ca320f Added comments
boisy
parents: 2006
diff changeset
459 rorb else restore B (its an I/O call)
775551ca320f Added comments
boisy
parents: 2006
diff changeset
460 ldx -2,y grab IOMan vector
775551ca320f Added comments
boisy
parents: 2006
diff changeset
461 * 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
462 bra L0290
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
463 L0288 cmpb #$37*2
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
464 bcc L02A7
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
465 ldx b,y X = addr of system call
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
466 beq L02A7
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
467 L0290 jsr ,x jsr into system call
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
468 L0292 puls u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
469 tfr cc,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
470 bcc FixCC branch if no error
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
471 stb R$B,u store error code
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
472 FixCC ldb R$CC,u get caller's CC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
473 andb #^(Negative+Zero+TwosOvfl+Carry)
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
474 stb R$CC,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
475 anda #Negative+Zero+TwosOvfl+Carry
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
476 ora R$CC,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
477 sta R$CC,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
478 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
479 L02A7 comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
480 ldb #E$UnkSvc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
481 bra L0292
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
482
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
483 * no signal handler, exit with signal value as exit code
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
484 L02AC ldb P$State,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
485 orb #SysState
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
486 stb P$State,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
487 ldb <P$Signal,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
488 andcc #^(IntMasks)
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
489 os9 F$Exit
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
490
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
491 FNProc clra
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
492 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
493 std <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
494 bra L02C2
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
495 * execution goes here when there are no active processes
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
496 L02C0 cwai #^(IntMasks)
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
497 L02C2 orcc #IntMasks
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
498 ldx <D.AProcQ get next active process
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
499 beq L02C0 CWAI if none
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
500 ldd P$Queue,x get queue ptr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
501 std <D.AProcQ store in Active Q
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
502 stx <D.Proc store in current process
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
503 lds P$SP,x get process' stack ptr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
504 L02D1 ldb P$State,x get state
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
505 bmi L0308 branch if system state
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
506 bitb #Condem process condemned?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
507 bne L02AC branch if so...
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
508 ldb <P$Signal,x get signal no
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
509 beq L02FF branch if none
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
510 decb decrement
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
511 beq L02FC branch if wake up
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
512 ldu <P$SigVec,x get signal handler addr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
513 beq L02AC branch if none
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
514 ldy <P$SigDat,x get data addr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
515 ldd $06,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
516 pshs u,y,b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
517 ldu $0A,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
518 lda <P$Signal,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
519 ldb $09,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
520 tfr d,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
521 ldd $06,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
522 pshs u,y,b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
523 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
524 L02FC stb <P$Signal,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
525 L02FF ldd <P$SWI2,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
526 std <D.SWI2
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
527 ldd <D.UsrIRQ
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
528 std <D.SvcIRQ
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
529 L0308 rti
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
530
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
531 FLink pshs u save caller regs
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
532 ldd R$A,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
533 ldx R$X,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
534 lbsr L0443
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
535 bcc FLinkOK
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
536 ldb #E$MNF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
537 bra L033D
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
538 * U = module dir entry
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
539 FLinkOK ldy ,u get module ptr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
540 ldb M$Revs,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
541 bitb #ReEnt reentrant?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
542 bne L032A branch if so
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
543 tst $02,u link count zero?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
544 beq L032A yep, ok to link to nonreent
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
545 comb else module is busy
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
546 ldb #E$ModBsy
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
547 bra L033D
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
548 L032A inc $02,u increment link count
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
549 ldu ,s get caller regs from stack
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
550 stx R$X,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
551 sty R$U,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
552 ldd M$Type,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
553 std R$D,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
554 ldd M$IDSize,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
555 leax d,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
556 stx R$Y,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
557 L033D puls pc,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
558
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
559 FVModul pshs u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
560 ldx R$X,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
561 bsr ValMod
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
562 puls y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
563 stu R$U,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
564 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
565 * X = address of module to validate
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
566 ValMod bsr ChkMHCRC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
567 bcs L039A
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
568 lda M$Type,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
569 pshs x,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
570 ldd M$Name,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
571 leax d,x X = addr of name in mod
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
572 puls a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
573 lbsr L0443
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
574 puls x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
575 bcs L039B
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
576 ldb #E$KwnMod
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
577 cmpx ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
578 beq L03A1
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
579 lda M$Revs,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
580 anda #RevsMask
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
581 pshs a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
582 ldy ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
583 lda M$Revs,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
584 anda #RevsMask
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
585 cmpa ,s+ same revision as other mod?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
586 bcc L03A1
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
587 pshs y,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
588 ldb M$Size,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
589 bne L0395
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
590 ldx ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
591 cmpx <D.BTLO
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
592 bcc L0395
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
593 ldd $02,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
594 addd #$00FF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
595 tfr a,b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
596 clra
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
597 tfr d,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
598 ldb ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
599 ldx <D.FMBM
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
600 os9 F$DelBit
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
601 clr $02,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
602 L0395 puls y,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
603 L0397 stx ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
604 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
605 L039A rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
606 L039B leay ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
607 bne L0397
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
608 ldb #E$DirFul
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
609 L03A1 coma
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 * check module header and CRC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
613 * X = address of potential module
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
614 ChkMHCRC ldd ,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
615 cmpd #M$ID12 sync bytes?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
616 bne L03B1 nope, not a module here
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
617 leay M$Parity,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
618 bsr ChkMHPar check header parity
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
619 bcc L03B5 branch if ok
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
620 L03B1 comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
621 ldb #E$BMID
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
622 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
623
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
624 L03B5
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
625 * Following 4 lines added to support no CRC checks - 2002/07/21
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
626 lda <D.CRC is CRC checking on?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
627 bne DoCRCCk branch if so
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
628 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
629 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
630
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
631 DoCRCCk pshs x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
632 ldy M$Size,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
633 bsr ChkMCRC checkm module CRC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
634 puls pc,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
635 * check module header parity
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
636 * Y = pointer to parity byte
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
637 ChkMHPar pshs y,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
638 clra
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
639 ChkM010 eora ,x+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
640 cmpx 2,s compare to addr of M$Parity
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
641 bls ChkM010
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
642 cmpa #$FF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
643 puls pc,y,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
644 * X = address of potential module
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
645 * Y = size of module
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
646 ChkMCRC ldd #$FFFF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
647 pshs b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
648 pshs b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
649 leau 1,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
650 L03D4 lda ,x+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
651 bsr CRCAlgo
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
652 leay -1,y dec Y (size of module)
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
653 bne L03D4 continue
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
654 clr -1,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
655 lda ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
656 cmpa #CRCCon1
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
657 bne L03EC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
658 ldd 1,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
659 cmpd #CRCCon23
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
660 beq L03EF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
661 L03EC comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
662 ldb #E$BMCRC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
663 L03EF puls pc,y,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
664
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
665 use fcrc.asm
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
666
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
667 L0443 ldu #$0000
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
668 tfr a,b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
669 anda #TypeMask
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
670 andb #LangMask
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
671 pshs u,y,x,b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
672 bsr EatSpace
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
673 cmpa #PDELIM pathlist char?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
674 beq L049C branch if so
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
675 lbsr ParseNam parse name
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
676 bcs L049D return if error
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
677 ldu <D.ModDir
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
678 L045B pshs u,y,b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
679 ldu ,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
680 beq L048B
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
681 ldd $04,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
682 leay d,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
683 ldb ,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
684 lbsr L07AB
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
685 bcs L0493
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
686 lda $05,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
687 beq L0476
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
688 eora $06,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
689 anda #$F0
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
690 bne L0493
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
691 L0476 lda $06,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
692 beq L0480
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
693 eora $06,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
694 anda #$0F
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
695 bne L0493
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
696 L0480 puls u,x,b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
697 stu $06,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
698 bsr EatSpace
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
699 stx $02,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
700 clra
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
701 bra L049D
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
702 L048B ldd $0B,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
703 bne L0493
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
704 ldd $03,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
705 std $0B,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
706 L0493 puls u,y,b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
707 leau $04,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
708 cmpu <D.ModDir+2
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
709 bcs L045B
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
710 L049C comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
711 L049D puls pc,u,y,x,b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
712
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
713 EatSpace lda #C$SPAC
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
714 EatSpc10 cmpa ,x+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
715 beq EatSpc10
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
716 lda ,-x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
717 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
718
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
719 FFork ldx <D.PrcDBT
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
720 os9 F$All64
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
721 bcs L0517
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
722 ldx <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
723 pshs x save calling proc desc on stack
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
724 ldd P$User,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
725 std P$User,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
726 lda P$Prior,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
727 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
728 std P$Prior,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
729 ldb #SysState
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
730 stb P$State,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
731 sty <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
732 ldd <P$NIO,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
733 std <P$NIO,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
734 ldd <P$NIO+2,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
735 std <P$NIO+2,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
736 leax <P$DIO,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
737 leay <P$DIO,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
738 ldb #DefIOSiz
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
739 * copy I/O stuff from parent to child
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
740 L04D7 lda ,x+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
741 sta ,y+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
742 decb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
743 bne L04D7
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
744 * X/Y = address of path table in respective proc desc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
745 * Dup stdin/stdout/stderr
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
746 ldb #$03
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
747 L04E0 lda ,x+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
748 os9 I$Dup
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
749 bcc L04E8
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
750 clra
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
751 L04E8 sta ,y+
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
752 decb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
753 bne L04E0
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
754 bsr L0553
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
755 bcs L050C
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
756 puls y get parent proc desc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
757 sty <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
758 lda P$ID,x get ID of new process
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
759 sta R$A,u store in caller's A
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
760 ldb P$CID,y get child id of parent
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
761 sta P$CID,y store new proc in parent's CID
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
762 lda P$ID,y get ID of parent
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
763 std P$PID,x store in child proc desc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
764 ldb P$State,x update state of child
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
765 andb #^SysState
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
766 stb P$State,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
767 os9 F$AProc insert child in active Q
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
768 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
769 L050C pshs b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
770 os9 F$Exit
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
771 comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
772 puls x,b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
773 stx <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
774 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
775 L0517 comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
776 ldb #E$PrcFul
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
777 rts
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
778
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
779 FChain bsr L0543
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
780 bcs L0531
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
781 orcc #IntMasks
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
782 ldb $0D,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
783 andb #$7F
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
784 stb $0D,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
785 L0527 os9 F$AProc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
786 os9 F$NProc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
787
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
788 SFChain bsr L0543
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
789 bcc L0527
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
790 L0531 pshs b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
791 stb <P$Signal,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
792 ldb P$State,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
793 orb #Condem
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
794 stb P$State,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
795 ldb #$FF
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
796 stb P$Prior,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
797 comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
798 puls pc,b
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
799 L0543 pshs u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
800 ldx <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
801 ldu <P$PModul,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
802 os9 F$UnLink
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
803 ldu ,s
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
804 bsr L0553
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
805 puls pc,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
806 L0553 ldx <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
807 pshs u,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
808 ldd <D.UsrSvc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
809 std <P$SWI,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
810 std <P$SWI2,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
811 std <P$SWI3,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
812 clra
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
813 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
814 sta <P$Signal,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
815 std <P$SigVec,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
816 lda R$A,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
817 ldx R$X,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
818 os9 F$Link
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
819 bcc L0578
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
820 os9 F$Load
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
821 bcs L05E7
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
822 L0578 ldy <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
823 stu <P$PModul,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
824 cmpa #Prgrm+Objct
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
825 beq L058B
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
826 cmpa #Systm+Objct
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
827 beq L058B
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
828 comb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
829 ldb #E$NEMod
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
830 bra L05E7
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
831 L058B leay ,u Y = addr of module
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
832 ldu 2,s get U off stack (caller regs)
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
833 stx R$X,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
834 lda R$B,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
835 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
836 cmpd M$Mem,y compare passed mem to module's
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
837 bcc L059B branch if less than
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
838 ldd M$Mem,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
839 L059B addd #$0000
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
840 bne L05A0
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
841 L05A0 os9 F$Mem
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
842 bcs L05E7
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
843 subd #R$Size subtract registers
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
844 subd R$Y,u subtract parameter area
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
845 bcs L05E5
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
846 ldx R$U,u get parameter area
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
847 ldd R$Y,u get parameter size
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
848 pshs b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
849 beq L05BE
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
850 leax d,x point to end of param area
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
851 L05B6 lda ,-x get byte, dec X
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
852 sta ,-y save byte in data area, dec X
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
853 cmpx R$U,u at top of param area?
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
854 bhi L05B6
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
855 * set up registers for return of F$Fork/F$Chain
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
856 L05BE ldx <D.Proc
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
857 sty -$08,y put in X on caller stack
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
858 leay -R$Size,y back up register size
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
859 sty P$SP,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
860 lda P$ADDR,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
861 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
862 std R$U,y lowest address
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
863 sta R$DP,y set direct page
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
864 adda P$PagCnt,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
865 std R$Y,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
866 puls b,a
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
867 std R$D,y size of param area
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
868 ldb #Entire
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
869 stb R$CC,y
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
870 ldu <P$PModul,x get addr of prim. mod
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
871 ldd M$Exec,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
872 leau d,u
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
873 stu R$PC,y put in PC on caller reg
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
874 clrb
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
875 L05E5 ldb #E$IForkP
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
876 L05E7 puls pc,u,x
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
877
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
878 use fsrqmem.asm
2017
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
879
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
880 use fallbit.asm
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
881
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
882 use fprsnam.asm
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
883
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
884 use fcmpnam.asm
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
885
2049
0cf8513d33d7 Updated for new structure
boisy
parents: 2032
diff changeset
886 use fssvc.asm
2017
f273e28ea8d0 Breaking kernel down into individual files... added comments
boisy
parents: 2012
diff changeset
887
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
888 emod
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
889 eom equ *
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
890
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
891 fdb Clock
2012
775551ca320f Added comments
boisy
parents: 2006
diff changeset
892 Vectors fdb SWI3 SWI3
775551ca320f Added comments
boisy
parents: 2006
diff changeset
893 fdb SWI2 SWI2
775551ca320f Added comments
boisy
parents: 2006
diff changeset
894 fdb DUMMY FIRQ
775551ca320f Added comments
boisy
parents: 2006
diff changeset
895 fdb SVCIRQ IRQ
775551ca320f Added comments
boisy
parents: 2006
diff changeset
896 fdb SWI SWI
775551ca320f Added comments
boisy
parents: 2006
diff changeset
897 fdb DUMMY NMI
1453
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
898
5dbf908c1483 Kernel and KernelP2 moved to krnl/
boisy
parents:
diff changeset
899 end