Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/boot_1773.asm @ 2152:74fb212cb659
Changelog comes from higher up
author | boisy |
---|---|
date | Wed, 14 May 2008 02:13:22 +0000 |
parents | 192496d18a9b |
children | bfe3de781ddf |
rev | line source |
---|---|
230 | 1 ******************************************************************** |
1287 | 2 * Boot - WD1773 Boot module |
230 | 3 * |
4 * $Id$ | |
5 * | |
1287 | 6 * Edt/Rev YYYY/MM/DD Modified by |
7 * Comment | |
230 | 8 * ------------------------------------------------------------------ |
1287 | 9 * 4 1985/??/?? |
10 * Original Tandy distribution version. | |
11 * | |
12 * 6 1998/10/12 Boisy G. Pitre | |
13 * Obtained from L2 Upgrade archive, has 6ms step rate and disk timeout | |
14 * changes. | |
15 * | |
16 * 6r2 2003/05/18 Boisy G. Pitre | |
17 * Added '.' output for each sector for OS-9 L2 and NitrOS9 for | |
18 * Mark Marlette (a special request :). | |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
19 * |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
20 * 6r3 2003/08/31 Robert Gault |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
21 * Put BLOB-stop code in place, changed orb #$30 to orb #$28 |
1520 | 22 * |
23 * 6r4 2004/02/17 Rodney Hamilton | |
24 * Minor optimizations, improvements in source comments | |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
25 * |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
26 * 7 2005/10/10 Boisy G. Pitre |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
27 * Added fragmented bootfile support |
2007
ee587586c0ab
Drive motor now shut off before boot module returns to kernel
boisy
parents:
1965
diff
changeset
|
28 * |
1891 | 29 * 7 2005/10/13 Robert Gault |
30 * Changed timing loops for H6309L2 so that code shortened enough to | |
31 * fit within the $1D0 boundary. | |
2007
ee587586c0ab
Drive motor now shut off before boot module returns to kernel
boisy
parents:
1965
diff
changeset
|
32 * |
ee587586c0ab
Drive motor now shut off before boot module returns to kernel
boisy
parents:
1965
diff
changeset
|
33 * 8 2006/03/03 Boisy G. Pitre |
ee587586c0ab
Drive motor now shut off before boot module returns to kernel
boisy
parents:
1965
diff
changeset
|
34 * Drive motors now turned off before returning to kernel. |
2065 | 35 * |
36 * 9 2006/05/05 Boisy G. Pitre | |
37 * Fixed bug where single sided booting was broken | |
2068 | 38 * |
39 * 2006/06/04 Boisy G. Pitre | |
40 * Removed hard-coded value of #18 when adding back sectors per track and replaced | |
41 * with the appropriate value: ddtks,u | |
230 | 42 |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
43 nam Boot |
1287 | 44 ttl WD1773 Boot module |
0 | 45 |
1287 | 46 IFP1 |
0 | 47 use defsfile |
1287 | 48 ENDC |
0 | 49 |
1520 | 50 * FDC Control Register bits at $FF40 |
51 HALTENA equ %10000000 | |
52 SIDESEL equ %01000000 DRVSEL3 if no DS drives | |
53 DDEN equ %00100000 | |
54 READY equ %00010000 READY for Tandy WD1773-based controllers | |
1516 | 55 MOTON equ %00001000 |
1520 | 56 DRVSEL2 equ %00000100 |
1516 | 57 DRVSEL1 equ %00000010 |
58 DRVSEL0 equ %00000001 | |
59 | |
1709 | 60 * Default Boot is from drive 0 |
1520 | 61 BootDr set DRVSEL0 |
1709 | 62 IFEQ DNum-1 |
63 BootDr set DRVSEL1 Alternate boot from drive 1 | |
64 ENDC | |
65 IFEQ DNum-2 | |
66 BootDr set DRVSEL2 Alternate boot from drive 2 | |
67 ENDC | |
68 IFEQ DNum-3 | |
69 BootDr set SIDESEL Alternate boot from drive 3 | |
70 ENDC | |
1520 | 71 |
72 * WD17x3 DPort offsets | |
73 CONTROL equ 0 | |
74 CMDREG equ 8+0 write-only | |
75 STATREG equ CMDREG read-only | |
1516 | 76 TRACKREG equ 8+1 |
77 SECTREG equ 8+2 | |
78 DATAREG equ 8+3 | |
79 | |
1515 | 80 * Sector Size |
81 SECTSIZE equ 256 | |
82 | |
1520 | 83 * Step Rates: |
84 * $00 = 6ms | |
85 * $01 = 12ms | |
86 * $02 = 20ms | |
87 * $03 = 30ms | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
1166
diff
changeset
|
88 STEP set $00 |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
89 |
1287 | 90 tylg set Systm+Objct |
0 | 91 atrv set ReEnt+rev |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
92 rev set $00 |
2065 | 93 edition set 9 |
230 | 94 |
0 | 95 mod eom,name,tylg,atrv,start,size |
230 | 96 |
1520 | 97 * NOTE: these are U-stack offsets, not DP |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
98 seglist rmb 2 pointer to segment list |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
99 blockloc rmb 2 pointer to memory requested |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
100 blockimg rmb 2 duplicate of the above |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
101 bootsize rmb 2 size in bytes |
1965 | 102 LSN0Ptr rmb 2 In memory LSN0 pointer |
1515 | 103 drvsel rmb 1 |
1514 | 104 currtrak rmb 1 |
1894 | 105 * Note, for optimization purposes, the following two variables |
106 * should be adjacent!! | |
1514 | 107 ddtks rmb 1 no. of sectors per track |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
108 ddfmt rmb 1 |
1520 | 109 side rmb 1 side 2 flag |
0 | 110 size equ . |
111 | |
112 name fcs /Boot/ | |
230 | 113 fcb edition |
0 | 114 |
1894 | 115 * Common booter-required defines |
116 LSN24BIT equ 0 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
117 FLOPPY equ 1 |
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
118 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
119 * HWInit - Initialize the device |
1894 | 120 * Entry: Y = hardware address |
121 * Exit: Carry Clear = OK, Set = Error | |
122 * B = error (Carry Set) | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
123 HWInit |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
124 lda #%11010000 ($D0) Force Interrupt (stops any command in progress) |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
125 sta CMDREG,y write command to command register |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
126 lbsr Delay2 delay 54~ |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
127 lda STATREG,y clear status register |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
128 lda #$FF |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
129 sta currtrak,u set current track to 255 |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
130 leax >NMIRtn,pcr point to NMI routine |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
131 IFGT Level-1 |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
132 stx <D.NMI save address |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
133 ELSE |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
134 stx >D.XNMI+1 save address |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
135 lda #$7E |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
136 sta >D.XNMI |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
137 ENDC |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
138 lda #MOTON turn on drive motor |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
139 ora WhichDrv,pcr |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
140 sta CONTROL,y |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
141 * MOTOR ON spin-up delay loop (~307 mSec) |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
142 IFGT Level-1 |
1891 | 143 IFNE H6309 |
144 ldd #$F000 3 cycles | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
145 ELSE |
1891 | 146 ldd #50000 |
147 ENDC | |
148 ELSE | |
149 ldd #25000 | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
150 ENDC |
1891 | 151 * IFNE H6309 |
152 * nop | |
153 * ENDC | |
154 L003A nop 1 cycles | |
155 nop 1 cycles | |
156 * IFNE H6309 | |
157 * nop | |
158 * nop | |
159 * nop | |
160 * ENDC | |
161 subd #$0001 4 cycles | |
162 bne L003A 3 cycles | |
1894 | 163 * HWTerm - Terminate the device |
164 * Entry: Y = hardware address | |
165 * Exit: Carry Clear = OK, Set = Error | |
166 * B = error (Carry Set) | |
167 HWTerm clrb | |
2007
ee587586c0ab
Drive motor now shut off before boot module returns to kernel
boisy
parents:
1965
diff
changeset
|
168 stb CONTROL,y turn off all drive motors (BGP) |
1894 | 169 rts |
170 | |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
171 |
2049 | 172 use boot_common.asm |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
173 |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
174 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
175 DoDDns lda #DDEN+MOTON double density enable and motor on |
1893
1827bb446188
Modified booters to use new boot strategy with boot_common.asm
boisy
parents:
1891
diff
changeset
|
176 ora WhichDrv,pcr OR in selected drive |
1516 | 177 sta drvsel,u save drive selection byte |
178 clr currtrak,u clear current track | |
0 | 179 lda #$05 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
180 lbsr SetTrak Set the track to the head we want |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
181 ldb #0+STEP RESTORE cmd |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
182 lbra Talk2FDC send command and wait for it to complete |
0 | 183 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
184 * HWRead - Read a 256 byte sector from the device |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
185 * Entry: Y = hardware address |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
186 * B = bits 23-16 of LSN |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
187 * X = bits 15-0 of LSN |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
188 * blockloc,u = ptr to 256 byte sector |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
189 * Exit: X = ptr to data (i.e. ptr in blockloc,u) |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
190 HWRead lda #$91 |
1515 | 191 bsr L00DF else branch subroutine |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
192 bcs HWRRts branch if error |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
193 ldx blockloc,u get buffer pointer in X for caller |
1287 | 194 clrb |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
195 HWRRts rts |
1287 | 196 |
197 L00D7 bcc L00DF | |
0 | 198 pshs x,b,a |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
199 bsr DoDDns |
0 | 200 puls x,b,a |
1515 | 201 L00DF pshs x,b,a save LSN, command |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
202 bsr ReadSect |
1520 | 203 puls x,b,a restore LSN, command |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
204 bcc HWRRts branch if OK |
1287 | 205 lsra |
206 bne L00D7 | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
207 ReadSect bsr Seek2Sect seek to the sector stored in X |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
208 bcs HWRRts if error, return to caller |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
209 ldx blockloc,u get address of buffer to fill |
1515 | 210 orcc #IntMasks mask interrupts |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
211 pshs x save X |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
212 ldx #$FFFF |
1516 | 213 ldb #%10000000 ($80) READ SECTOR command |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
214 stb CMDREG,y write to command register |
1520 | 215 ldb drvsel,u (DDEN+MOTORON+BootDr) |
216 * NOTE: The 1773 FDC multiplexes the write precomp enable and ready | |
217 * signals on the ENP/RDY pin, so the READY bit must always be ON for | |
218 * read and seek commands. (from the FD502 FDC Service Manual) | |
219 orb #DDEN+READY set DDEN+READY bits ($30) | |
220 tst side,u are we on side 2? | |
1287 | 221 beq L0107 |
1520 | 222 orb #SIDESEL set side 2 bit |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
223 L0107 stb CONTROL,y |
1520 | 224 lbsr Delay2 delay 54~ |
225 orb #HALTENA HALT enable ($80) | |
226 * lda #%00000010 RESTORE cmd ($02) | |
1516 | 227 *L0111 bita >DPort+STATREG |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
228 * bne L0123 |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
229 * leay -$01,y |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
230 * bne L0111 |
1515 | 231 * lda drvsel,u |
1520 | 232 * sta >DPort+CONTROL |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
233 * puls y |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
234 * bra L0138 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
235 stb CONTROL,y |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
236 nop |
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
237 nop |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
238 * bra L0123 |
1516 | 239 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
240 ldx ,s get X saved earlier |
1516 | 241 * Sector READ Loop |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
242 L0123 lda DATAREG,y read from WD DATA register |
0 | 243 sta ,x+ |
1520 | 244 * stb >DPort+CONTROL |
1291
92e9f7416fc9
Added BLOB-stop fix, changed one line as per Robert Gault's suggestion
boisy
parents:
1287
diff
changeset
|
245 nop |
1287 | 246 bra L0123 |
1520 | 247 * RVH NOTE: This ONLY works for double density boot disks! The Tandy |
248 * controllers internally gate HALT enable with the DDEN bit, which | |
249 * means that reading a single-density boot disk will not generate the | |
250 * NMI signal needed to exit the read loop! Single-density disks must | |
251 * use a polled I/O loop instead. | |
1515 | 252 NMIRtn leas R$Size,s adjust stack |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
253 puls x |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
254 ldb STATREG,y read WD STATUS register |
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
255 bitb #$9C any errors? |
1516 | 256 * bitb #$04 LOST DATA bit set? |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
257 beq r@ branch if not |
1516 | 258 * beq ChkErr branch if not |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
259 L0138 comb else we will return error |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
260 ldb #E$Read |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
261 r@ rts |
0 | 262 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
263 Seek2Sect |
2065 | 264 lda #MOTON permit alternate drives |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
265 ora WhichDrv,pcr permit alternate drives |
1516 | 266 sta drvsel,u save byte to static mem |
1520 | 267 clr side,u start on side 1 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
268 tfr x,d move LSN into D |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
269 cmpd #$0000 zero? |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
270 beq L016C branch if so |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
271 clr ,-s else clear space on stack |
2065 | 272 pshs a |
273 lda ddfmt,u | |
274 bita #FMT.SIDE double sided disk? | |
275 puls a | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
276 beq SnglSid branch if not |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
277 bra DblSid |
1515 | 278 * Double-sided code |
1520 | 279 L0152 com side,u flag side 2 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
280 bne DblSid |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
281 inc ,s |
2065 | 282 DblSid subb ddtks,u |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
283 sbca #$00 |
1287 | 284 bcc L0152 |
285 bra L0168 | |
286 L0160 inc ,s | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
287 SnglSid subb ddtks,u subtract sectors per track from B |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
288 sbca #$00 |
1287 | 289 bcc L0160 |
2068 | 290 L0168 addb ddtks,u add sectors per track |
291 puls a get current track indicator off of stack | |
1287 | 292 L016C incb |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
293 stb SECTREG,y save in sector register |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
294 SetTrak ldb currtrak,u get current track in B |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
295 stb TRACKREG,y save in track register |
1520 | 296 cmpa currtrak,u same as A? |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
297 beq rtsok branch if so |
1514 | 298 sta currtrak,u |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
299 sta DATAREG,y |
1516 | 300 ldb #$10+STEP SEEK command |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
301 bsr Talk2FDC send command to controller |
0 | 302 pshs x |
1520 | 303 * Seek Delay |
304 ldx #$222E delay ~39 mSec (78mS L1) | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
305 SeekDly leax -$01,x |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
306 bne SeekDly |
0 | 307 puls x |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
308 rtsok clrb |
1287 | 309 rts |
1516 | 310 |
311 *ChkErr bitb #$98 evaluate WD status (READY, RNF, CRC err) | |
312 * bne L0138 | |
313 * clrb | |
314 * rts | |
315 | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
316 Talk2FDC bsr DoCMD issue FDC cmd, wait 54~ |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
317 FDCLoop ldb STATREG,y get status |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
318 bitb #$01 still BUSY? |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
319 bne FDCLoop loop until command completes |
1287 | 320 rts |
1516 | 321 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
322 * Issue command and wait 54 clocks |
1520 | 323 * Controller requires a min delay of 14uS (DD) or 28uS (SD) |
324 * following a command write before status register is valid | |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
325 DoCMD bsr SelNSend |
1515 | 326 * Delay branches |
1520 | 327 * 54 clock delay including bsr (=30uS/L2,60us/L1) |
1891 | 328 * H6309 code changed to reduce code size, RG |
329 IFEQ H6309 | |
1515 | 330 Delay2 |
331 lbsr Delay3 | |
332 Delay3 | |
333 lbsr Delay4 | |
334 Delay4 | |
1891 | 335 ELSE |
336 Delay2 lda #5 3 cycles | |
337 Delay3 exg a,a 5 cycles | 10*5 | |
338 deca 2 cycles | | |
339 bne Delay3 3 cycles | | |
1287 | 340 ENDC |
341 rts | |
210
6bf55704c623
Boot is adapted from OS-9 Level Two boot module, now boots from
boisy
parents:
201
diff
changeset
|
342 |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
343 * Select And Send |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
344 * Entry: B = command byte |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
345 SelNSend lda drvsel,u |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
346 sta CONTROL,y |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
347 stb CMDREG,y |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
348 rts |
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
349 |
1166 | 350 IFGT Level-1 |
1287 | 351 * Filler to get $1D0 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
352 Filler fill $39,$1D0-3-2-1-* |
1166 | 353 ENDC |
0 | 354 |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
355 Address fdb DPort |
1886
b151cc54904e
Added fragmented bootfile support. Added more labels and comments
boisy
parents:
1882
diff
changeset
|
356 WhichDrv fcb BootDr |
1882
c96f594fe098
Added fragmented boot support... needs additional testing.
boisy
parents:
1709
diff
changeset
|
357 |
0 | 358 emod |
359 eom equ * | |
48 | 360 end |