History log of /freebsd-head/usr.sbin/fdcontrol/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
087eed5da110b47043bd2822019ea47c3004ffe8 05-Jan-2018 imp <imp@FreeBSD.org> Tag 'a' case as one we're intentionally falling through to
the 'F' case.

CID: 1008176
7551d83c353e040b32c6ac205e577dbc5f2c8955 27-Nov-2017 pfg <pfg@FreeBSD.org> various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
a598c4b809a73772d7452991213407cdac302156 31-Oct-2017 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon
a9ea7aa142e26d77dc4e9c6f0117653a0ace7054 07-Apr-2017 sevan <sevan@FreeBSD.org> Remove the last vestiges of FDC_DEBUG & FD_DEBUG
FDC_DEBUG is not referenced in any c or header files but traces of it
still remain in other files.

PR: 105608
Reported by: Eugene Grosbein <ports AT grosbein DOT net>
Reviewed by: imp
Approved by: bcr (mentor)
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D10303
ba4a75dd95fcb8c368c901ac40fb30d42b5e55db 04-Mar-2017 ngie <ngie@FreeBSD.org> usr.sbin: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

MFC after: 1 month
Sponsored by: Dell EMC Isilon
259480b6de42080f4d3f1e3072e52d3acee596b3 28-Jan-2017 nyan <nyan@FreeBSD.org> Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes: yes
008d7c831feeec7a3430b92f009e28762c6740f1 13-Jun-2015 sjg <sjg@FreeBSD.org> Add META_MODE support.

Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision: D2796
Reviewed by: brooks imp
75a137820de70f75cd932fd2fa365fabaf06fa90 08-Jun-2015 sjg <sjg@FreeBSD.org> dirdeps.mk now sets DEP_RELDIR
5860f0d10657dc9748acf6637885ee7fbf6fb212 16-May-2014 sjg <sjg@FreeBSD.org> Updated dependencies
1a7e48acf1acf8cb3ef3ba6787cc57e18faa8479 10-May-2014 sjg <sjg@FreeBSD.org> Updated dependencies
6d37b86f2b6abb5c0c11a9162e37ddc0ad94f01d 11-Mar-2013 sjg <sjg@FreeBSD.org> Updated dependencies
0ee5295509f95c5780976697a2d3539b994458ca 16-Feb-2013 sjg <sjg@FreeBSD.org> Updated dependencies
9dd41e3647df728006e0749ac139cfeb773c3873 22-Aug-2012 marcel <marcel@FreeBSD.org> Sync FreeBSD's bmake branch with Juniper's internal bmake branch.

Requested by: Simon Gerraty <sjg@juniper.net>
8ffa605b6b0b8ba74eff28f4c60dba75475b9c0b 27-May-2010 uqs <uqs@FreeBSD.org> mdoc: Remove leading garbage, empty lines and order preamble
073cafdd42b9cd60313d46f72dcb8893ae606832 02-Jan-2010 ed <ed@FreeBSD.org> The last big commit: let usr.sbin/ use WARNS=6 by default.
28ee5250ac542f0374f1ec07f32276a5581a2353 24-Jun-2009 joerg <joerg@FreeBSD.org> Drop the defunct FDOPT_NOERRLOG option from all the floppy utilities.
The kernel does not log floppy media errors anymore.

In fdcontrol, do always open the file descriptor in read-only mode so
it can operate on read-only media, as there is no longer a separate
control device to operate on.
bc12979396e6cafc52c416a0a4557ad4e6037e2a 25-Oct-2006 ru <ru@FreeBSD.org> Force the use of the tbl(1) preprocessor.
a3aa8bfa03310dfc6b17bf722f208bbb043ba967 26-Oct-2005 peter <peter@FreeBSD.org> Make fdcontrol work again. It has been broken for a while. It tries
to set the floppy controller parameters, but that requires that the
device node be open in O_RDWR mode now. I think it is broken in 6.0 as
well. This line looks like a stray anyway.
049c85627c463b094dc6fafd968dac0fc27d2d36 08-Jan-2005 delphij <delphij@FreeBSD.org> Cleanup usr.sbin/fd* so they can compile under WARNS=6.

