2001-07-15 08:06:20 +00:00
|
|
|
.\"
|
2001-12-25 21:21:18 +00:00
|
|
|
.\" Copyright (C) 1994, 2001 by Joerg Wunsch, Dresden
|
1994-10-30 18:52:01 +00:00
|
|
|
.\" All rights reserved.
|
2001-07-15 08:06:20 +00:00
|
|
|
.\"
|
1994-10-30 18:52:01 +00:00
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
2001-07-15 08:06:20 +00:00
|
|
|
.\"
|
1994-10-30 18:52:01 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY
|
|
|
|
.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
|
|
.\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
|
|
.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
|
|
.\" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
|
|
.\" DAMAGE.
|
1999-07-12 20:12:29 +00:00
|
|
|
.\"
|
1999-08-28 01:35:59 +00:00
|
|
|
.\" $FreeBSD$
|
1999-07-12 20:12:29 +00:00
|
|
|
.\"
|
2001-12-25 21:21:18 +00:00
|
|
|
.Dd December 25, 2001
|
1994-10-30 18:52:01 +00:00
|
|
|
.Os
|
|
|
|
.Dt FDCONTROL 8
|
|
|
|
.Sh NAME
|
|
|
|
.Nm fdcontrol
|
2001-12-25 21:21:18 +00:00
|
|
|
.Nd display and modify floppy disk parameters
|
1994-10-30 18:52:01 +00:00
|
|
|
.Sh SYNOPSIS
|
2000-11-20 20:10:44 +00:00
|
|
|
.Nm
|
2001-12-25 21:21:18 +00:00
|
|
|
.Op Fl F
|
|
|
|
.Op Fl d Ar dbg
|
|
|
|
.Op Fl f Ar fmt
|
|
|
|
.Op Fl s Ar fmtstr
|
|
|
|
.Op Fl v
|
1994-10-30 18:52:01 +00:00
|
|
|
.Ar device
|
|
|
|
.Sh DESCRIPTION
|
2001-12-25 21:21:18 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility allows the modification of the run-time behavior of the
|
|
|
|
.Xr fdc 4
|
|
|
|
driver for the device specified by
|
|
|
|
.Ar device .
|
|
|
|
.Pp
|
|
|
|
Commands are implemented to query the current device density settings
|
|
|
|
as well as the underlying device hardware as registered with the
|
|
|
|
driver, to manipulate debugging levels, and to adjust the device
|
2002-01-10 17:41:22 +00:00
|
|
|
density settings.
|
|
|
|
All the operations that manipulate the kernel
|
2001-12-25 21:21:18 +00:00
|
|
|
settings are restricted to the superuser (by the device driver), while
|
|
|
|
all inquiry requests only require read access to
|
1994-10-30 18:52:01 +00:00
|
|
|
.Ar device .
|
1996-12-09 08:04:55 +00:00
|
|
|
.Pp
|
2001-12-25 21:21:18 +00:00
|
|
|
The
|
|
|
|
.Ar device
|
2002-01-10 17:41:22 +00:00
|
|
|
argument should always be given as a full path name, e.g.\&
|
2001-12-25 21:21:18 +00:00
|
|
|
.Pa /dev/fd0 .
|
2002-01-10 17:41:22 +00:00
|
|
|
.Ss Inquiry Commands
|
2001-12-25 21:21:18 +00:00
|
|
|
Running the
|
|
|
|
.Nm
|
|
|
|
utility without any of the optional flags will report the drive type
|
|
|
|
that has been registered with the device driver.
|
|
|
|
In the shortest form, a single string describing the drive type will
|
2002-01-10 17:41:22 +00:00
|
|
|
be returned.
|
|
|
|
Possible values are:
|
|
|
|
.Dq Li 360K ,
|
|
|
|
.Dq Li 1.2M ,
|
|
|
|
.Dq Li 720K ,
|
|
|
|
.Dq Li 1.44M ,
|
|
|
|
.Dq Li 2.88M ,
|
2001-12-25 21:21:18 +00:00
|
|
|
or
|
2002-01-10 17:41:22 +00:00
|
|
|
.Dq Li unknown .
|
2001-12-25 21:21:18 +00:00
|
|
|
This information is primarily intented to be easily parsable by
|
|
|
|
scripts.
|
1996-12-09 08:04:55 +00:00
|
|
|
.Pp
|
2001-12-25 21:21:18 +00:00
|
|
|
In order to add some descriptive text that makes the output better
|
|
|
|
human readable, the flag
|
|
|
|
.Fl v
|
|
|
|
can be added.
|
1996-12-09 08:04:55 +00:00
|
|
|
.Pp
|
2001-12-25 21:21:18 +00:00
|
|
|
Specifying flag
|
|
|
|
.Fl F
|
|
|
|
will report the device's density settings in a form that is suitable
|
|
|
|
as input to the
|
|
|
|
.Fl s Ar fmtstr
|
2002-01-10 17:41:22 +00:00
|
|
|
option (see below).
|
|
|
|
Again, together with
|
2001-12-25 21:21:18 +00:00
|
|
|
.Fl v ,
|
|
|
|
some more text will be returned, including the total capacity of the
|
|
|
|
density settings in kilobytes.
|
2002-01-10 17:41:22 +00:00
|
|
|
.Ss Debug Control
|
2001-12-25 21:21:18 +00:00
|
|
|
If the
|
|
|
|
.Xr fdc 4
|
|
|
|
driver has been configured with the
|
2002-01-10 17:41:22 +00:00
|
|
|
.Dv FDC_DEBUG
|
2001-12-25 21:21:18 +00:00
|
|
|
option, by default, device debugging information is still disabled
|
2002-01-10 17:41:22 +00:00
|
|
|
since it could produce huge amounts of kernel messages.
|
|
|
|
It needs to
|
2001-12-25 21:21:18 +00:00
|
|
|
be turned on using
|
|
|
|
.Nm
|
|
|
|
together with
|
2002-01-10 17:41:22 +00:00
|
|
|
.Dq Fl d Li 1 ,
|
2001-12-25 21:21:18 +00:00
|
|
|
usually immediately before starting an operation on the respective
|
|
|
|
device the debug information is wanted for, and later turned off again
|
|
|
|
using
|
2002-01-10 17:41:22 +00:00
|
|
|
.Dq Fl d Li 0 .
|
|
|
|
Note that debugging levels are a driver's global option that will
|
2001-12-25 21:21:18 +00:00
|
|
|
affect any drives and controllers using the
|
|
|
|
.Xr fdc 4
|
|
|
|
driver, regardless which
|
|
|
|
.Ar device
|
|
|
|
has been specified on the
|
|
|
|
.Nm
|
|
|
|
command line.
|
2002-01-10 17:41:22 +00:00
|
|
|
.Ss Density Control
|
1994-10-30 18:52:01 +00:00
|
|
|
The
|
2001-12-25 21:21:18 +00:00
|
|
|
.Xr fdc 4
|
|
|
|
control utilities support two different options how to specify device
|
2002-01-10 17:41:22 +00:00
|
|
|
density settings.
|
|
|
|
The first form uses
|
2001-12-25 21:21:18 +00:00
|
|
|
.Fl f Ar fmt
|
2002-01-10 17:41:22 +00:00
|
|
|
to specify the format of the medium in kilobytes.
|
|
|
|
Depending on the
|
2001-12-25 21:21:18 +00:00
|
|
|
underlying drive type, the value is compared against a table of known
|
|
|
|
commonly used device density settings for that drive, and if a match
|
2002-01-10 17:41:22 +00:00
|
|
|
has been found, those settings will be used.
|
|
|
|
Currently, the following
|
2001-12-25 21:21:18 +00:00
|
|
|
values for the respective drive types are acceptable:
|
2002-01-10 17:41:22 +00:00
|
|
|
.Bl -item
|
|
|
|
.It
|
|
|
|
2.88M and 1.44M drives:
|
|
|
|
.Bd -ragged -offset indent -compact
|
2001-12-25 21:21:18 +00:00
|
|
|
.TS
|
|
|
|
lB lB lB lB lB lB lB
|
|
|
|
r l l l l l l.
|
|
|
|
KB sectrac secsize ncyls speed heads flags
|
|
|
|
1721 21 2 (512) 82 500 2 MFM
|
|
|
|
1476 18 2 (512) 82 500 2 MFM
|
|
|
|
1440 18 2 (512) 80 500 2 MFM
|
|
|
|
1200 15 2 (512) 80 500 2 MFM
|
|
|
|
820 10 2 (512) 82 250 2 MFM
|
|
|
|
800 10 2 (512) 80 250 2 MFM
|
|
|
|
720 9 2 (512) 80 250 2 MFM
|
|
|
|
.TE
|
2002-01-10 17:41:22 +00:00
|
|
|
.Ed
|
|
|
|
.It
|
|
|
|
1.2M drives:
|
|
|
|
.Bd -ragged -offset indent -compact
|
2001-12-25 21:21:18 +00:00
|
|
|
.TS
|
|
|
|
lB lB lB lB lB lB lB
|
|
|
|
r l l l l l l.
|
|
|
|
KB sectrac secsize ncyls speed heads flags
|
|
|
|
1200 15 2 (512) 80 500 2 MFM
|
|
|
|
1232 8 3 (1024) 77 500 2 MFM
|
|
|
|
1476 18 2 (512) 82 500 2 MFM
|
|
|
|
1440 18 2 (512) 80 500 2 MFM
|
|
|
|
1200 15 2 (512) 80 500 2 MFM
|
|
|
|
820 10 2 (512) 82 300 2 MFM
|
|
|
|
800 10 2 (512) 80 300 2 MFM
|
|
|
|
720 9 2 (512) 80 300 2 MFM
|
|
|
|
360 9 2 (512) 40 300 2 MFM,2STEP
|
|
|
|
640 8 2 (512) 80 300 2 MFM
|
|
|
|
.TE
|
2002-01-10 17:41:22 +00:00
|
|
|
.Ed
|
|
|
|
.It
|
|
|
|
720K drives:
|
|
|
|
.Bd -ragged -offset indent -compact
|
2001-12-25 21:21:18 +00:00
|
|
|
.TS
|
|
|
|
lB lB lB lB lB lB lB
|
|
|
|
r l l l l l l.
|
|
|
|
KB sectrac secsize ncyls speed heads flags
|
|
|
|
720 9 2 (512) 80 250 2 MFM
|
|
|
|
.TE
|
2002-01-10 17:41:22 +00:00
|
|
|
.Ed
|
|
|
|
.It
|
|
|
|
360K drives:
|
|
|
|
.Bd -ragged -offset indent -compact
|
2001-12-25 21:21:18 +00:00
|
|
|
.TS
|
|
|
|
lB lB lB lB lB lB lB
|
|
|
|
r l l l l l l.
|
|
|
|
KB sectrac secsize ncyls speed heads flags
|
|
|
|
360 9 2 (512) 40 250 2 MFM
|
|
|
|
.TE
|
2002-01-10 17:41:22 +00:00
|
|
|
.Ed
|
2001-12-25 21:21:18 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The second form to specify a device density uses
|
|
|
|
.Fl s Ar fmtstr
|
2002-01-10 17:41:22 +00:00
|
|
|
to explicitly specify each parameter in detail.
|
|
|
|
The argument
|
2001-12-25 21:21:18 +00:00
|
|
|
.Ar fmtstr
|
|
|
|
is a comma-separated list of values of the form:
|
|
|
|
.Pp
|
2002-01-10 17:41:22 +00:00
|
|
|
.Sm off
|
|
|
|
.Ar sectrac , secsize , datalen , gap , ncyls , speed ,
|
|
|
|
.Ar heads , f_gap , f_inter , offs2 , flags
|
|
|
|
.Sm on
|
2001-12-25 21:21:18 +00:00
|
|
|
.Pp
|
|
|
|
The meaning of the parameters is:
|
2002-01-10 17:41:22 +00:00
|
|
|
.Bl -tag -width ".Ar secsize"
|
2001-12-25 21:21:18 +00:00
|
|
|
.It Ar sectrac
|
|
|
|
The number of sectors per track.
|
|
|
|
.It Ar secsize
|
|
|
|
The sector size code, 0 = 128 bytes (or less), 1 = 256 bytes, 2 = 512
|
|
|
|
bytes, 3 = 1024 bytes.
|
|
|
|
.It Ar datalen
|
|
|
|
The actual sector size if the size code is 0, or the (ignored) value
|
|
|
|
0xFF for larger size codes.
|
|
|
|
.It Ar gap
|
|
|
|
The length of the gap 3 parameter for read/write operations.
|
|
|
|
.It Ar ncyls
|
|
|
|
The number of cylinders.
|
|
|
|
.It Ar speed
|
2002-01-10 17:41:22 +00:00
|
|
|
The transfer speed in kilobytes per second.
|
|
|
|
Can be 250, 300, 500, or
|
2001-12-25 21:21:18 +00:00
|
|
|
1000, but each drive type only supports a subset of these values.
|
|
|
|
.It Ar heads
|
|
|
|
The number of heads.
|
|
|
|
.It Ar f_gap
|
|
|
|
The length of the gap 3 when formatting media.
|
|
|
|
.It Ar f_inter
|
2002-01-10 17:41:22 +00:00
|
|
|
The sector interleave to be applied when formatting.
|
|
|
|
0 means no
|
2001-12-25 21:21:18 +00:00
|
|
|
interleave, 1 means 1:1 etc.
|
|
|
|
.It Ar offs2
|
2002-01-10 17:41:22 +00:00
|
|
|
The offset of the sector numbers on side 2 (i.e. head number 1).
|
2001-12-25 21:21:18 +00:00
|
|
|
Normally, sector numbering on both sides starts with 1.
|
|
|
|
.It Ar flags
|
|
|
|
A list from one of the following flag values:
|
2002-01-10 17:41:22 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -tag -width ".Cm +perpend" -compact
|
|
|
|
.It Cm +mfm
|
2001-12-25 21:21:18 +00:00
|
|
|
Use MFM encoding.
|
2002-01-10 17:41:22 +00:00
|
|
|
.It Cm -mfm
|
2001-12-25 21:21:18 +00:00
|
|
|
Use FM (single-density) encoding.
|
2002-01-10 17:41:22 +00:00
|
|
|
.It Cm +2step
|
2001-12-25 21:21:18 +00:00
|
|
|
Use 2 steps per each cylinder (for accessing 40-cylinder media in
|
|
|
|
80-cylinder drives).
|
2002-01-10 17:41:22 +00:00
|
|
|
.It Cm -2step
|
|
|
|
Do not use 2 steps per cylinder, i.e. access each physical cylinder
|
2001-12-25 21:21:18 +00:00
|
|
|
of the drive.
|
2002-01-10 17:41:22 +00:00
|
|
|
.It Cm +perpend
|
2001-12-25 21:21:18 +00:00
|
|
|
Use perpendicular recording (for 2.88 MB media, currently not
|
|
|
|
supported).
|
2002-01-10 17:41:22 +00:00
|
|
|
.It Cm -perpend
|
2001-12-25 21:21:18 +00:00
|
|
|
Use longitudinal recording.
|
|
|
|
.El
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
For any missing parameter, the current value will be used, so only
|
2002-01-10 17:41:22 +00:00
|
|
|
actual changes need to be specified.
|
|
|
|
Thus to turn off a flag bit
|
2001-12-25 21:21:18 +00:00
|
|
|
(like
|
2002-01-10 17:41:22 +00:00
|
|
|
.Cm +mfm
|
2001-12-25 21:21:18 +00:00
|
|
|
which is the default for all drive types), the form with a leading
|
|
|
|
minus sign must explicitly be used.
|
|
|
|
.Sh EXAMPLES
|
|
|
|
A simple inquiry about the drive type:
|
|
|
|
.Bd -literal
|
|
|
|
$ fdcontrol /dev/fd0
|
|
|
|
1.44M
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-01-10 17:41:22 +00:00
|
|
|
Same as above, but with verbose output.
|
|
|
|
Note that the result is about
|
2001-12-25 21:21:18 +00:00
|
|
|
the
|
2002-01-10 17:41:22 +00:00
|
|
|
.Em "drive type" ,
|
2001-12-25 21:21:18 +00:00
|
|
|
as opposed to a
|
2002-01-10 17:41:22 +00:00
|
|
|
.Em "device density" ,
|
2001-12-25 21:21:18 +00:00
|
|
|
so it is independent from the actual subdevice being used for
|
|
|
|
.Ar device .
|
|
|
|
.Bd -literal
|
|
|
|
$ fdcontrol -v /dev/fd1.360
|
|
|
|
/dev/fd1.360: 1.2M drive (5.25" high-density)
|
|
|
|
.Ed
|
|
|
|
.\" " <- this one is for Emacs :)
|
|
|
|
.Pp
|
|
|
|
Inquiry about the density settings of a particular subdevice.
|
|
|
|
.Bd -literal
|
|
|
|
$ fdcontrol -F /dev/fd0.720
|
|
|
|
18,512,0xff,0x1b,80,500,2,0x6c,1,0,+mfm
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Note that just accessing a new subdevice for the first time will clone
|
|
|
|
this device using the default density settings for the drive type, as
|
|
|
|
explained in
|
|
|
|
.Xr fdc 4 .
|
|
|
|
Thus, albeit the device name in the example above suggests a 720 KB
|
|
|
|
media density, it has actually been initialized (by the driver) to
|
2002-01-10 17:41:22 +00:00
|
|
|
1440 KB.
|
|
|
|
So, in order to adjust it for standard 720 KB double-density
|
2001-12-25 21:21:18 +00:00
|
|
|
media, one of the following
|
1994-10-30 18:52:01 +00:00
|
|
|
.Nm
|
2002-01-10 17:41:22 +00:00
|
|
|
commands needs to be run:
|
2001-12-25 21:21:18 +00:00
|
|
|
.Bd -literal
|
|
|
|
# fdcontrol -s 9,,,0x20,,250,,0x50 /dev/fd0.720
|
|
|
|
# fdcontrol -f 720 /dev/fd0.720
|
|
|
|
.Ed
|
1996-12-09 08:04:55 +00:00
|
|
|
.Pp
|
2001-12-25 21:21:18 +00:00
|
|
|
As indicated, trailing commas in the parameter list may be omitted.
|
|
|
|
.Pp
|
2002-01-10 17:41:22 +00:00
|
|
|
In order to access archaic 160 KB single-density (FM encoded) 5.25
|
2001-12-25 21:21:18 +00:00
|
|
|
media in a modern 1.2M drive, something like the following definition
|
2002-01-10 17:41:22 +00:00
|
|
|
would be needed.
|
|
|
|
(Note that not all controller hardware is actually
|
2001-12-25 21:21:18 +00:00
|
|
|
capable of handling FM encoding at all.)
|
|
|
|
.Bd -literal
|
|
|
|
# fdcontrol -s 16,128,0x80,0x2,40,300,,0x10,,,-mfm,+2step /dev/fd1.1
|
|
|
|
.Ed
|
1994-10-30 18:52:01 +00:00
|
|
|
.Sh SEE ALSO
|
1997-01-20 00:03:00 +00:00
|
|
|
.Xr fdc 4
|
1994-10-30 18:52:01 +00:00
|
|
|
.Sh HISTORY
|
2001-12-25 21:21:18 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility appeared in
|
|
|
|
.Fx 2.0 ,
|
|
|
|
and has been vastly overhauled in
|
|
|
|
.Fx 5.0 .
|
1998-03-23 08:31:20 +00:00
|
|
|
.Sh AUTHORS
|
2001-12-25 21:21:18 +00:00
|
|
|
The program and this man page have been contributed by
|
2000-11-10 17:46:15 +00:00
|
|
|
.An J\(:org Wunsch ,
|
1994-10-30 18:52:01 +00:00
|
|
|
Dresden.
|