version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
fdrawcmd |
|
|
2 |
!!!fdrawcmd |
|
|
3 |
Name |
|
|
4 |
Note |
|
|
5 |
Description |
|
|
6 |
Options |
|
|
7 |
Commands |
|
|
8 |
Modes |
|
|
9 |
See Also |
|
|
10 |
---- |
|
|
11 |
!!Name |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
fdrawcmd - send raw commands to the floppy disk controller |
|
|
15 |
!!Note |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
This manpage has been automatically generated from fdutils's |
|
|
19 |
texinfo documentation. However, this process is only |
|
|
20 |
approximative, and some items, such as crossreferences, |
|
|
21 |
footnotes and indices are lost in this translation process. |
|
|
22 |
Indeed, these items have no appropriate representation in |
|
|
23 |
the manpage format. Moreover, only the items specific to |
|
|
24 |
each command have been translated, and the general |
|
|
25 |
information about fdutils has been dropped in the manpage |
|
|
26 |
version. Thus I strongly advise you to use the original |
|
|
27 |
texinfo doc. |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
* |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
To generate a printable copy from the texinfo doc, run the |
|
|
34 |
following commands: |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
__ ./configure; make dvi; dvips fdutils.dvi |
|
|
38 |
__ |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
* |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
To generate a html copy, run: |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
__ ./configure; make html |
|
|
48 |
__A premade html can be found at: `http://www.tux.org/pub/knaff/fdutils' |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
* |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
To generate an info copy (browsable using emacs' info mode), |
|
|
55 |
run: |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
__ ./configure; make info |
|
|
59 |
__ |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
The texinfo doc looks most pretty when printed or as html. |
|
|
63 |
Indeed, in the info version certain examples are difficult |
|
|
64 |
to read due to the quoting conventions used in |
|
|
65 |
info. |
|
|
66 |
!!Description |
|
|
67 |
|
|
|
68 |
|
|
|
69 |
fdrawcmd [[drive=''drive''] [[rate=''rate'' |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
] |
|
|
73 |
[[length=''length''] [[repeat=''repeat'' |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
] |
|
|
77 |
[[cylinder=''physical-cyl''] ''command'' [[''paramters'' ...] [[''mode'' |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
] |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
fdrawcmd is used to send raw commands to the floppy disk |
|
|
84 |
controller, after having selected a given drive. You must |
|
|
85 |
have write permission to the selected drive. |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
When writing to a disk, data is read from stdin; when |
|
|
89 |
reading, data is printed to stdout. Diagnostic messages, |
|
|
90 |
return values from the controller, and the value of the disk |
|
|
91 |
change line after the command are printed to |
|
|
92 |
stderr. |
|
|
93 |
!!Options |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
All numbers may be given in octal (0211), decimal (137), or |
|
|
97 |
hexadecimal (0x89). |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
drive=''drive'' |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
Selects the drive. The default is drive 0 |
|
|
104 |
(`/dev/fd0'). |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
rate=''rate'' |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
Selects the data transfer rate. Use 0 for high density |
|
|
111 |
disks, 1 for double density 5 1/4 disks (or 2 Mbps tapes, if |
|
|
112 |
the appropriate rate table is selected), and 2 for double |
|
|
113 |
density 3 1/2 disks. |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
length=''length'' |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
Describes the length of the transferred data for commands |
|
|
120 |
reading from and writing to the disk. The default is to |
|
|
121 |
continue until end of file. |
|
|
122 |
|
|
|
123 |
|
|
|
124 |
repeat=''count'' |
|
|
125 |
|
|
|
126 |
|
|
|
127 |
Repeat the command ''count'' times. This only works |
|
|
128 |
correctly for commands which don't do any data |
|
|
129 |
transfer. |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
cylinder=''count'' |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
Seek to the given cylinder before executing the |
|
|
136 |
command |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
''command'' |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
The name of the command to send. ''command'' may be a |
|
|
143 |
spelled out name (like read or write), or |
|
|
144 |
a number representing the commands floppy disk controller |
|
|
145 |
opcode. A named command has already a mode associated with |
|
|
146 |
it, whereas for a number the mode parameter should be |
|
|
147 |
described using the mode option. |
|
|
148 |
|
|
|
149 |
|
|
|
150 |
''parameters'' |
|
|
151 |
|
|
|
152 |
|
|
|
153 |
The parameters for the command (optional, not all commands |
|
|
154 |
need parameters). |
|
|
155 |
|
|
|
156 |
|
|
|
157 |
''mode'' |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
Various flags or'ed together describing the properties of |
|
|
161 |
the command. |
|
|
162 |
!!Commands |
|
|
163 |
|
|
|
164 |
|
|
|
165 |
The description of the various floppy commands given in this |
|
|
166 |
manpage is very sketchy. For more details get the 82078 spec |
|
|
167 |
sheet which can be found at: |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
__ http://www-techdoc.intel.com/docs/periph/fd_contr/datasheets/ |
|
|
171 |
__ |
|
|
172 |
|
|
|
173 |
|
|
|
174 |
Look for the chapter COMMAND SET/DESCRIPTIONS. |
|
|
175 |
Older FDCs only support a subset of the commands described |
|
|
176 |
therein, but the syntax for the commands that do exist is |
|
|
177 |
the same. |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
__Commands available on all FDCs__ |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
read ''drvsel cyl head sect szcod spt rw-gap |
|
|
184 |
szcod2'' |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
Reads ''length'' bytes of data from the disk. |
|
|
188 |
''drvsel'' is the drive selector. Bit 0 and 1 describe |
|
|
189 |
the drive, and bit 2 describes the head. The remaining |
|
|
190 |
parameters give the cylinder, head (yes, again), sector, |
|
|
191 |
size of the sector (128 * 2 ^ ''szcod''), sectors per |
|
|
192 |
track (spt, this is used to switch to the second |
|
|
193 |
head when the first side has been read), and size of the |
|
|
194 |
read-write gap. ''szcod2'' should be 0xff. read |
|
|
195 |
returns ''ST0 ST1 ST2'' and ''cyl head sect szcod'' of |
|
|
196 |
the next sector to be read; see |
|
|
197 |
`/usr/include/linux/fdreg.h' . |
|
|
198 |
|
|
|
199 |
|
|
|
200 |
N.B. Certain newer floppy disk controllers are buggy, and do |
|
|
201 |
not correctly recognize the end of transfer when operating |
|
|
202 |
in virtual DMA mode. For these, you need to set spt |
|
|
203 |
to the id of the last sector to be read (for example, if you |
|
|
204 |
intend to read sectors 2, 3, 4, set spt to 4, even |
|
|
205 |
if the disk has more sectors), and set the no-mt |
|
|
206 |
flag. |
|
|
207 |
|
|
|
208 |
|
|
|
209 |
write ''drvsel cyl head sect szcod spt rw-gap |
|
|
210 |
szcod2'' |
|
|
211 |
|
|
|
212 |
|
|
|
213 |
Analogous to read. |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
sense ''drvsel'' |
|
|
217 |
|
|
|
218 |
|
|
|
219 |
Returns the third status byte (''ST3'') |
|
|
220 |
|
|
|
221 |
|
|
|
222 |
recalibrate ''drvsel'' |
|
|
223 |
|
|
|
224 |
|
|
|
225 |
Recalibrates the drive and returns ''ST0 |
|
|
226 |
ST1''. |
|
|
227 |
|
|
|
228 |
|
|
|
229 |
seek ''drvsel cyl'' |
|
|
230 |
|
|
|
231 |
|
|
|
232 |
Moves the head to ''cyl'' and returns ''ST0 |
|
|
233 |
ST1''. |
|
|
234 |
|
|
|
235 |
|
|
|
236 |
specify ''drvsel spec1 spec2'' |
|
|
237 |
|
|
|
238 |
|
|
|
239 |
Specify various parameters to the drive. |
|
|
240 |
|
|
|
241 |
|
|
|
242 |
format ''drvsel szcod sect-per-track fmt-gap |
|
|
243 |
fmt-fill'' |
|
|
244 |
|
|
|
245 |
|
|
|
246 |
Formats the cylinder. The new sectors are filled with |
|
|
247 |
''fmt-fill''. The header information comes from the |
|
|
248 |
input, which is made up of ''cyl head sect szcod'' |
|
|
249 |
quadruples. The ''szcod'' parameter from the command line |
|
|
250 |
is used to describe the actual size of the sectors, and the |
|
|
251 |
''szcod'' from the input is used to write into the |
|
|
252 |
header. However, the first write to these sectors will use |
|
|
253 |
the header information, and might overwrite the following |
|
|
254 |
sectors if the ''szcod'' parameter from the command line |
|
|
255 |
was too small. |
|
|
256 |
|
|
|
257 |
|
|
|
258 |
readid ''drvsel'' |
|
|
259 |
|
|
|
260 |
|
|
|
261 |
reads the first sector header that comes and returns ''ST0 |
|
|
262 |
ST1 ST2'' and ''cyl head sect szcod'' of the |
|
|
263 |
encountered header. |
|
|
264 |
|
|
|
265 |
|
|
|
266 |
__Commands available on 82072 and later__ |
|
|
267 |
|
|
|
268 |
|
|
|
269 |
dumpregs |
|
|
270 |
|
|
|
271 |
|
|
|
272 |
Prints the contents of the FDCs registers, if |
|
|
273 |
supported. |
|
|
274 |
|
|
|
275 |
|
|
|
276 |
__Commands available on 82072A and later__ |
|
|
277 |
|
|
|
278 |
|
|
|
279 |
configure ''conf1 conf2 conf3'' |
|
|
280 |
|
|
|
281 |
|
|
|
282 |
Configures FIFO operation. |
|
|
283 |
|
|
|
284 |
|
|
|
285 |
__Commands available on 82077 and later__ |
|
|
286 |
|
|
|
287 |
|
|
|
288 |
version |
|
|
289 |
|
|
|
290 |
|
|
|
291 |
Echoes 0x90 if the FDC is more recent than 82072A, and 0x80 |
|
|
292 |
otherwise |
|
|
293 |
|
|
|
294 |
|
|
|
295 |
perpendicular ''rate'' |
|
|
296 |
|
|
|
297 |
|
|
|
298 |
Sets the perpendicular mode. Use 0 for normal, 2 for 500kb/s |
|
|
299 |
perpendicular, and 3 for 1 Mb/s perpendicular. |
|
|
300 |
|
|
|
301 |
|
|
|
302 |
seek-out ''drvsel n'' |
|
|
303 |
|
|
|
304 |
|
|
|
305 |
does a relative seek of ''n'' cylinders towards cylinder |
|
|
306 |
0. |
|
|
307 |
|
|
|
308 |
|
|
|
309 |
seek-in ''drvsel n'' |
|
|
310 |
|
|
|
311 |
|
|
|
312 |
does a relative seek of ''n'' cylinders away from |
|
|
313 |
cylinder 0. |
|
|
314 |
|
|
|
315 |
|
|
|
316 |
__Commands available on 82077AA and later__ |
|
|
317 |
|
|
|
318 |
|
|
|
319 |
lock |
|
|
320 |
|
|
|
321 |
|
|
|
322 |
Locks the FIFO configuration, so that it survives a FDC |
|
|
323 |
software reset. |
|
|
324 |
|
|
|
325 |
|
|
|
326 |
unlock |
|
|
327 |
|
|
|
328 |
|
|
|
329 |
Unlock the FIFO configuration |
|
|
330 |
|
|
|
331 |
|
|
|
332 |
__Commands available on 82078__ |
|
|
333 |
|
|
|
334 |
|
|
|
335 |
partid |
|
|
336 |
|
|
|
337 |
|
|
|
338 |
echoes a byte describing the type of the FDC in the 3 high |
|
|
339 |
bits, and the stepping in the three low bits. |
|
|
340 |
|
|
|
341 |
|
|
|
342 |
powerdown ''powerconf'' |
|
|
343 |
|
|
|
344 |
|
|
|
345 |
configures automatic power down of the FDC. The old |
|
|
346 |
configuration is echoed |
|
|
347 |
|
|
|
348 |
|
|
|
349 |
option ''iso'' |
|
|
350 |
|
|
|
351 |
|
|
|
352 |
enables/disables ISO formats. Odd values of ''iso'' |
|
|
353 |
enable these formats, whereas even values disable them. ISO |
|
|
354 |
formats don't have index headers, and thus allow to fit |
|
|
355 |
slightly more data on a disk. |
|
|
356 |
|
|
|
357 |
|
|
|
358 |
save |
|
|
359 |
|
|
|
360 |
|
|
|
361 |
prints out 16 internal registers of the FDC. |
|
|
362 |
|
|
|
363 |
|
|
|
364 |
restore ''r1 r2 r3 ... r16'' |
|
|
365 |
|
|
|
366 |
|
|
|
367 |
restores the 16 internal registers of the FDC. |
|
|
368 |
|
|
|
369 |
|
|
|
370 |
format_n_write ''drvsel szcod sect-per-track |
|
|
371 |
fmt-gap fmt-fill'' |
|
|
372 |
|
|
|
373 |
|
|
|
374 |
formats the cylinder and writes initial data to it. The |
|
|
375 |
input data is made up of a sequence of headers (4 bytes) and |
|
|
376 |
data: ''header1 data1 header2 data2 ... headern |
|
|
377 |
datan'' |
|
|
378 |
|
|
|
379 |
|
|
|
380 |
drivespec ''dspec1 dspec2 ... specn |
|
|
381 |
terminator'' |
|
|
382 |
|
|
|
383 |
|
|
|
384 |
chooses rate tables for various drives. Each dspec byte |
|
|
385 |
describes one drive. Bits 0 and 1 say which drive is |
|
|
386 |
described. Bits 2 and 3 describe the rate table. Only tables |
|
|
387 |
0 and 2 are interesting. Both tables only differ in the |
|
|
388 |
meaning og rate 1. For table 0 (the default) rate 0 is 300 |
|
|
389 |
kb/s (used for 5 1/4 DD disks), whereas for table 1 it is 2 |
|
|
390 |
Mbps (used for fast floppy tape drives). Bit 4 is the |
|
|
391 |
precompensation table select bit. It should be set to 0. Bit |
|
|
392 |
5-7 should be zero as well. The ''terminator'' byte ends |
|
|
393 |
the drivespec command. It is either 0xc0 or 0x80. |
|
|
394 |
If it is 0xc0, no result phase follows; if it is 0x80, the |
|
|
395 |
current data rate table configuration for the four drives is |
|
|
396 |
echoed. |
|
|
397 |
!!Modes |
|
|
398 |
|
|
|
399 |
|
|
|
400 |
The mode option is only needed when you describe the command |
|
|
401 |
as a numerical value. Some mode names are also valid command |
|
|
402 |
names. They are considered as command name if the command |
|
|
403 |
name has not yet been given, and as mode name |
|
|
404 |
otherwise. |
|
|
405 |
|
|
|
406 |
|
|
|
407 |
If you give a command name followed by explicit modes, both |
|
|
408 |
the implicit flags of the command name, and the explicit |
|
|
409 |
modes are or'ed together. |
|
|
410 |
|
|
|
411 |
|
|
|
412 |
If on the other hand you give a command name preceded by |
|
|
413 |
explicit modes, only the explicit modes are or'ed |
|
|
414 |
together. |
|
|
415 |
|
|
|
416 |
|
|
|
417 |
read |
|
|
418 |
|
|
|
419 |
|
|
|
420 |
Read data from disk using DMA. |
|
|
421 |
|
|
|
422 |
|
|
|
423 |
write |
|
|
424 |
|
|
|
425 |
|
|
|
426 |
Write data to the disk. |
|
|
427 |
|
|
|
428 |
|
|
|
429 |
intr |
|
|
430 |
|
|
|
431 |
|
|
|
432 |
Wait for an interrupt. |
|
|
433 |
|
|
|
434 |
|
|
|
435 |
spin |
|
|
436 |
|
|
|
437 |
|
|
|
438 |
wait for the disk to spin up |
|
|
439 |
|
|
|
440 |
|
|
|
441 |
disk |
|
|
442 |
|
|
|
443 |
|
|
|
444 |
Aborts the operation if no disk is in the drive. This only |
|
|
445 |
works if you also chose a physical cylinder to seek |
|
|
446 |
to. |
|
|
447 |
|
|
|
448 |
|
|
|
449 |
no-motor |
|
|
450 |
|
|
|
451 |
|
|
|
452 |
Don't switch on the drive motor while issuing the |
|
|
453 |
command |
|
|
454 |
|
|
|
455 |
|
|
|
456 |
no-motor-after |
|
|
457 |
|
|
|
458 |
|
|
|
459 |
Switch off the motor immediately after the command |
|
|
460 |
returns. |
|
|
461 |
|
|
|
462 |
|
|
|
463 |
fm |
|
|
464 |
|
|
|
465 |
|
|
|
466 |
Uses the FM version of the read, readid, |
|
|
467 |
write and format commands. |
|
|
468 |
|
|
|
469 |
|
|
|
470 |
no-mt |
|
|
471 |
|
|
|
472 |
|
|
|
473 |
Do not use MT (multitrack) mode for the read, |
|
|
474 |
readid and write commands. This is needed |
|
|
475 |
on certain broken FDC's which don't recognize end of |
|
|
476 |
transfer when running in nodma mode. In order to |
|
|
477 |
use these safely, set no-mt, and chose the id of |
|
|
478 |
the last sector to be read as |
|
|
479 |
sect-per-track. |
|
|
480 |
|
|
|
481 |
|
|
|
482 |
fdrawcmd opens the device node with the |
|
|
483 |
NDELAY flag. This means that the driver should not |
|
|
484 |
try to autodetect the disk type (it might not be formatted), |
|
|
485 |
and that it should not reset the FDC. If a reset was needed, |
|
|
486 |
the command simply fails. If that happens, execute |
|
|
487 |
floppycontrol --resetnow 0 , and try |
|
|
488 |
again. |
|
|
489 |
!!See Also |
|
|
490 |
|
|
|
491 |
|
|
|
492 |
Fdutils' texinfo doc |
|
|
493 |
---- |