- Add const constraint to an intermediate value
which is not supposed to be changed elsewhere.
- Use _devname in favor of devname to avoid name
- -1 is less than any positive number so in order
to get the block to function, we should get the
block a little earlier.
- Cast to remove signed when we are sure that a
return value is positive, or is compared with
an positive number (tracknumber of a floppy
disk is not likely to have UINT_MAX/2 anyway)
- Use more specific initializer
- Use static on format_track since it's not
referenced in other places.
- Use const char* to represent string constant.

Bump WARNS accordingly.
99669f6c435eaf7942060ee1fa6c2da7de5a85d6 08-Jan-2005 delphij <delphij@FreeBSD.org> Follow style.Makefile(5):
WARNS comes before CFLAGS

This reduces diff against my local branch.
91de1b896dea3928223e2531589b4c7c0d422ada 20-Aug-2004 phk <phk@FreeBSD.org> Rewrite of the floppy driver to make it MPsafe & GEOM friendly:

Centralize the fdctl_wr() function by adding the offset in
the resource to the softc structure.

Bugfix: Read the drive-change signal from the correct place:
same place as the ctl register.

Remove the cdevsw{} related code and implement a GEOM class.

Ditch the state-engine and park a thread on each controller
to service the queue.

Make the interrupt FAST & MPSAFE since it is just a simple
wakeup(9) call.

Rely on a per controller mutex to protect the bioqueues.
Grab GEOMs topology lock when we have to and Giant when
ISADMA needs it. Since all access to the hardware is
isolated in the per controller thread, the rest of the
driver is lock & Giant free.

Create a per-drive queue where requests are parked while
the motor spins up. When the motor is running the requests
are purged to the per controller queue. This allows
requests to other drives to be serviced during spin-up.

Only setup the motor-off timeout when we finish the last
request on the queue and cancel it when a new request
arrives. This fixes the bug in the old code where the motor
turned off while we were still retrying a request.

Make the "drive-change" work reliably. Probe the drive on
first opens. Probe with a recal and a seek to cyl=1 to
reset the drive change line and check again to see if we
have a media.

When we see the media disappear we destroy the geom provider,
create a new one, and flag that autodetection should happen
next time we see a media (unless a specific format is configured).

Add sysctl tunables for a lot of drive related parameters.
If you spend a lot of time waiting for floppies you can
grab the i82078 pdf from Intels web-page and try tuning

Add sysctl debug.fdc.debugflags which will enable various
kinds of debugging printfs.

Add central definitions of our well known floppy formats.

Simplify datastructures for autoselection of format and
call the code at the right times.

Bugfix: Remove at least one piece of code which would have
made 2.88M floppies not work.

Use implied seeks on enhanced controllers.

Use multisector transfers on all controllers. Increase
ISADMA bounce buffers accordingly.

Fall back to single sector when retrying. Reset retry count
on every successful transaction.

Sort functions in a more sensible order and generally tidy
up a fair bit here and there.

Assorted related fixes and adjustments in userland utilities.

Do allow r/w opens of r/o media but refuse actual write
operations. This is necessary until the p4::phk_bufwork
branch gets integrated (This problem relates to remounting
not reopening devices, see sys/*/*/${fs}_vfsops.c for details).

Keep PC98's private copy of the old floppy driver compiling
and presumably working (see below).

TODO (planned)

Move probing of drives until after interrupts/timeouts work
(like for ATA/SCSI drives).

TODO (unplanned)

This driver should be made to work on PC98 as well.

Test on YE-DATA PCMCIA floppy drive.

Fix 2.88M media.

This is a MT5 candidate (depends on the bioq_takefirst() addition).
6294018a208cf7742b1c021a9b75c26962505571 02-Jul-2004 ru <ru@FreeBSD.org> Mechanically kill hard sentence breaks.
e98d4c3ef77614f04587bd93a2cbd39a3337e1b7 04-Jun-2004 ru <ru@FreeBSD.org> Fixed warnings (missing .Ed call).
Fixed grammar (missing punctuation).
Fixed screwup with the SEE ALSO section.
1425c998a18db105fcdc560157ebc5bb857ab2e6 28-Mar-2004 nyan <nyan@FreeBSD.org> Add PC98 supports.

Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp> (mostly)
aa2ff441f57e24f530f2f5196457cb11bf9d44c9 26-Feb-2004 bde <bde@FreeBSD.org> Backed out previous commit (bogus addition of -static to CFLAGS).

