History log of /freebsd-current/sys/sys/fdcio.h
Revision Date Author Comments
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# f6e54eb3 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

sys: clean up empty lines in .c and .h files


# c4e20cad 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/sys: further 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.


# 2b375b4e 27-Jan-2017 Yoshihiro Takahashi <nyan@FreeBSD.org>

Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes: yes


# c1a6d28a 09-Mar-2016 Warner Losh <imp@FreeBSD.org>

Add raw RX-50 support. These are 400k single sided disks with 80
tracks and 10 sectors per track. More exotic RX-50 types not
supported, nor is there support for de-interleaving the first two
tracks where the physical sectors are 0 1 2 3 4 5 6 7 8 9, but they
should be interpreted as 0 5 1 6 2 7 3 8 4 9. This is purely to read
the media with dd. The FAT that's on these disks won't work with
msdosfs anyway.


# 2606213f 28-Sep-2014 Yoshihiro Takahashi <nyan@FreeBSD.org>

- Cleanups pc98 code.
- Remove unworked formats.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 60727d8b 06-Jan-2005 Warner Losh <imp@FreeBSD.org>

/* -> /*- for license, minor formatting changes


# eadb1eda 09-Nov-2004 Yoshihiro Takahashi <nyan@FreeBSD.org>

Fixed fd related tools on pc98.

Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp>


# f0d0ca8c 23-Aug-2004 Yoshihiro Takahashi <nyan@FreeBSD.org>

Restore FD_DEBUG for pc98.


# 1b67be7b 20-Aug-2004 Poul-Henning Kamp <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
these.

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.

WORKAROUNDS:
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).


# 1a6bed68 15-Dec-2001 Joerg Wunsch <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
assumed.

. 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.

BUGS and TODOs:

. 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.


# 250300eb 26-Jun-2001 Joerg Wunsch <joerg@FreeBSD.org>

Implement a new ioctl command for floppies: FD_READID

Reads one sector ID field from a given track. Useful for analyzing
floppies.


# 2995d110 14-May-2001 Joerg Wunsch <joerg@FreeBSD.org>

Implement a few more floppy ioctl commands and IO options, namely:

. FD_CLRERR clears the error counter, thus re-enables kernel error
printf()s,

. FD_GSTAT obtains the last FDC operation state, if any,

. FDOPT_NOERRLOG (temporarily) turns off kernel printf() floppy
error logging,

. FDOPT_NOERROR makes the kernel ignore an FDC error, thus can
enable the transfer of an erroneous sector to the user application

All options are being cleared on (last) close.

Prime consumer of the last features will be fdread(1), to be committed
shortly.

(FD_CLRERR should be wired into fdcontrol(8), but then fdcontrol(8)
needs a major rewrite anyway.)


# 664a31e4 28-Dec-1999 Peter Wemm <peter@FreeBSD.org>

Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 6875d254 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# ebedb5ad 21-Sep-1996 Bruce Evans <bde@FreeBSD.org>

Cleaned up all headers that include <sys/ioctl.h> or <sys/ioccom.h>:
- don't include <sys/ioctl.h> in any header. Include <sys/ioccom.h>
instead. This was already done in 4.4Lite for the most important
ioctl headers. Header spam currently increases kernel build
times by 10-20%. There are more than 30000 #includes (not counting
duplicates) for compiling LINT.
- include <sys/types.h> if and only it is necessary to make the header
almost self-sufficient (some ioctl headers still need structs from
elsewhere).
- uniformized idempotency ifdefs. Copied the style in the 4.4Lite
ioctl headers.


# 6c5e9bbd 30-Jan-1996 Mike Pritchard <mpp@FreeBSD.org>

Fix a bunch of spelling errors in the comment fields of
a bunch of system include files.


# c20c8046 30-Oct-1994 Joerg Wunsch <joerg@FreeBSD.org>

Included the command definition for FD_DEBUG.
This way, it's possible for a user to activate/deactivate floppy driver
debugging, even if (s)he doesn't like the overhead of running DDB.
Since some ppl tend to have problems with their drives, this might be
valuable for investigations.


# 011b09f9 25-Sep-1994 Joerg Wunsch <joerg@FreeBSD.org>

Copied over the transfer speed definitions from sys/i386/isa/fdreg.h.
This is needed for having the fdformat program no longer searching
non-public include paths.


# 3a2f7427 17-Sep-1994 David Greenman <dg@FreeBSD.org>

Updated driver to the 1.1.5 version:

date: 1994/05/22 12:35:38; author: joerg; state: Exp; lines: +6 -6
First round of floppy changes. Try making `fd' more robust.

New features:
. ioctl command for setting the drive type (density etc.); restricted
to the super-user
. ioctl for getting/seting `drive options'; currently only option
is FDOPT_NORETRY: inhibit the usual retries; used when verifying
a newly formatted track

Fixes:
. function prototypes
. made all internal functions `static'
. cleaned up & corrected .h files
. restructured, to make the chaotic function sequence more rational
. compiled with -Wall, and cleared all warnings
. introduced a mirror for the (write-only) `digital output register',
to avoid the current kludge
. device probing completed by seeking/recalibrating, and looking
for track 0 being found
. holding the controller down in reset state while it is idle (and
thus saving allot of headaches)
. make requests fail that are not a multiple of the (physical)
sector size
. removed the fixed physical sector size (512 bytes), allowing for any
size the controller could handle (128/256/512/1024 bytes)
. replaced some silly messages
. fixed the TRACE* macro usage, debugging reports should be complete
now again (debugging output is HUGE! though)
. removed fd_timeout for SEEK command; seeks are always reported by
the controller to succeed, since the `success' only refers to the
controller's idea of success - there is no hardware line to tell about
the seek end (other than the `track 0' line)
. catch SENSEI's that report about a `terminated due to READY changed'
status - could happen after a controller reset
. converted ``hz / <something>'' divide operations to divisors that are
powers of two, so gcc can optimize them into shifts
. write/format operations are checked against a write-protected medium
now *prior* starting the operation
. error reports of `invalid command' and `wrong cylinder' will cause
shortcuts in the retrier() now
. fixed a bug in the retrier() causing bogus block numbers to be reported
. fdformat() does care for errors now

Known Bugs:
. no attempts have been made (yet) to improve the performance
. sometimes, bogus ``seek/recalib failed'' messages are logged; this
is still a bug in the driver, but it's not harmful since it's
usually caught by the retrier()

Reviewed by:
Submitted by:
Obtained from:


# 3c4dd356 02-Aug-1994 David Greenman <dg@FreeBSD.org>

Added $Id$


# 994f4bd1 26-Jan-1994 Andrey A. Chernov <ache@FreeBSD.org>

Replace old-style Joerg copyright to berkeley-style,
per Joerg request.


# 8b6f2438 20-Dec-1993 Andrey A. Chernov <ache@FreeBSD.org>

Separate read/write and format GAPs.


# 52449fdb 18-Dec-1993 Andrey A. Chernov <ache@FreeBSD.org>

From vak@kiae.su:
incorporate Joerg Wunsch floppy formatting code