1 .\" Copyright (C) 1994, 2001 by Joerg Wunsch, Dresden
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY
14 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
19 .\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
20 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
23 .\" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
33 .Nd display and modify floppy disk parameters
45 utility allows the modification of the run-time behavior of the
47 driver for the device specified by
50 Commands are implemented to query the current device density settings
51 as well as the underlying device hardware as registered with the
52 driver, to manipulate debugging levels, and to adjust the device
54 All the operations that manipulate the kernel
55 settings are restricted to the superuser (by the device driver), while
56 all inquiry requests only require read access to
61 argument should always be given as a full path name, e.g.\&
66 utility without any of the optional flags will report the drive type
67 that is registered with the device driver.
68 In the shortest form, a single string describing the drive type will
78 This information is primarily intended to be easily parsable by
81 In order to add some descriptive text that makes the output better
82 human readable, the flag
88 will report the device's density settings in a form that is suitable
94 some more text will be returned, including the total capacity of the
95 density settings in kilobytes.
99 driver was configured with the
101 option, by default, device debugging information is still disabled
102 since it could produce huge amounts of kernel messages.
108 usually immediately before starting an operation on the respective
109 device the debug information is wanted for, and later turned off again
112 Note that debugging levels are a driver's global option that will
113 affect any drives and controllers using the
115 driver, regardless which
123 control utilities support two different options how to specify device
127 to specify the format of the medium in kilobytes.
129 underlying drive type, the value is compared against a table of known
130 commonly used device density settings for that drive, and if a match
131 is found, those settings will be used.
132 Currently, the following
133 values for the respective drive types are acceptable:
136 2.88M and 1.44M drives:
137 .Bd -ragged -offset indent -compact
141 KB sectrac secsize ncyls speed heads flags
142 1721 21 2 (512) 82 500 2 MFM
143 1476 18 2 (512) 82 500 2 MFM
144 1440 18 2 (512) 80 500 2 MFM
145 1200 15 2 (512) 80 500 2 MFM
146 820 10 2 (512) 82 250 2 MFM
147 800 10 2 (512) 80 250 2 MFM
148 720 9 2 (512) 80 250 2 MFM
153 .Bd -ragged -offset indent -compact
157 KB sectrac secsize ncyls speed heads flags
158 1200 15 2 (512) 80 500 2 MFM
159 1232 8 3 (1024) 77 500 2 MFM
160 1476 18 2 (512) 82 500 2 MFM
161 1440 18 2 (512) 80 500 2 MFM
162 1200 15 2 (512) 80 500 2 MFM
163 820 10 2 (512) 82 300 2 MFM
164 800 10 2 (512) 80 300 2 MFM
165 720 9 2 (512) 80 300 2 MFM
166 360 9 2 (512) 40 300 2 MFM,2STEP
167 640 8 2 (512) 80 300 2 MFM
172 .Bd -ragged -offset indent -compact
176 KB sectrac secsize ncyls speed heads flags
177 720 9 2 (512) 80 250 2 MFM
182 .Bd -ragged -offset indent -compact
186 KB sectrac secsize ncyls speed heads flags
187 360 9 2 (512) 40 250 2 MFM
192 The second form to specify a device density uses
194 to explicitly specify each parameter in detail.
197 is a comma-separated list of values of the form:
200 .Ar sectrac , secsize , datalen , gap , ncyls , speed ,
201 .Ar heads , f_gap , f_inter , offs2 , flags
204 The meaning of the parameters is:
205 .Bl -tag -width ".Ar secsize"
207 The number of sectors per track.
209 The sector size code, 0 = 128 bytes (or less), 1 = 256 bytes, 2 = 512
210 bytes, 3 = 1024 bytes.
212 The actual sector size if the size code is 0, or the (ignored) value
213 0xFF for larger size codes.
215 The length of the gap 3 parameter for read/write operations.
217 The number of cylinders.
219 The transfer speed in kilobytes per second.
220 Can be 250, 300, 500, or
221 1000, but each drive type only supports a subset of these values.
225 The length of the gap 3 when formatting media.
227 The sector interleave to be applied when formatting.
229 interleave, 1 means 1:1 etc.
231 The offset of the sector numbers on side 2 (i.e., head number 1).
232 Normally, sector numbering on both sides starts with 1.
234 A list from one of the following flag values:
236 .Bl -tag -width ".Cm +perpend" -compact
240 Use FM (single-density) encoding.
242 Use 2 steps per each cylinder (for accessing 40-cylinder media in
245 Do not use 2 steps per cylinder, i.e., access each physical cylinder
248 Use perpendicular recording (for 2.88 MB media, currently not
251 Use longitudinal recording.
255 For any missing parameter, the current value will be used, so only
256 actual changes need to be specified.
257 Thus to turn off a flag bit
260 which is the default for all drive types), the form with a leading
261 minus sign must explicitly be used.
263 A simple inquiry about the drive type:
264 .Bd -literal -offset indent
269 Same as above, but with verbose output.
270 Note that the result is about
274 .Em "device density" ,
275 so it is independent from the actual subdevice being used for
277 .Bd -literal -offset indent
278 $ fdcontrol -v /dev/fd0
279 /dev/fd0: 1.44M drive (3.5" high-density)
282 Inquiry about the density settings:
283 .Bd -literal -offset indent
284 $ fdcontrol -F /dev/fd0
285 18,512,0xff,0x1b,80,500,2,0x6c,1,0,+mfm
288 The verbose flag makes this human readable:
289 .Bd -literal -offset indent
290 /dev/fd0: 1440 KB media type
291 Format: 18,512,0xff,0x1b,80,500,2,0x6c,1,0,+mfm
296 Transfer rate: 500 kbps
304 As indicated, trailing commas in the parameter list may be omitted.
306 In order to access archaic 160 KB single-density (FM encoded) 5.25
307 media in a modern 1.2M drive, something like the following definition
309 (Note that not all controller hardware is actually
310 capable of handling FM encoding at all.)
312 # fdcontrol -s 16,128,0x80,0x2,40,300,,0x10,,,-mfm,+2step /dev/fd1.1
315 It is still possible to hook up 8" drives to most modern floppy
316 controllers, given the right cable magic.
317 (On PC hardware, tell the BIOS that it is a 5.25" drive.)
318 The classical 128/26/2/77 format can be read with this entry
319 .Bd -literal -offset indent
320 fdcontrol -s 26,128,0x80,0x2,77,500,2,0x10,,,-mfm /dev/fd0
329 and was vastly overhauled in
332 The program and this man page was contributed by