Sorted macros (in build order).
67b3e47c3b09e121c59c3ea64ff1e3894621d516 25-Feb-2004 phk <phk@FreeBSD.org> Update manual page.

Give 8" example for the heck of it.
8e9d9728d468509b765adc961f6fc9dd547ec66d 25-Feb-2004 phk <phk@FreeBSD.org> Recognize "auto" format.

Be more verbose when asked to.
579c68426dae43f5c1d3267a39564c6d2a1f44ef 06-Jul-2003 markm <markm@FreeBSD.org> Grammar tweaking. "has been" is very often not as good as "is" or "was".
7293a24a2b093fcb82ba80e14cb33ff03e2e24e8 03-May-2003 obrien <obrien@FreeBSD.org> Use __FBSDID over rcsid[]. Protect copyright[] where needed.
a920d12f895baea61f01b199f25047011e4ff386 04-Apr-2003 obrien <obrien@FreeBSD.org> style.Makefile(5)
fec6546e12b076c18d8f6ccef5737bc62ee319cc 27-Dec-2002 schweikh <schweikh@FreeBSD.org> english(4) police.
b645ad67e5da8f394ffda06e6c9ad716fe872820 10-Jan-2002 ru <ru@FreeBSD.org> mdoc(7) police: tidy up the markup.
ee2b4317cd76097817173c18b5a1d23903f1d9f4 25-Dec-2001 joerg <joerg@FreeBSD.org> Second round of floppy disk driver documentation updates: document the
changes in the userland utilities. For fdcontrol(8), i now finally
keep my promise made more than 7 years ago that ``the fdcontrol
utility is currently under development and the user interface will
likely change''. :-)
b2bcdd0ab8129dadaba668862099bdcf62c0a673 15-Dec-2001 joerg <joerg@FreeBSD.org> Long promised major enhancement set for the floppy disk driver:

. The main device node now supports automatic density selection for
commonly used media densities. So you can stuff your 1.44 MB and
720 KB media into your drive and just access /dev/fd0, no questions
asked. It's all that easy, isn't it? :)

. Device density handling has been completely overhauled. The old way
of hardwired kernel density knowledge is no longer there. Instead,
the kernel now implements 16 subdevices per drive. The first
subdevice uses automatic density selection, while the remaining 15
devices are freely programmable. They can be assigned an arbitrary
name of the form /dev/fd[:digit]+.[:digit:]{1,4}, where the second
number is meant to either implement device names that are mnemonic
for their raw capacity (as it used to be), or they can alternatively
be created as "anonymous" devices like fd0.1 through fd0.15,
depending on the taste of the administrator. After creating a
subdevice, it is initialized to the maximal native density of the
respective drive type, so it needs to be customized for other
densities by using fdcontrol(8). Pseudo-partition devices (fd0a
through fd0h) are still supported as symlinks.

. The old hack to use flags 0x1 to always assume drive 0 were there is
no longer supported; this is now supposed to be done by wiring the
devices down from the loader via device flags. On IA32
architectures, the first two drives are looked up in the CMOS
configuration records though. On PCMCIA (i. e., the Y-E Data
controller of the Toshiba Libretto), a single drive is always

. Other specialities like disabling the FIFO and not probing the drive
at boot-time are selected by per-controller or per-drive flags, too.

. Unit attentions (media has been changed) are supposed to be detected
now; density autoselection only occurs after a unit attention. (Can
be turned off by a per-drive flag, this will cause each Fdopen() to
perform the autoselection.)

. FM floppies can be handled now (on controllers that actually support
it -- not all do these days).

. Fdopen() can be told to avoid density selection by setting
O_NONBLOCK; this leaves the descriptor in a half-opened state where
only a few ioctls are accepted. This is necessary to run fdformat
on a device that uses automatic density selection (since you cannot
autoselect on an unformatted medium, obviously).

. Just differentiate between a plain old NE765 and the enhanced chips,
but don't try more; the existing code was wrong and only misdetected
the chips anyway.


. All documentation update still needs to be done.

. Formatting not-so-standard format yields unpredictable results; i
have yet to figure out why this happens. "Standard" formats like
720 and 1440 KB do work, however.

. rc scripts are needed to setup device nodes with nonstandard
densities (like the old /dev/fdN.MMM we used to have).

. Obtaining device flags from the kernel environment doesn't work yet,
thus currently only drives that are present in (IA32) CMOS are
really detected. Someone who knows the odds and ends about device
flags is needed here, i can't figure out what i'm doing wrong.

