Commit Graph

20 Commits

Author SHA1 Message Date
Mike Barcroft
467a0b0647 Include <string.h> for some prototypes, rather than depending on
pollution from <strings.h>.
2002-04-01 21:13:17 +00:00
Joerg Wunsch
1a6bed6863 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.
2001-12-15 19:09:04 +00:00
Joerg Wunsch
4f0b1b7805 Make fdformat WARN=2 ready. 2001-07-03 21:43:41 +00:00
Joerg Wunsch
e42ad56f1a Use the printstatus() function from ${.CURDIR}/../fdread/fdutil.c to
give a bit more information about up to 10 errors encountered during
formatting (unless -q has been specified, of course).

While being here, removed a bitrotten comment in the Makefile, and
kill the old Emacs local variable stuff at the end of fdformat.c
that's no longer useful anway.
2001-07-02 21:24:03 +00:00
Joerg Wunsch
a5cef3b45a Now that we've got it, use FDOPT_NOERRLOG for fdformat and fdwrite to
avoid blasting the syslog with error messages from bad floppies.  Both
tools have their own error reporting anyway (which could easily be
cluttered by the syslog output on your terminal).
2001-06-26 22:19:32 +00:00
Joerg Wunsch
d137c337ae Part #2 of the <machine/ioctl_fd.h> => <sys/fdcio.h> move: handle the
tools in usr.sbin/fd*.
2001-06-06 06:16:19 +00:00
Poul-Henning Kamp
ad70dcf35a fdformat prompts for user confirmation. it exits 0 if the user
doesn't confirm, which needlessly complicates scripts.

PR:		15339
Submitted by:	richard winkel rich@math.missouri.edu
MFC after:	1 week
2001-05-23 20:30:45 +00:00
David E. O'Brien
1a37aa566b Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
Poul-Henning Kamp
d2c1dda326 Add -y option which doesn't ask for confimation, but still shows progress
PR:		9259
Submitted by:	Clark Gaylord <cgaylord@vt.edu>
2000-06-01 22:27:30 +00:00
Jeroen Ruigrok van der Werven
31245fb201 Fix fdformat to not use /dev/r* device nodes anymore, this usage
has been made obsolete by the block/char device merging.

Reflect this change in the manual page and fix the usage of a
backslash in ``e.g.''.

Reviewed by:	bright, sheldonh, phk
2000-01-23 12:49:42 +00:00
KATO Takenori
d0fd62ec07 - Added 640KB and 1232KB formats support.
- Added $FreeBSD$.

Submitted by:	nyan
2000-01-07 09:02:47 +00:00
Philippe Charnier
6c9d588507 Use err(3). Document options in man page, not in usage string. 1997-09-17 06:32:45 +00:00
Rodney W. Grimes
709e8f9ae1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
Joerg Wunsch
9a89db44b8 Transfer speed definitions are now also found in <machine/ioctl_fd.h>.
Remove the old include file, since it used to be in a non-public place.
1994-09-25 18:44:26 +00:00
David Greenman
f38ec702f9 Fix include path. 1994-09-17 17:55:03 +00:00
Joerg Wunsch
538788f367 Make use of the new FDOPT_NORETRY facility. It does not make sense to
verify formatted tracks with fully retryng. The head should not be moved
in either case.
Also some minor copyright cleanup.
1994-05-22 17:43:34 +00:00
Rodney W. Grimes
6ae4c6218f From: phk@login.dkuug.dk (Poul-Henning Kamp)
Message-Id: <9402201119.AA06430@login.dkuug.dk>
Subject: bug in fdformat.c

There is a bug in fdformat.c: the number of heads are hardcoded in two places.
This is quite inconsequencial at present, but a bug nontheless.
1994-02-20 15:41:59 +00:00
Andrey A. Chernov
d4ef5cfd2e Fix size of il (interleave) array. 1994-02-10 01:20:28 +00:00
Andrey A. Chernov
bef69b45a7 Add interleave > 1 support by Poul-Henning Kamp.
Chack valid range of sectors per track.
1994-02-10 01:15:01 +00:00
Andrey A. Chernov
4f81180d76 We got now floppy formatter 1994-01-26 23:44:34 +00:00