annotate 3rdparty/booters/boot_ide.asm @ 170:23ccca4f595a

Changed
author boisy
date Thu, 11 Jul 2002 19:56:14 +0000
parents 0c12245b7bdc
children df43967d6a46
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
1 ********************************************************************
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
2 * Boot - SCSI Boot module
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
3 *
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
4 * $Id$
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
5 *
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
6 * This module allows booting from a hard drive that uses RGB-DOS
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
7 * and is controlled by a TC^3 or Ken-Ton SCSI controller.
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
8 *
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
9 * It was later modified to handle hard drives with sector sizes
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
10 * larger than 256 bytes, and works on both 256 byte and larger drives,
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
11 * so it should totally replace the old SCSI boot module.
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
12 *
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
13 * Instructions followed by +++ in the comment field were added for this fix.
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
14 *
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
15 * Ed. Comments Who YY/MM/DD
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
16 * ------------------------------------------------------------------
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
17 * ? Disassembled AD 94/06/25
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
18 * 6 Redone for IDE PTB 99/08/17
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
19 * 7 Added use of LSN bits 23-16 BGP 02/06/27
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
20
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
21
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
22 nam Boot
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
23 ttl IDE booter for LBA mode
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
24
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
25 ifp1
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
26 use defsfile
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
27 endc
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
28
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
29 tylg set Systm+Objct
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
30 atrv set ReEnt+rev
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
31 rev set 2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
32 edition set 7
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
33
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
34
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
35 * Disassembled 94/06/25 11:37:47 by Alan DeKok
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
36 * ReDone by Paul T. Barton 99/08/17, for IDE
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
37 *
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
38 Port equ $FF70 still leaves room for SSPak & SSP & MPI
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
39 RData equ 0 data 0..7
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
40 WData equ 0 data 0..7
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
41 ErrReg equ 1 Has the errors
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
42 SecCnt equ 2 always =1
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
43 SecNum equ 3
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
44 CylLow equ 4
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
45 CylHigh equ 5
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
46 DevHead equ 6 0,1,0,DEV,0,0,0,0
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
47 Status equ 7 Results of read/write
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
48 CmdIde equ 7 Commands
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
49 Latch equ 8 Latch
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
50
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
51 ReadCmd equ $20
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
52 Diagnos equ $90
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
53
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
54 BusyBit equ %10000000 BUSY=1
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
55 DrdyBit equ %01000000 drive ready=1
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
56 DscBit equ %00010000 seek finished=1
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
57 DrqBit equ %00001000 data requested=1
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
58 ErrBit equ %00000001 error_reg has it
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
59 RdyTrk equ %01010000 ready & over track
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
60 RdyDrq equ %01011000 ready w/ data
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
61 Master equ %11100000 LBA MODE
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
62 Slave equ %11110000 LBA MODE
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
63
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
64
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
65 WhchDriv equ Master Drive to use (Master or Slave)
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
66
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
67 mod eom,name,tylg,atrv,start,size
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
68
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
69 * on-stack buffer to use
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
70 org 0
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
71 btmem rmb 2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
72 btsiz rmb 2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
73 btloc rmb 3
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
74 size equ .
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
75
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
76 name fcs /Boot/
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
77 fcb edition
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
78
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
79 start
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
80 orcc #IntMasks ensure IRQ's are off.
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
81 leas -size,s
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
82
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
83 clr >$FF40 stop the disk
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
84 lbsr Init
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
85
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
86 ldd #$0001 request one byte (will round up to 1 page)
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
87 os9 F$SRqMem request the memory
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
88 bcs L00B0 exit on error
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
89
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
90 * U is implicitely the buffer address to use
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
91
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
92 clrb
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
93 ldx #$0000 X=0: got to sector #$0000
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
94 bsr GetSect load in LSN0, U = buffer start
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
95 bcs L00B0
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
96
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
97 ifne NitrOS9
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
98 lda #'0 --- loaded in LSN0
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
99 jsr <D.BtBug ---
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
100 endc
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
101
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
102 ldd <DD.BSZ,u size of the bootstrap file
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
103 std btsiz,s save it on the stack (0,s is junk)
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
104 lda <DD.BT,u get starting sector bits 23-16
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
105 ldx <DD.BT+1,u get starting sector of the bootstrap file
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
106 sta btloc,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
107 stx btloc+1,s
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
108
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
109 ldd #256 one page of memory
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
110 os9 F$SRtMem return the copy of LSN0 to free memory
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
111
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
112 ldd btsiz,s get size of boot memory to request
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
113 ifeq Level-2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
114 os9 F$BtMem ask for the boot memory
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
115 else
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
116 os9 F$SRqMem ask for the boot memory
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
117 endc
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
118 bcs L00AE no memory: exit with error
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
119
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
120 std btsiz,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
121 stu btmem,s save start address of memory allocated
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
122 ldd btsiz,s and the size of the boot memory
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
123 beq L00B0 if no memory allocated, exit
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
124 pshs d save off temp size
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
125 SectLp
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
126 ldb btloc+2,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
127 bsr GetSect read one sector
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
128 bcs L00AE if there's an error, exit
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
129
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
130 ifne NitrOS9
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
131 lda #'. dump out a period for boot debugging
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
132 jsr <D.BtBug do the debug stuff
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
133 endc
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
134
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
135 leau 256,u
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
136 leax 1,x go to the next sector
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
137 bne Sect2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
138 incb
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
139 stb btloc+2,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
140 Sect2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
141 ldd ,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
142 subd #256 take out one sector, need value in B, too.
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
143 std ,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
144 bhi SectLp loop until all sectors are read
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
145
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
146 L00A7 clrb clear carry
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
147 ldd btsiz+2,s
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
148
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
149 L00AE leas $02,s kill D off of the stack
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
150 ldx btmem,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
151 L00B0 leas size,s remove the on-stack buffer
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
152 L00BA rts
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
153
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
154 Address fdb Port
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
155
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
156 * GetSect: read a sector off of the disk
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
157 * Entry: B,X = sector number to read
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
158 * Memory: U = where to put it
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
159
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
160 GetSect
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
161 pshs b,x,y
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
162 ldy <Address,pcr grab the device address
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
163 bsr ChkBusy
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
164
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
165 RdyHuh1
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
166 lda Status,y is IDE ready for commands?
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
167 anda #DrdyBit ready ?
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
168 beq RdyHuh1 loop until Drdy =1
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
169
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
170 lda #WhchDriv
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
171 sta DevHead,y 0L0d/0hhh device=LBA
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
172 lda #$01 only one at a time
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
173 sta SecCnt,y only one at a time
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
174 stb CylHigh,y bits 23-16
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
175 tfr x,d sector number to read
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
176 sta CylLow,y hi-byte
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
177 stb SecNum,y
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
178 leax ,u where to put the sector
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
179 lda #ReadCmd read one sector
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
180 sta CmdIde,y finish process
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
181
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
182 Blk2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
183 lda Status,y is IDE ready to send?
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
184 anda #DrqBit DRQ, data request
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
185 beq Blk2 loop while DRQ =0
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
186
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
187 clr ,-s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
188 BlkLp
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
189 lda RData,y A <- IDE
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
190 ldb Latch,y
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
191 std ,x++ into RAM
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
192 inc ,s
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
193 bpl BlkLp go get the rest
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
194 puls b
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
195
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
196 lda Status,y check for error-bit
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
197 clrb
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
198 puls b,x,y,pc
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
199 * ------------------------------------------
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
200
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
201 ChkBusy
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
202 lda Status,y
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
203 anda #BusyBit 1xxx-xxxx
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
204 bne ChkBusy if =1 then loop
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
205 rts exit when BUSY =0
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
206
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
207 Init
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
208 pshs d,y
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
209 ldy <Address,pcr
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
210 bsr ChkBusy could be spinning up...
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
211 lda #Diagnos hits all drives
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
212 sta CmdIde,y ./
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
213 bsr ChkBusy wait 'til both done
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
214 clrb no errors
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
215 puls d,y,pc
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
216
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
217 ifeq Level-2
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
218 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
219 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
220 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
221 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
222 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
223 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
224 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
225 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
226 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
227 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
228 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
229 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
230 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
231 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
232 fcb 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
233 fcb 0,1,2,3,4,5,6,7
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
234 ifeq NitrOS9
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
235 fcb 0,1,2,3,4,5,6,7
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
236 endc
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
237 endc
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
238
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
239
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
240 emod
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
241 eom equ *
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
242
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
243
45
2ce754e62499 Moved booters to 3rdparty directory
boisy
parents:
diff changeset
244
93
0c12245b7bdc Fixed NitrOS-9 and OS-9 Level Two bug where Address was too far off the
boisy
parents: 45
diff changeset
245