ioctl_tty.2: Note kernel version that added TCGETS2, TCSETS2, TCSETSW2, and TCSETSF2
[man-pages.git] / man4 / fd.4
blobd9969fce0a155ced72f5cb189930498c89bce7a3
1 .\" Copyright (c) 1993 Michael Haardt (michael@cantor.informatik.rwth-aachen.de)
2 .\" and 1994,1995 Alain Knaff (Alain.Knaff@imag.fr)
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified, Sun Feb 26 15:00:02 1995, faith@cs.unc.edu
26 .\"
27 .TH FD 4 2020-08-13 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 fd \- floppy disk device
30 .SH CONFIGURATION
31 Floppy drives are block devices with major number 2.
32 Typically they
33 are owned by
34 root:floppy
35 (i.e., user root, group floppy) and have
36 either mode 0660 (access checking via group membership) or mode 0666
37 (everybody has access).
38 The minor
39 numbers encode the device type, drive number, and controller number.
40 For each device type (that is, combination of density and track count)
41 there is a base minor number.
42 To this base number, add the drive's
43 number on its controller and 128 if the drive is on the secondary
44 controller.
45 In the following device tables, \fIn\fP represents the
46 drive number.
47 .PP
48 \fBWarning: if you use formats with more tracks
49 than supported by your drive, you may cause it mechanical damage.\fP
50 Trying once if more tracks than the usual 40/80 are supported should not
51 damage it, but no warranty is given for that.
52 If you are not sure, don't create device
53 entries for those formats, so as to prevent their usage.
54 .PP
55 Drive-independent device files which automatically detect the media
56 format and capacity:
57 .TS
58 l c
59 l c.
60 Name    Base
61         minor #
63 \fBfd\fP\fIn\fP 0
64 .TE
65 .PP
66 5.25 inch double-density device files:
67 .TS
68 lw(1i) l l l l c
69 lw(1i) c c c c c.
70 Name    Capacity        Cyl.    Sect.   Heads   Base
71         KiB                             minor #
73 \fBfd\fP\fIn\fP\fBd360\fP       360     40      9       2       4
74 .TE
75 .PP
76 5.25 inch high-density device files:
77 .TS
78 lw(1i) l l l l c
79 lw(1i) c c c c c.
80 Name    Capacity        Cyl.    Sect.   Heads   Base
81         KiB                             minor #
83 \fBfd\fP\fIn\fP\fBh360\fP       360     40      9       2       20
84 \fBfd\fP\fIn\fP\fBh410\fP       410     41      10      2       48
85 \fBfd\fP\fIn\fP\fBh420\fP       420     42      10      2       64
86 \fBfd\fP\fIn\fP\fBh720\fP       720     80      9       2       24
87 \fBfd\fP\fIn\fP\fBh880\fP       880     80      11      2       80
88 \fBfd\fP\fIn\fP\fBh1200\fP      1200    80      15      2       8
89 \fBfd\fP\fIn\fP\fBh1440\fP      1440    80      18      2       40
90 \fBfd\fP\fIn\fP\fBh1476\fP      1476    82      18      2       56
91 \fBfd\fP\fIn\fP\fBh1494\fP      1494    83      18      2       72
92 \fBfd\fP\fIn\fP\fBh1600\fP      1600    80      20      2       92
93 .TE
94 .PP
95 3.5 inch double-density device files:
96 .TS
97 lw(1i) l l l l c
98 lw(1i) c c c c c.
99 Name    Capacity        Cyl.    Sect.   Heads   Base
100         KiB                             minor #
102 \fBfd\fP\fIn\fP\fBu360\fP       360     80      9       1       12
103 \fBfd\fP\fIn\fP\fBu720\fP       720     80      9       2       16
104 \fBfd\fP\fIn\fP\fBu800\fP       800     80      10      2       120
105 \fBfd\fP\fIn\fP\fBu1040\fP      1040    80      13      2       84
106 \fBfd\fP\fIn\fP\fBu1120\fP      1120    80      14      2       88
109 3.5 inch high-density device files:
111 lw(1i) l l l l c
112 lw(1i) c c c c c.
113 Name    Capacity        Cyl.    Sect.   Heads   Base
114         KiB                             minor #
116 \fBfd\fP\fIn\fP\fBu360\fP       360     40      9       2       12
117 \fBfd\fP\fIn\fP\fBu720\fP       720     80      9       2       16
118 \fBfd\fP\fIn\fP\fBu820\fP       820     82      10      2       52
119 \fBfd\fP\fIn\fP\fBu830\fP       830     83      10      2       68
120 \fBfd\fP\fIn\fP\fBu1440\fP      1440    80      18      2       28
121 \fBfd\fP\fIn\fP\fBu1600\fP      1600    80      20      2       124
122 \fBfd\fP\fIn\fP\fBu1680\fP      1680    80      21      2       44
123 \fBfd\fP\fIn\fP\fBu1722\fP      1722    82      21      2       60
124 \fBfd\fP\fIn\fP\fBu1743\fP      1743    83      21      2       76
125 \fBfd\fP\fIn\fP\fBu1760\fP      1760    80      22      2       96
126 \fBfd\fP\fIn\fP\fBu1840\fP      1840    80      23      2       116
127 \fBfd\fP\fIn\fP\fBu1920\fP      1920    80      24      2       100
130 3.5 inch extra-density device files:
132 lw(1i) l l l l c
133 lw(1i) c c c c c.
134 Name    Capacity        Cyl.    Sect.   Heads   Base
135         KiB                             minor #
137 \fBfd\fP\fIn\fP\fBu2880\fP      2880    80      36      2       32
138 \fBfd\fP\fIn\fP\fBCompaQ\fP     2880    80      36      2       36
139 \fBfd\fP\fIn\fP\fBu3200\fP      3200    80      40      2       104
140 \fBfd\fP\fIn\fP\fBu3520\fP      3520    80      44      2       108
141 \fBfd\fP\fIn\fP\fBu3840\fP      3840    80      48      2       112
143 .SH DESCRIPTION
144 \fBfd\fP special files access the floppy disk drives in raw mode.
145 The following
146 .BR ioctl (2)
147 calls are supported by \fBfd\fP devices:
148 .IP \fBFDCLRPRM\fP
149 clears the media information of a drive (geometry of disk in drive).
150 .IP \fBFDSETPRM\fP
151 sets the media information of a drive.
152 The media information will be
153 lost when the media is changed.
154 .IP \fBFDDEFPRM\fP
155 sets the media information of a drive (geometry of disk in drive).
156 The media information will not be lost when the media is changed.
157 This will disable autodetection.
158 In order to reenable autodetection, you
159 have to issue an \fBFDCLRPRM\fP.
160 .IP \fBFDGETDRVTYP\fP
161 returns the type of a drive (name parameter).
162 For formats which work
163 in several drive types, \fBFDGETDRVTYP\fP returns a name which is
164 appropriate for the oldest drive type which supports this format.
165 .IP \fBFDFLUSH\fP
166 invalidates the buffer cache for the given drive.
167 .IP \fBFDSETMAXERRS\fP
168 sets the error thresholds for reporting errors, aborting the operation,
169 recalibrating, resetting, and reading sector by sector.
170 .IP \fBFDSETMAXERRS\fP
171 gets the current error thresholds.
172 .IP \fBFDGETDRVTYP\fP
173 gets the internal name of the drive.
174 .IP \fBFDWERRORCLR\fP
175 clears the write error statistics.
176 .IP \fBFDWERRORGET\fP
177 reads the write error statistics.
178 These include the total number of
179 write errors, the location and disk of the first write error, and the
180 location and disk of the last write error.
181 Disks are identified by a
182 generation number which is incremented at (almost) each disk change.
183 .IP \fBFDTWADDLE\fP
184 Switch the drive motor off for a few microseconds.
185 This might be
186 needed in order to access a disk whose sectors are too close together.
187 .IP \fBFDSETDRVPRM\fP
188 sets various drive parameters.
189 .IP \fBFDGETDRVPRM\fP
190 reads these parameters back.
191 .IP \fBFDGETDRVSTAT\fP
192 gets the cached drive state (disk changed, write protected et al.)
193 .IP \fBFDPOLLDRVSTAT\fP
194 polls the drive and return its state.
195 .IP \fBFDGETFDCSTAT\fP
196 gets the floppy controller state.
197 .IP \fBFDRESET\fP
198 resets the floppy controller under certain conditions.
199 .IP \fBFDRAWCMD\fP
200 sends a raw command to the floppy controller.
202 For more precise information, consult also the \fI<linux/fd.h>\fP and
203 \fI<linux/fdreg.h>\fP include files, as well as the
204 .BR floppycontrol (1)
205 manual page.
206 .SH FILES
207 .I /dev/fd*
208 .SH NOTES
209 The various formats permit reading and writing many types of disks.
210 However, if a floppy is formatted with an inter-sector gap that is too small,
211 performance may drop,
212 to the point of needing a few seconds to access an entire track.
213 To prevent this, use interleaved formats.
215 It is not possible to
216 read floppies which are formatted using GCR (group code recording),
217 which is used by Apple II and Macintosh computers (800k disks).
219 Reading floppies which are hard sectored (one hole per sector, with
220 the index hole being a little skewed) is not supported.
221 This used to be common with older 8-inch floppies.
222 .\" .SH AUTHORS
223 .\" Alain Knaff (Alain.Knaff@imag.fr), David Niemi
224 .\" (niemidc@clark.net), Bill Broadhurst (bbroad@netcom.com).
225 .SH SEE ALSO
226 .BR chown (1),
227 .BR floppycontrol (1),
228 .BR getfdprm (1),
229 .BR mknod (1),
230 .BR superformat (1),
231 .BR mount (8),
232 .BR setfdprm (8)