. 2.88 MB still needs to be done.
43457588767caedd16dbf19162de0a6a435dfeda 07-Aug-2001 ru <ru@FreeBSD.org> mdoc(7) police:

Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
9c97c8f02d579c6988b1d150fd1c0fa8dacf2e87 20-Jul-2001 obrien <obrien@FreeBSD.org> Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
911ca14c8798a89d240d36ecbc63b5df5dd99f66 15-Jul-2001 dd <dd@FreeBSD.org> Remove whitespace at EOL.
e9ec4f9449c4450e8cbbc012add4cbc1a01a53b3 26-Jun-2001 dd <dd@FreeBSD.org> Add appropriate includes and prototypes; staticize; set WARNS=2. Also
minor Makefile nits.

Submitted by: Mike Barcroft <mike@q9media.com>
57715b596bf3feab8184511b5f6b67760a98e7a8 06-Jun-2001 joerg <joerg@FreeBSD.org> Part #2 of the <machine/ioctl_fd.h> => <sys/fdcio.h> move: handle the
tools in usr.sbin/fd*.
afd506414eebce28d614a4695ce243499d0139bc 26-Mar-2001 ru <ru@FreeBSD.org> - Backout botched attempt to introduce MANSECT feature.
- MAN[1-9] -> MAN.
f10dc9aca1097011cc6fd2f38be5e855132c46f0 20-Mar-2001 ru <ru@FreeBSD.org> Set the default manual section for usr.sbin/ to 8.
71e2293ad43d8745a8e735483e3f07631714be05 20-Nov-2000 ru <ru@FreeBSD.org> mdoc(7) police: use the new features of the Nm macro.
a6f5d950d860b642619fd71c1efc1875f906cc17 10-Nov-2000 ru <ru@FreeBSD.org> Avoid use of direct troff requests in mdoc(7) manual pages.
b2240fc1c08ba82628285458b057b5f795a68a43 01-Mar-2000 sheldonh <sheldonh@FreeBSD.org> Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
1a5e1018dbce6bab3563265824dbe39819e88f28 17-Oct-1999 charnier <charnier@FreeBSD.org> Xref to warn(3) which is used instead of perror.
efabb9ccb197b05958967dd035c279ba3bc19cb0 28-Aug-1999 peter <peter@FreeBSD.org> $Id$ -> $FreeBSD$
559bbb333e639cd5821f5c84f513b929aabcae50 12-Jul-1999 nik <nik@FreeBSD.org> Add $Id$, to make it simpler for members of the translation teams to

The Id line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde
6e321f37d49e64bb44519bc6e45ea1fb1d3fc284 23-Mar-1998 charnier <charnier@FreeBSD.org> .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.
29e06a9a5c16dd58466848804b71e9aa020e2839 17-Sep-1997 charnier <charnier@FreeBSD.org> Perror() -> warn().
691010efad5c05f7ee86a870abce217fe8e9b8d1 31-Mar-1997 imp <imp@FreeBSD.org> compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
8152bc85d1a93ad68ee317b567deb6e6ffab8ec7 11-Mar-1997 peter <peter@FreeBSD.org> Update to work under Lite2 includes
3c5e4a3bbe7e5de66ac045a53ba217928a114996 20-Jan-1997 wosch <wosch@FreeBSD.org> Sort cross references.
6c8b1af21eebb1fe0653e3aa5728cb8599b8cde2 09-Dec-1996 mpp <mpp@FreeBSD.org> Minor formatting/style fixes.

Submitted by: Sandro Sigala <sandro@cat.local.net> as part of PR# 2134
511d4f82b255a7fa34ffa2c1cd048cef32acefa2 30-Jan-1996 mpp <mpp@FreeBSD.org> Fix a bunch of spelling errors in a bunch of man pages.
4f960dd75f181e9fa2edc44324f15f0ab5c64b37 30-May-1995 rgrimes <rgrimes@FreeBSD.org> Remove trailing whitespace.
5d1a6c44a12e8f1ec75feb60c87217224e0de1e0 30-Oct-1994 joerg <joerg@FreeBSD.org> Import the fdcontrol command. It has been in 1.1.5, but obviously has been lost on its way to 2.0.
This program uses the FD_DEBUG ioctl, which will have to be commited yet.