annotate 3rdparty/drivers/ide/detect_ide2.1.bas @ 749:ec1909ff0764

Updated Makefile
author boisy
date Wed, 08 Jan 2003 05:09:53 +0000
parents 6641a883d6b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 PROCEDURE IDE_detect
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 (* IDE identify program
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 (* Do not have IDE driver enabled
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 (* while running this program!
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 (* Copyright 1996 By Jim Hathaway
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 (* Revised version 2 by L. Curtis Boyle, May, 1999
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
7 (* Version 2.1 by L. Curtis Boyle, Oct. 13/1999 - to handle ATAPI
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 (* Slight changes Oct. 20/1999 to show # of sectors in both hex & decimal
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9 (* Changed to make it easier for changing controller address, and for handling
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 (* both the Master & Slave drives
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 (* - also bug fix (LBA mode was not detected correctly)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 DIM bignum:REAL
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 DIM prompt:STRING[2]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14 DIM driveaccessmsg(4),driveerrors(5):STRING[32]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 DIM ide(512):BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 (* 0=haven't checked yet, 1=found & ok, 2=not found, 3=found & error
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 DIM drivefound(2):INTEGER
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 DIM ready:INTEGER
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 DIM temp:BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 DIM counter:INTEGER
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 DIM driveselect(2):BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 DIM drivenumber:INTEGER
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23 DIM baseaddress:REAL
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 DIM idestatus:BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 DIM ideerror:BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 DIM undon(2):BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 DIM undoff(2):BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 DIM invon(2):BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 DIM invoff(2):BYTE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 undon(1)=$1f
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31 undon(2)=$22
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 undoff(1)=$1f
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 undoff(2)=$23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 invon(1)=$1f
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 invoff(1)=$1f
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 invon(2)=$20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 invoff(2)=$21
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 driveaccessmsg(1)="Has not been checked"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 driveaccessmsg(2)="Found & Ok"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 driveaccessmsg(3)="Not found"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 driveaccessmsg(4)="Found with error"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 drivefound(1)=0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 drivefound(2)=0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 driveerrors(1)="No error detected"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45 driveerrors(2)="Formatter device error"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 driveerrors(3)="Sector buffer error"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47 driveerrors(4)="EC circuitry error"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48 driveerrors(5)="Controlling microprocessor error"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 driveselect(1)=$A0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 driveselect(2)=$B0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 PRINT CHR$(12);"IDE Detection program Version 2.1"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 PRINT "Version 1.0 Copyright 1996 by Jim Hathaway"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54 PRINT "Version 2.1 Copyright Oct, 1999 by L. Curtis Boyle"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55 PRINT "Will detect both ATA and ATAPI devices."
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 (* Programmer's note: If this program checked and changed the busy flag in the
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 (* IDE driver's mem, we _COULD_ theoretically flag the driver busy while this
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 (* program is running.. although we would have to cheat like mad with the MMU
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 (* to accomplish this...
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 PRINT "Make sure you are NOT running an IDE driver while running this program!"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 PRINT "If you are, hit <BREAK> now!"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 PRINT "If you get bizarre results with a 2 drive system, make sure your Master/Slave"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 PRINT "jumper settings don't conflict. The Ask Jeeves search engine (www.aj.com)"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 PRINT "on the Internet has a lot of drive tech info available, including jumper"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 PRINT "settings."
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 PRINT "Please select base address of controller:"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 PRINT "<1> $FF50"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 PRINT "<2> $FF70"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 5 INPUT "Select <1-2>:";counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 IF counter<>1 AND counter<>2 THEN 5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 IF counter=1 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 baseaddress=65360.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 baseaddress=65392.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 (* Start with drive 0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 drivenumber=1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 (* Select drive 0 in NON-LBA mode, and do a Execute Drive Diagnostic command
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 10 POKE baseaddress+6.,driveselect(drivenumber)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 POKE baseaddress+7.,$90
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 (* Need both DRDY (Drive Ready) & DSC (Drive Seek Complete) flags set
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 ready=$50
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 counter=5000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 WHILE counter>0 DO
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 idestatus=PEEK(baseaddress+7.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 EXITIF idestatus=ready THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 ENDEXIT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 EXITIF LAND(idestatus,1)<>0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 PRINT "Error detected during Drive Diagnostic"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
93 ideerror=PEEK(baseaddress+1.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 temp=LAND(ideerror,$7f)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 IF temp>1 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 PRINT "Error on drive 0"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 drivefound(1)=3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 IF temp<6 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 PRINT driveerrors(temp)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 PRINT " - unknown error # $";
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 PRINT USING "H2",ideerror
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 IF ideerror>=$80 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 PRINT "Error on drive 1"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 drivefound(2)=3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 POKE baseaddress+6.,driveselect(2)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 counter=5000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 REPEAT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 idestatus=PEEK(baseaddress+7.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 UNTIL LAND(idestatus,$80)=0 OR counter=0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 ideerror=PEEK(baseaddress+1.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 IF ideerror>0 AND ideerror<6 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 PRINT " - ";driveerrors(ideerror)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 PRINT " - unknown error # $";
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 PRINT USING "H2",ideerror
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 ENDEXIT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 EXITIF idestatus=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 PRINT "IDE cable may be plugged in, but no power to drive 0"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 counter=0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 ENDEXIT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 counter=counter-1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 ENDWHILE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 IF counter=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 PRINT "Error: Drive 0 did not respond to Drive Diagnostic command!!!!"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 drivefound(1)=2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 IF drivefound(1)=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 PRINT "Drive 0 responded to Drive Diagnostic command"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 drivefound(1)=1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 (* Now, select drive 1 - check if it is there
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 POKE baseaddress+6.,driveselect(2)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 REPEAT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 idestatus=PEEK(baseaddress+7.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 UNTIL LAND(idestatus,$80)=0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 IF LAND(idestatus,1)<>0 OR LAND(idestatus,$20)<>0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 PRINT "Error flag or Write Fault flag set on status register for drive 1"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 IF LAND(idestatus,1)=1 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 ideerror=PEEK(baseaddress+1.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 PRINT "Drive 1 error code=$";
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 PRINT USING "h2",iderror
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 PRINT "Write Fault flag set - drive probably not plugged in"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 drivefound(2)=2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 IF drivefound(2)<>3 AND drivefound(2)<>2 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 IF idestatus=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 PRINT "There does not appear to be a drive 1"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 drivefound(2)=2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 IF drivefound(2)=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 drivefound(2)=1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 PRINT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 (* Select drive and identify
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 FOR drivenumber=1 TO 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 PUT #1,undon
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 PRINT "Checking drive ";drivenumber-1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 PUT #1,undoff
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 IF drivefound(drivenumber)=1 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 PRINT "Sending IDE identify device command to drive ";drivenumber-1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 POKE baseaddress+6.,driveselect(drivenumber)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 POKE baseaddress+7.,$ec
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 counter=2000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 REPEAT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 counter=counter-1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 UNTIL PEEK(baseaddress+7.)=ready+8 OR counter=0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 IF counter=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 POKE baseaddress+7.,$a1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 counter=2000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 REPEAT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 counter=counter-1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 UNTIL PEEK(baseaddress+7.)=ready+8 OR counter=0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185 PRINT "ATA Identified:"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186 GOTO 20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 IF counter=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 PRINT "ERROR: Could not identify either ATA or ATAPI!"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 END
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
192 PRINT "ATAPI Identified:"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 20 FOR counter=1 TO 512 STEP 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
195 ide(counter+1)=PEEK(baseaddress)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
196 ide(counter)=PEEK(baseaddress+8.)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
197 NEXT counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 PRINT "Model#= ";
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 PUT #1,invon
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 FOR counter=55 TO 90
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 PRINT CHR$(ide(counter));
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
202 NEXT counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
203 PUT #1,invoff
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
204 PRINT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 PRINT "Firmware Revision=";
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 PUT #1,invon
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 FOR counter=47 TO 54
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 PRINT CHR$(ide(counter));
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 NEXT counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 PUT #1,invoff
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 PRINT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 PRINT "Serial#= ";
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 PUT #1,invon
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 FOR counter=21 TO 41
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 PRINT CHR$(ide(counter));
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 NEXT counter
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 PUT #1,invoff
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 PRINT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219 PRINT USING "'Configuration=0x',H2,H2", ide(1), ide(2)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220 PRINT "Logical Cyls="; ide(3)*256+ide(4)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 PRINT "Logical Heads="; ide(7)*256+ide(8)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 PRINT "Logical Sectors="; ide(13)*256+ide(14)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 (* Note: not using ide(115-118) for CHS sector count, since some older ATA-1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 (* drives do NOT report it correctly.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 bignum=(ide(3)*256.+ide(4))*(ide(7)*256.+ide(8))*(ide(13)*256.+ide(14))
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226 PRINT USING "'# of user addressable sectors in CHS mode=',x13,R10.0";bignum
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 IF ide(96)=0 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 PRINT "READ/WRITE multiple not supported"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 PRINT ide(96); " Sectors per READ/WRITE multiple"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 (* Bug fix - originally checked if equal to 1 (which it NEVER would be, since
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 (* we are LANDing the 2ND bit!)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 IF LAND(ide(99),2)=2 THEN
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 PRINT "LBA is supported"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 bignum=16777216.*ide(123)+65536.*ide(124)+256.*ide(121)+ide(122)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 PRINT USING "'# of user addressable sectors in LBA mode=$',h2,h2,h2,h2,x4,R10.0";ide(123),ide(124),ide(121),ide(122),bignum
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 PRINT "LBA is not supported"
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241 PRINT "PIO data tranfer cycle timing="; ide(103)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 PRINT "Current logical cylinders="; ide(109)*256+ide(110)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
243 PRINT "Current logical heads="; ide(111)*256+ide(112)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 PRINT "Current logical Sectors="; ide(113)*256+ide(114)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 PRINT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246 INPUT "Press <ENTER> to continue:";prompt
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247 ELSE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 PRINT "Drive ";drivenumber-1;" not accessable:";
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 PRINT driveaccessmsg(drivefound(drivenumber)+1)
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250 ENDIF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 NEXT drivenumber
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 PRINT "Program finished."
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 END