aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/fdread
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-123-3/+3
| | | | | | | | | 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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-3/+9
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Free the memory allocated to trackbuf before exiting, it might fix a potentialMarcelo Araujo2017-05-031-0/+4
| | | | | | | | | | | memory leak. Submitted by: trix@juniper.net MFC after: 2 weeks. Differential Revision: https://reviews.freebsd.org/D9856 Notes: svn path=/head/; revision=317742
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-282-29/+0
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* Use NULL instead of 0 for pointers.Marcelo Araujo2016-04-142-3/+3
| | | | | | | | The strchr(3) returns a NULL if the character does not appears in the string. The malloc will return NULL if cannot allocate memory. Notes: svn path=/head/; revision=297962
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge from head@274682Simon J. Gerraty2014-11-191-20/+6
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=274683
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | - Cleanups pc98 code.Yoshihiro Takahashi2014-09-281-20/+6
|/ | | | | | | - Remove unworked formats. Notes: svn path=/head/; revision=272248
* Mark global functions and/or variables in fdread(8) static where possible.Ed Schouten2011-11-061-8/+8
| | | | | | | This allows compilers and static analyzers to do more thorough analysis. Notes: svn path=/head/; revision=227253
* Open the floppy disk device with O_RDONLY rather than O_RDWR. AfterJoerg Wunsch2011-06-171-1/+1
| | | | | | | | | | all, this is the fd*read* command, and thus should be able to read even write-protected disks. MFC after: 1 week Notes: svn path=/head/; revision=223197
* mdoc: order prologue macros consistently by Dd/Dt/OsUlrich Spörlein2010-04-141-1/+1
| | | | | | | | | | | Although groff_mdoc(7) gives another impression, this is the ordering most widely used and also required by mdocml/mandoc. Reviewed by: ru Approved by: philip, ed (mentors) Notes: svn path=/head/; revision=206622
* The last big commit: let usr.sbin/ use WARNS=6 by default.Ed Schouten2010-01-021-2/+0
| | | | Notes: svn path=/head/; revision=201390
* Drop the defunct FDOPT_NOERRLOG option from all the floppy utilities.Joerg Wunsch2009-06-241-8/+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
* Remove unused variables.Stefan Farfeleder2006-07-201-2/+2
| | | | Notes: svn path=/head/; revision=160522
* fdread cannot work without opening the /dev/fd node in O_RDWR mode now,Peter Wemm2005-10-261-1/+1
| | | | | | | | | | because it sets the floppy controller parameters, which requires O_RDWR. Specifically, the FD_SOPTS ioctl requires this, and the code errors out and aborts if it can't do it. Among other things, it is changing the FDOPT_NOERRLOG flag. Broken in 6.0 as well. Notes: svn path=/head/; revision=151723
* Expand *n't contractions.Ruslan Ermilov2005-02-131-1/+1
| | | | Notes: svn path=/head/; revision=141846
* Added the EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-171-2/+2
| | | | Notes: svn path=/head/; revision=140368
* Cleanup usr.sbin/fd* so they can compile under WARNS=6.Xin LI2005-01-083-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fixed fd related tools on pc98.Yoshihiro Takahashi2004-11-091-0/+39
| | | | | | | Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp> Notes: svn path=/head/; revision=137459
* Rewrite of the floppy driver to make it MPsafe & GEOM friendly:Poul-Henning Kamp2004-08-201-90/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* PC98 got it right here: sectors can be non-512 byte sized.Poul-Henning Kamp2004-07-071-5/+0
| | | | Notes: svn path=/head/; revision=131760
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-11/+22
| | | | Notes: svn path=/head/; revision=131500
* Add PC98 supports.Yoshihiro Takahashi2004-03-282-5/+69
| | | | | | | Submitted by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp> (mostly) Notes: svn path=/head/; revision=127522
* Set size field correctly, it is number of sectors on the device, notPoul-Henning Kamp2004-02-251-2/+6
| | | | | | | | | number of 512 bytes sectors. Recognize size == -1 as meaning "auto". Notes: svn path=/head/; revision=126230
* Use `The .Nm utility'Philippe Charnier2002-04-201-1/+4
| | | | Notes: svn path=/head/; revision=95127
* Long promised major enhancement set for the floppy disk driver:Joerg Wunsch2001-12-152-3/+397
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . 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
* Remove GCC'isms in CFLAGS.David E. O'Brien2001-07-201-1/+0
| | | | Notes: svn path=/head/; revision=80022
* mdoc(7) police: use plain text parentheses with plain text blocks.Ruslan Ermilov2001-07-051-3/+1
| | | | Notes: svn path=/head/; revision=79286
* Break out the function to print the FDC error information intoJoerg Wunsch2001-07-024-44/+114
| | | | | | | fdutil.c so it can be used elsewhere. Notes: svn path=/head/; revision=79110
* Implement the -I option that uses the FD_READID ioctl in order to readJoerg Wunsch2001-06-262-3/+107
| | | | | | | sector ID fields from a floppy, and display them. Notes: svn path=/head/; revision=78857
* Part #2 of the <machine/ioctl_fd.h> => <sys/fdcio.h> move: handle theJoerg Wunsch2001-06-061-2/+1
| | | | | | | tools in usr.sbin/fd*. Notes: svn path=/head/; revision=77801
* Now that we've got the ne765.h file installed under <dev/ic/>, use itJoerg Wunsch2001-06-041-2/+1
| | | | | | | | | here instead of the old "/sys/isa/ic/..." hack. This should fix building the world for machines that don't have a /sys symlink, finally. Notes: svn path=/head/; revision=77729
* Fix man page markup.Joerg Wunsch2001-05-161-23/+28
| | | | | | | Submitted by: ru Notes: svn path=/head/; revision=76685
* Initial import of fdread(1), a logical counterpart to fdwrite(1).Joerg Wunsch2001-05-143-0/+497
Its main purpose is to adapt automatically to the floppy parameters (in particular the track size for efficient reading), and to allow a simple error recovery for CRC-errored sectors. Requires the newly added fdc(4) options. Notes: svn path=/cvs2svn/branches/JOERG/; revision=76589