aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/fdformat
Commit message (Collapse)AuthorAgeFilesLines
* Drop the defunct FDOPT_NOERRLOG option from all the floppy utilities.Joerg Wunsch2009-06-241-6/+1
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=194892
* Fix a nit noticed during translation.Ruslan Ermilov2007-02-281-0/+2
| | | | Notes: svn path=/head/; revision=167104
* The default fill byte is 0xf6, not 0xf5.Ruslan Ermilov2005-11-031-1/+1
| | | | Notes: svn path=/head/; revision=151997
* One of the DIAGNOSTICS sections should be EXIT STATUS.Ruslan Ermilov2005-01-181-6/+6
| | | | Notes: svn path=/head/; revision=140412
* Cleanup usr.sbin/fd* so they can compile under WARNS=6.Xin LI2005-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | fdcontrol/fdcontrol.c: - Add const constraint to an intermediate value which is not supposed to be changed elsewhere. fdread/fdread.c: - Use _devname in favor of devname to avoid name conflicit. - -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) fdread/fdutil.c: - Use more specific initializer fdwrite/fdwrite.c: - Use static on format_track since it's not referenced in other places. - Use const char* to represent string constant. Bump WARNS accordingly. Notes: svn path=/head/; revision=139905
* Rewrite of the floppy driver to make it MPsafe & GEOM friendly:Poul-Henning Kamp2004-08-201-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=134081
* Add PC98 supports.Yoshihiro Takahashi2004-03-281-0/+4
| | | | | | | Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp> (mostly) Notes: svn path=/head/; revision=127522
* From PR:Eric Anholt2004-01-071-1/+1
| | | | | | | | | | | | | | In fdformat.c a closing parenthesis is at the wrong place. Instead of adding sizeof _PATH_DEV + 1 to the length of argv[optind], the length of the string starting (sizeof _PATH_DEV + 1) characters after argv[optind]'s beginning (accessing junk memory if we jump over the terminating null character) is passed to malloc(). PR: bin/60026 Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> Notes: svn path=/head/; revision=124200
* Include <string.h> for some prototypes, rather than depending onMike Barcroft2002-04-011-0/+1
| | | | | | | pollution from <strings.h>. Notes: svn path=/head/; revision=93590
* mdoc(7) police: doh, again I forgot about this XXX.Ruslan Ermilov2002-01-101-2/+1
| | | | Notes: svn path=/head/; revision=89227
* mdoc(7) police: tidy up the markup.Ruslan Ermilov2002-01-101-19/+26
| | | | Notes: svn path=/head/; revision=89226
* Second round of floppy disk driver documentation updates: document theJoerg Wunsch2001-12-251-65/+61
| | | | | | | | | | 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''. :-) Notes: svn path=/head/; revision=88480
* Long promised major enhancement set for the floppy disk driver:Joerg Wunsch2001-12-151-155/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . 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. Notes: svn path=/head/; revision=87992
* mdoc(7) police: s/BSD/.Bx/ where appropriate.Ruslan Ermilov2001-08-141-1/+2
| | | | Notes: svn path=/head/; revision=81622
* mdoc(7) police:Ruslan Ermilov2001-08-071-3/+5
| | | | | | | | | | 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. Notes: svn path=/head/; revision=81251
* Perform a major cleanup of the usr.sbin Makefiles.David E. O'Brien2001-07-201-2/+2
| | | | | | | | 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. Notes: svn path=/head/; revision=80029
* Make fdformat WARN=2 ready.Joerg Wunsch2001-07-032-11/+9
| | | | Notes: svn path=/head/; revision=79161
* Fixed the world breakage in rev. 1.8 (space after -I).Ruslan Ermilov2001-07-031-1/+2
| | | | | | | While here, removed the GCCism (replaced with WARNS?=1). Notes: svn path=/head/; revision=79136
* Use the printstatus() function from ${.CURDIR}/../fdread/fdutil.c toJoerg Wunsch2001-07-023-25/+39
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=79111
* Now that we've got it, use FDOPT_NOERRLOG for fdformat and fdwrite toJoerg Wunsch2001-06-261-1/+5
| | | | | | | | | 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). Notes: svn path=/head/; revision=78858
* Part #2 of the <machine/ioctl_fd.h> => <sys/fdcio.h> move: handle theJoerg Wunsch2001-06-061-1/+1
| | | | | | | tools in usr.sbin/fd*. Notes: svn path=/head/; revision=77801
* fdformat prompts for user confirmation. it exits 0 if the userPoul-Henning Kamp2001-05-231-1/+1
| | | | | | | | | | | doesn't confirm, which needlessly complicates scripts. PR: 15339 Submitted by: richard winkel rich@math.missouri.edu MFC after: 1 week Notes: svn path=/head/; revision=77063
* - Backout botched attempt to introduce MANSECT feature.Ruslan Ermilov2001-03-261-1/+0
| | | | | | | - MAN[1-9] -> MAN. Notes: svn path=/head/; revision=74816
* Set the default manual section for usr.sbin/ to 8.Ruslan Ermilov2001-03-201-2/+4
| | | | Notes: svn path=/head/; revision=74532
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-271-1/+1
| | | | Notes: svn path=/head/; revision=70403
* Add `_PATH_DEVZERO'.David E. O'Brien2000-12-091-1/+2
| | | | | | | Use _PATH_* where where possible. Notes: svn path=/head/; revision=69793
* mdoc(7) police: do not split author names in the AUTHORS section.Ruslan Ermilov2000-11-221-0/+1
| | | | Notes: svn path=/head/; revision=69027
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-3/+3
| | | | Notes: svn path=/head/; revision=68965
* Avoid use of direct troff requests in mdoc(7) manual pages.Ruslan Ermilov2000-11-101-2/+1
| | | | Notes: svn path=/head/; revision=68575
* Add -y option which doesn't ask for confimation, but still shows progressPoul-Henning Kamp2000-06-012-4/+12
| | | | | | | | PR: 9259 Submitted by: Clark Gaylord <cgaylord@vt.edu> Notes: svn path=/head/; revision=61154
* Remove single-space hard sentence breaks. These degrade the qualitySheldon Hearn2000-03-011-4/+8
| | | | | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc. Notes: svn path=/head/; revision=57673
* Fix fdformat to not use /dev/r* device nodes anymore, this usageJeroen Ruigrok van der Werven2000-01-232-8/+8
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=56447
* - Added 640KB and 1232KB formats support.KATO Takenori2000-01-071-2/+12
| | | | | | | | | - Added $FreeBSD$. Submitted by: nyan Notes: svn path=/head/; revision=55541
* Correct use of .Nm.Philippe Charnier1999-10-171-2/+2
| | | | Notes: svn path=/head/; revision=52338
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* Add $Id$, to make it simpler for members of the translation teams toNik Clayton1999-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | track. 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 Notes: svn path=/head/; revision=48791
* mkdosfs(1) is dead, refere to newfs_msdos(8)David E. O'Brien1998-09-291-3/+3
| | | | Notes: svn path=/head/; revision=39768
* fd(4) referenced in HISTORY has nothing to do with floppy disks;Dag-Erling Smørgrav1998-04-201-1/+1
| | | | | | | changed to fdc(4). Notes: svn path=/head/; revision=35333
* .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.Philippe Charnier1998-03-231-2/+6
| | | | Notes: svn path=/head/; revision=34809
* Use err(3). Document options in man page, not in usage string.Philippe Charnier1997-09-172-65/+46
| | | | Notes: svn path=/head/; revision=29531
* Sort cross references.Wolfram Schneider1997-01-201-2/+2
| | | | Notes: svn path=/head/; revision=21880
* Fix a bunch of spelling errors in a bunch of man pages.Mike Pritchard1996-01-301-1/+1
| | | | Notes: svn path=/head/; revision=13744
* Cross-reference newfs(8), and mkdosfs(1).Joerg Wunsch1995-11-051-3/+18
| | | | Notes: svn path=/head/; revision=12107
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8857
* Corrected the xref to the driver man page to be fdc(4) now thatJoerg Wunsch1994-10-281-2/+2
| | | | | | | we have one (instead of fd(4)). Notes: svn path=/head/; revision=3973
* Transfer speed definitions are now also found in <machine/ioctl_fd.h>.Joerg Wunsch1994-09-252-2/+1
| | | | | | | Remove the old include file, since it used to be in a non-public place. Notes: svn path=/head/; revision=3097
* Added a missing ${DESTDIR}. The real problem is that stuff related toPoul-Henning Kamp1994-09-181-1/+1
| | | | | | | | floppy formatting is in /sys/i386/isa/fdreg.h, it should be in /usr/include somewhere ?? Notes: svn path=/head/; revision=2852
* Fix include path.David Greenman1994-09-172-2/+2
| | | | Notes: svn path=/head/; revision=2840
* Make use of the new FDOPT_NORETRY facility. It does not make sense toJoerg Wunsch1994-05-223-55/+60
| | | | | | | | | verify formatted tracks with fully retryng. The head should not be moved in either case. Also some minor copyright cleanup. Notes: svn path=/head/; revision=1533
* From: phk@login.dkuug.dk (Poul-Henning Kamp)Rodney W. Grimes1994-02-201-3/+3
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=1183