fdutils-5.6/0000755000175000017500000000000014004352174011770 5ustar alainalainfdutils-5.6/doc/0000755000175000017500000000000014004352135012532 5ustar alainalainfdutils-5.6/doc/css/0000755000175000017500000000000013774372667013353 5ustar alainalainfdutils-5.6/doc/css/fdutils.css0000444000175000017500000000465110211702710015504 0ustar alainalainbody { text-align: center; } .titelchen { color: #660000; font-weight: bold; } .datum { color: #99cc33; font-weight: bold; } .globaltitle { font-weight: bold; color: #660000; font-size: 64px; text-align: center; } #frame { margin-right: auto; margin-left: auto; margin-top: auto; padding: 0px; text-align: left; } #leftcolumn { float: left; clear: both; } #navbar { background: #dddd99; font-size: 12px; margin-right: 30px; padding: 5px 10px 1px 1px; } #penguin { vertical-align: top; padding: 5px; font-size: 12px; text-align: left; } #contentright { clear: right; font-family: "Trebuchet MS", verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #003366; padding: 0px 0px 0px 5px; margin-left: 240px; } #logobar { font-family: "Courier New",Courier,Monaco,monospace; font-size: 12px; color: #003366; margin-right: 70px; } p,pre { text-align: left; } table { font-family: "Trebuchet MS", verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #003366; } a { font-family: "Courier New",Courier,Monaco,monospace; font-size: 12px; font-weight: 600; } a:link { color: #660033; text-decoration: none; } a:visited { color: #660033; text-decoration: none; } a:hover { color: #ffffff; text-decoration: none; background-color: #990000; } a.picture:hover { background-color: #ffffff; } a:active { color: #0000EE; text-decoration: none; background-color: #FFFF99; } #contentright p { font-size: 12px; } #contentright h1 { font-size: 24px; color: #660033; padding: 0px; margin-bottom: 20px; text-align: right; } #contentright h2 { font-size: 18px; color: #003300; padding: 0px; margin-bottom: 10px; } #contentright h3 { font-size: 14px; color: #003300; padding: 0px; margin-bottom: 10px; } pre { border-color: black; border-width: thin; border-style: solid; display: table-cell; text-align: left; padding: 5px; padding-bottom: 0px; background: #fff8f0 } .blueboard { border-color: black; border-width: thin; border-style: solid; display: table-cell; text-align: center; padding: 5px; padding-top: 0px; padding-bottom: 0px; background: #c0e0ff } .whiteboard { border-color: black; border-width: thin; border-style: solid; display: table-cell; text-align: center; padding: 5px; padding-bottom: 0px; background: #ffffff } .code { color: #ff4040; font-weight: bold; } p { text-align: justify; } fdutils-5.6/doc/diskd.texi0000444000175000017500000000350507704057263014541 0ustar alainalain@node diskd, diskseekd, Commands, Commands @section diskd @pindex diskd The diskd command has the following syntax: @example @code{diskd} [@code{-d} @var{drive}] [@code{-i} @var{interval}] [@code{-e} @var{command}] @end example Diskd waits for a disk to be inserted into a given @var{drive}, and then either executes the @var{command} or exits. This program can be used to automatically mount a disk as soon as it is inserted. @subsection Warning This program works by switching the motor on for a very short interval, and then seeking to track -1. This might damage hardware in the long run. Amigas, which also use these techniques, are known for having problems with their disk drives no longer spinning up properly after a few month of usage. @subsection Options @table @code @item -d @var{drive} Selects the drive to observe for disk insertion. By default, drive 0 (@code{/dev/fd0}) is observed. @item -i @var{interval} Selects the polling interval. The interval is given in tenths of seconds. Default is 10 (one second). @item -e @var{command} Gives the command to be executed when a disk is inserted. If no command is given the program simply exits. Typically, the command mounts the disk. It can be a shell scripts which probes for several filesystems and disk geometries until it succeeds. @end table @subsection Bugs @itemize @bullet @item Automatic unmounting cannot yet be handled. It is indeed not enough to scan for disk removal, because when the disk is removed, it is already too late: There might be some buffers needing flushing. However, the @code{fdmountd} program allows automatic unmounting by using the @code{SYNC} mount options, which switches off write buffering (@pxref{fdmount}). @item The drive motor is running all the time, and on some computers, the drive led flickers at each time the drive is polled. @end itemize fdutils-5.6/doc/diskseekd.texi0000444000175000017500000000322507464324643015412 0ustar alainalain@node diskseekd, fdmount, diskd, Commands @section diskseekd @pindex diskseekd @cindex dust (shaking it off from a drive) @cindex shaking off dust from a drive Several people have noticed that Linux has a bad tendency of killing floppy drives. These failures remained completely mysterious, until somebody noticed that they were due to huge layers of dust accumulating in the floppy drives. This cannot happen under Messy Dos, because this excuse for an operating system is so unstable that it crashes roughly every 20 minutes (actually less if you are running Windows). When rebooting, the BIOS seeks the drive, and by doing this, it shakes the dust out of the drive mechanism. @code{diskseekd} simulates this effect by seeking the drive periodically. If it is called as @code{diskseek}, the drive is seeked only once. @subsection Options The syntax for @code{diskseekd} is as follows: @example @code{diskseekd} [@code{-d} @var{drive}] [@code{-i} @var{interval}] [@code{-p} @var{pidfile}] @end example @table @code @item -d @var{drive} Selects the drive to seek. By default, drive 0 (@file{/dev/fd0}) is seeked. @item -i @var{interval} Selects the cleaning interval, in seconds. If the interval is 0, a single seek is done. This is useful when calling diskseek from a crontab. The default is 1000 seconds (about 16 minutes) for @code{diskseekd} and 0 for @code{diskseek}. @item -p @var{pidfile} Stores the process id of the diskseekd daemon into @var{pidfile} instead of the default @file{/var/run/diskseekd.pid}. @end table @subsection Bugs @enumerate @item Other aspects of Messy Dos' flakiness are not simulated. @item This section lacks a few smileys. @end enumerate fdutils-5.6/doc/driveprm.texi0000444000175000017500000001246210211706523015260 0ustar alainalain@node Drive descriptions, Extended formats, Media description, Top @chapter Drive descriptions Unlike earlyer version, fdutils-5.0 separates drive descriptions and media description. For more details on this separation, @pxref{Introduction (Mediaprm)}. Drive descriptions are used to describe the hardware characteristics of a drive, such as their maximal density, their rotation speed, their form factor, etc. @menu * Syntax of a drive description :: What to put into a drive description * Drive definition file :: Where drive definitions are stored @end menu @node Syntax of a drive description, Drive definition file, Drive descriptions, Drive descriptions @section Syntax A drive description is a series of @emph{variable=value} and @emph{selector} clauses. @menu * Density :: The maximal available density on the drive * Form factor :: Whether this drive is a 3 1/2", 5 1/4" or 8" drive * Cmos code :: Sums up both density and form factor * Other parameters :: Rotation speed and tracks per inch @end menu @node Density, Form factor, Syntax of a drive description, Syntax of a drive description @subsection Density The density of a drive is the highest media density that it supports. Density is one of @code{sd}, @code{dd}, @code{qd}, @code{hd} or @code{ed}. Usually, you do not need to specify this parameter, as it can be derived from the drives CMOS code. @node Form factor, Cmos code, Density, Syntax of a drive description @subsection Form factor The form factor of a drive describes the physical dimensions of the media it accepts. It is one of @code{3.5}, @code{5.25} or @code{8}. Usually, you do not need to specify this parameter, as it can be derived from the drives CMOS code. @node Cmos code, Other parameters, Form factor, Syntax of a drive description @subsection Cmos code The PC Bios already knows on its own about the most common drive types. These are named by an integer from 1 to 6, according to the following table. @example 0 no drive installed 1 5.25 DD 2 5.25 HD 3 3.5 DD 4 3.5 HD 5 3.5 ED 6 3.5 ED @end example As you see 3.5 ED drives have two possible codes. Some BIOSes use 5, others use 6. The reason for this is that initially 5 was intended for floppy tape drives, and only 6 was for 3.5 ED drives. However, some BIOS manufacturers didn't know about this convention, and used 5 for the then "new" 3.5 ED drives. Usually, you do not need to specify this parameter, as it can be read from the physical CMOS of your PC. This parameter may be useful if your BIOS does not store the drive's CMOS code at the expected place, or if you have more than two drives. @node Other parameters, , Cmos code, Syntax of a drive description @subsection Other parameters @table @code @item deviation=@var{deviation} Tells how much more/less raw capacity the drive has than the standard. Due to slightly different rotation speeds @footnote{drives do not always rotate at exactly 5 or 6 rotations per second, but some may be slightly faster or slightly slower than spec} and to slightly different data transfer rates, the raw capacity per track can vary slightly. For normal formats, these small deviations from the prescribed raw capacity is not harmful, as these have plenty of safety margins built in. However, the new extra capacity formats are affected by this, as they try to squeeze every available raw byte out of the disk. Deviation is expressed in ppm. Positive values mean a higher raw capacity than normal, and negative values mean a lower raw capacity than normal. The deviation can be measured using the @code{floppymeter} program. @item rpm=@var{rotation_speed} Prescribed rotation speed of the drive, expressed in rotations per minute. This is 360 for 5 1/4 HD drives, and 300 for all other commonly available drive types. Usually, you do not need to specify this parameter, as it can be derived from the drive's CMOS code. It is useful however for single density drives or other drives not commonly found on a PC. Usually, you do not to specify this parameter, as it can be derived from the drive's form factor and maximal density. @item tpi=@var{cylinder_density} This parameter is only meaningful for 5 1/4 drives. It expresses whether the drive is able to use 80 tracks (@code{tpi=96}) or only 40 (@code{tpi=48}). Usually, you do not to specify this parameter, as it can be derived from the drive's maximal density: quad density and high density drives are 96 tpi, whereas double density drives are 48 tpi. @end table @node Drive definition file, , Syntax of a drive description, Drive descriptions @section The drive definition file in @file{/usr/local/etc/fddriveprm} @file{/usr/local/etc/fddriveprm} @footnote{The actual location of this file depends on the value of the @code{sysconfdir} compile time configuration variable (@pxref{Compile-time configuration} for details)} contains a dictionary of commonly used media descriptions. Each description is identified by a name, which can then be used by setfdprm or superformat to refer to it, instead of an explicit description. Each definition starts with @code{"drive}@emph{number}@code{":}, followed by the actual description. Definitions may be spread over several lines, for better readability. The file may contain comments, which start with # and stop at the end of the line. fdutils-5.6/doc/fd.40000444000175000017500000001757207560752216013237 0ustar alainalain'\" t .\"{{{}}} .\"{{{ Notes .\" Copyright (c) 1993 Michael Haardt (michael@moria.de) .\" and 1994,1995, 1997 Alain Knaff (alain@linux.lu) .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, .\" USA. .\"}}} .\"{{{ Title .TH FD 4 "Jul 3, 1999" "Linux" "Special files" .\"}}} .\"{{{ Name .SH NAME fd \- floppy disk device .\"}}} .\"{{{ Configuration .SH CONFIGURATION Floppy drives are block devices with major number 2. Typically they are owned by root.floppy and have either mode 0660 (access checking via group membership) or mode 0666 (everybody has access). For the following devices, \fIn\fP is the drive number. It is 0 for the first drive, 1 for the second etc. To get a minor number for a specific drive connected to the first controller, add \fIn\fP to the minor base number. If it is connected to the second controller, add \fIn\fP+128 to the minor base number. \fBWarning: If you use formats with more tracks than supported by your drive, you may damage it mechanically.\fP Trying once if more tracks than the usual 40/80 are supported should not damage it, but no warranty is given for that. Don't create device entries for those formats to prevent their usage if you are not sure. .PP .\"{{{ drive independent Drive independent device files which automatically detect the media format and capacity: .PP .TS l l. Name Base minor # _ \fBfd\fP\fIn\fP 0 .TE .\"}}} .PP .\"{{{ 5.25 DD 5.25 inch double density device files: .PP .TS lw(1i) l l l l l. Name Capac. Cyl. Sect. Heads Base minor # _ \fBfd\fP\fIn\fP\fBd360\fP 360K 40 9 2 4 .TE .\"}}} .PP .\"{{{ 5.25 HD 5.25 inch high density device files: .PP .TS lw(1i) l l l l l. Name Capac. Cyl. Sect. Heads Base minor # _ \fBfd\fP\fIn\fP\fBh360\fP 360K 40 9 2 20 \fBfd\fP\fIn\fP\fBh410\fP 410K 41 10 2 48 \fBfd\fP\fIn\fP\fBh420\fP 420K 42 10 2 64 \fBfd\fP\fIn\fP\fBh720\fP 720K 80 9 2 24 \fBfd\fP\fIn\fP\fBh880\fP 880K 80 11 2 80 \fBfd\fP\fIn\fP\fBh1200\fP 1200K 80 15 2 8 \fBfd\fP\fIn\fP\fBh1440\fP 1440K 80 18 2 40 \fBfd\fP\fIn\fP\fBh1476\fP 1476K 82 18 2 56 \fBfd\fP\fIn\fP\fBh1494\fP 1494K 83 18 2 72 \fBfd\fP\fIn\fP\fBh1600\fP 1600K 80 20 2 92 .TE .\"}}} .PP .\"{{{ 3.5 DD 3.5 inch double density device files: .PP .TS lw(1i) l l l l l. Name Capac. Cyl. Sect. Heads Base minor # _ \fBfd\fP\fIn\fP\fBu360\fP 360K 80 9 1 12 \fBfd\fP\fIn\fP\fBu720\fP 720K 80 9 2 16 \fBfd\fP\fIn\fP\fBu800\fP 800K 80 10 2 120 \fBfd\fP\fIn\fP\fBu1040\fP 1040K 80 13 2 84 \fBfd\fP\fIn\fP\fBu1120\fP 1120K 80 14 2 88 .TE .\"}}} .PP .\"{{{ 3.5 HD 3.5 inch high density device files: .PP .TS lw(1i) l l l l l. Name Capac. Cyl. Sect. Heads Base minor # _ \fBfd\fP\fIn\fP\fBu360\fP 360K 40 9 2 12 \fBfd\fP\fIn\fP\fBu720\fP 720K 80 9 2 16 \fBfd\fP\fIn\fP\fBu820\fP 820K 82 10 2 52 \fBfd\fP\fIn\fP\fBu830\fP 830K 83 10 2 68 \fBfd\fP\fIn\fP\fBu1440\fP 1440K 80 18 2 28 \fBfd\fP\fIn\fP\fBu1600\fP 1600K 80 20 2 124 \fBfd\fP\fIn\fP\fBu1680\fP 1680K 80 21 2 44 \fBfd\fP\fIn\fP\fBu1722\fP 1722K 82 21 2 60 \fBfd\fP\fIn\fP\fBu1743\fP 1743K 83 21 2 76 \fBfd\fP\fIn\fP\fBu1760\fP 1760K 80 22 2 96 \fBfd\fP\fIn\fP\fBu1840\fP 1840K 80 23 2 116 \fBfd\fP\fIn\fP\fBu1920\fP 1920K 80 24 2 100 .TE .\"}}} .PP .\"{{{ 3.5 ED 3.5 inch extra density device files: .PP .TS lw(1i) l l l l l. Name Capac. Cyl. Sect. Heads Base minor # _ \fBfd\fP\fIn\fP\fBu2880\fP 2880K 80 36 2 32 \fBfd\fP\fIn\fP\fBu3200\fP 3200K 80 40 2 104 \fBfd\fP\fIn\fP\fBu3520\fP 3520K 80 44 2 108 \fBfd\fP\fIn\fP\fBu3840\fP 3840K 80 48 2 112 .TE .\"}}} .\"}}} .\"{{{ Description .SH DESCRIPTION \fBfd\fP special files access the floppy disk drives in raw mode. The following .IR ioctl (2) calls are supported by \fBfd\fP devices: .\"{{{ FDCLRPRM .IP \fBFDCLRPRM\fP clears the media information of a drive (geometry of disk in drive). .\"}}} .\"{{{ FDCLRPRM .IP \fBFDSETPRM\fP sets the media information of a drive. The media information will be lost when the media is changed. .\"}}} .IP \fBFDDEFPRM\fP sets the media information of a drive (geometry of disk in drive). The media information will not be lost when the media is changed. This will disable autodetection. In order to re-enable autodetection, you have to issue an \fBFDCLRPRM\fP . .\"}}} .\"{{{ FDGETDRVTYP .IP \fBFDGETDRVTYP\fP returns the type of a drive (name parameter). For formats which work in several drive types, \fBFDGETDRVTYP\fP returns a name which is appropriate for the oldest drive type which supports this format. .\"}}} .\"{{{ FDFLUSH .IP \fBFDFLUSH\fP invalidates the buffer cache for the given drive. .\"}}} .\"{{{ FDSETMAXERRS .IP \fBFDSETMAXERRS\fP sets the error thresholds for reporting errors, aborting the operation, recalibrating, resetting, and reading sector by sector. .\"}}} .\"{{{ FDGETMAXERRS .IP \fBFDSETMAXERRS\fP gets the current error thresholds. .\"}}} .\"{{{ FDGETDRVTYP .IP \fBFDGETDRVTYP\fP gets the internal name of the drive. .\"}}} .\"{{{ FDWERRORCLR .IP \fBFDWERRORCLR\fP clears the write error statistics. .\"}}} .\"{{{ FDWERRORGET .IP \fBFDWERRORGET\fP reads the write error statistics. These include the total number of write errors, the location and disk of the first write error, and the location and disk of the last write error. Disks are identified by a generation number which is incremented at (almost) each disk change. .\"}}} .\"{{{ FDTWADDLE .IP \fBFDTWADDLE\fP Switch the drive motor off for a few microseconds. This might be needed in order to access a disk whose sectors are too close together. .\"}}} .\"{{{ FDSETDRVPRM .IP \fBFDSETDRVPRM\fP sets various drive parameters. .\"}}} .\"{{{ FDGETDRVPRM .IP \fBFDGETDRVPRM\fP reads these parameters back. .\"}}} .\"{{{ FDGETDRVSTAT .IP \fBFDGETDRVSTAT\fP gets the cached drive state (disk changed, write protected et al.) .\"}}} .\"{{{ FDPOLLDRVSTAT .IP \fBFDPOLLDRVSTAT\fP polls the drive and return its state. .\"}}} .\"{{{ FDGETFDCSTAT .IP \fBFDGETFDCSTAT\fP gets the floppy controller state. .\"}}} .\"{{{ FDRESET .IP \fBFDRESET\fP resets the floppy controller under certain conditions. .\"}}} .\"{{{ FDRAWCMD .IP \fBFDRAWCMD\fP sends a raw command to the floppy controller. .\"}}} .PP For more precise information, consult also the and include files, as well as the manual page for floppycontrol. .\"}}} .\"{{{ Notes .SH NOTES The various formats allow to read and write many types of disks. However, if a floppy is formatted with a too small inter sector gap, performance may drop, up to needing a few seconds to access an entire track. To prevent this, use interleaved formats. It is not possible to read floppies which are formatted using GCR (group code recording), which is used by Apple II and Macintosh computers (800k disks). Reading floppies which are hard sectored (one hole per sector, with the index hole being a little skewed) is not supported. This used to be common with older 8 inch floppies. .\"}}} .\"{{{ Files .SH FILES /dev/fd* .\"}}} .\"{{{ Authors .SH AUTHORS Alain Knaff (Alain@linux.lu), David Niemi (niemidc@tux.org), Bill Broadhurst (bbroad@netcom.com). .\"}}} .\"{{{ See also .SH "SEE ALSO" .BR floppycontrol (1), .BR mknod (1), .BR chown (1), .BR getfdprm (1), .BR superformat (1), .BR mount (8), .BR setfdprm (1) .\"}}} fdutils-5.6/doc/fdmount.texi0000444000175000017500000002156407464324643015126 0ustar alainalain@node fdmount, fdrawcmd, diskseekd, Commands @section fdmount @pindex fdmount @pindex fdmountd @pindex fdlist @pindex fdumount @cindex automounting @example @code{fdmount} [@code{-l}] [@code{--list}] [@code{-d}] [@code{--daemon}] [@code{--detach}] [@code{-i} @var{interval}] [@code{--interval} @var{interval}] [@code{-o} @var{mount-options}] [@code{-r}] [@code{-readonly}] [@code{-s}] [@code{--sync}] [@code{--nosync}] [@code{--nodev}] [@code{--nosuid}] [@code{--noexec}] [@code{-f}] [@code{--force}] [@code{-h}] [@code{--help}] [@var{drivename}] [@var{mountpoint}] @code{fdumount} [@code{-f}] [@code{--force}] [@var{drivename}] @code{fdlist} @code{fdmountd} [@code{-i} @var{interval}] [@code{--interval} @var{interval}] [@code{-r}] [@code{-readonly}] [@code{-s}] [@code{--sync}] [@code{--nosync}] [@code{--nodev}] [@code{--nosuid}] [@code{--noexec}] [@code{--help}] [@var{drivename}] [@var{mountpoint}]] @end example The @code{fdmount} program mounts a floppy disk in the specified drive. It tries to figure out the exact format and filesystem type of the disk from data in the disk's boot sector or super block and the auto-detected track layout. Currently, fdmount supports the filesystems @code{minix}, @code{ext}, @code{ext2}, @code{xia}, and @code{msdos}, and includes special support for disks formatted by the @code{2M} utility for MS-DOS. It also checks whether the disk is write protected, in which case it is mounted read-only. The symbolic @var{drivename} is (currently) one of @file{fd[0-7]}, corresponding to the special device files @file{/dev/fd[0-7]}. If @var{drivename} is not specified, @file{fd0} is assumed. The disk is mounted on the directory @var{mountpoint}, if specified, or on @file{/fd[0-7]}. In either case, the mount point must be an existing, writable directory. @strong{Due to a bug in the floppy driver (?), the polling interval (-i flag) must be longer than the spindown offset. Thus you need to do (for example) floppycontrol --spindown 99 before starting fdmountd in daemon mode} @subsection Options @table @code @item -l @var{--list} List all known drives with their symbolic name, type, and mount status. @item -d @var{--daemon} Run in daemon mode (see below). @item --detach Runs daemon in background, and detaches it from its tty. Messages produced after the fork are logged to syslog. @item -p @var{file} @itemx --pidfile @var{file} Dumps the process id of the daemon to @var{file}. This makes killing the daemon easier: @code{kill -9 `cat @var{file}`} @item -i @var{interval} @itemx --interval @var{interval} Set the polling interval for daemon mode. The unit for @var{interval} is 0.1 seconds, the default value is 10 (i.e. 1 second). @item -o @var{options} @itemx --options @var{options} Sets filesystem-specific options. So far, these are only available for DOS and Ext2 disks. The following DOS options are supported: @code{check}, @code{conv}, @code{dotsOK}, @code{debug}, @code{fat}, @code{quiet}, @code{blocksize}. The following Ext2 options are supported: @code{check}, @code{errors}, @code{grpid}, @code{bsdgroups}, @code{nogrpid}, @code{sysvgroups}, @code{bsddf}, @code{minixdf}, @code{resgid}, @code{debug}, @code{nocheck}. When running as a daemon, options not applying to the disk that is inserted (because of its filesystem type) are not passed to mount. @item -r @var{--readonly} Mount the disk read-only. This is automatically assumed if the disk is write protected. @item -s @var{--sync} Mount with the @code{SYNC} option. @item --nosync Mounts without the @code{SYNC} option, even when running as daemon. @item --nodev Mount with the @code{NODEV} option. Ignored for @code{msdos} filesystems, otherwise always set for non-root users. @item --nosuid Mount with the @code{NOSUID} option. Ignored for @code{msdos} filesystems, otherwise always set for non-root users. @item --noexec Mount with the @code{NOEXEC} option. @item -f @var{--force} Attempt a mount or unmount operation even @file{/etc/mtab} says that the drive is already mounted, or not mounted, respectively. This option is useful if @file{/etc/mtab} got out of sync with the actual state for some reason. @item -h @var{--help} Show short parameter description @end table @subsection Security When mounting on the default mount point, the mount points' owner is set to the current user, and the access flags according to the user's umask. For a specified mountpoint, owner and permissions are left unchanged. Default mount points are called @code{/fd0}, @code{/fd1}, @dots{} , @code{/fd7}. The user running fdmount must have read access to the floppy device for read only mounts, and read/write access for read/write mounts. Fdmount can be run suid root, allowing users to mount floppy disks. The following restrictions are placed upon non-root users: @itemize @bullet @item If a mountpoint is specified explicitly, it must be owned by the user. @item A user may only unmount a disk if the mount point is owned by the user, or if it the disk has been mounted by the same user. @item Non-msdos disks are automatically mounted with the @code{nodev} and @code{nosuid} flags set. @end itemize However, @strong{do not rely on fdmount being secure at the moment}. @subsection Daemon mode In daemon mode, the specified drive is periodically checked and if a disk is inserted, it is automatically mounted. When the disk is removed, it is automatically unmounted. However, it is recommended to unmount the disk manually @emph{before} removing it. In order to limit corruption, disks are mounted with the SYNC option when running in daemon mode, unless the @code{--nosync} flag is given. Note that this mode has some potential drawbacks: @itemize @bullet @item Some floppy drives have to move the drive head physically in order to reset the disk change signal. It is strongly recommended not to use daemon mode with these drives. @xref{floppycontrol}, for details. @item If a disk does not contain a filesystem (e.g. a tar archive), the mount attempt may slow down initial access. @item As fdmount cannot identify the user trying to use the disk drive, there is no way to protect privacy. Disks are always mounted with public access permissions set. @end itemize @subsection Diagnostics @table @code @item error opening device @var{name} @item error reading boot/super block fdmount failed to read the first 1K of the disk. The disk might be damaged, unformatted, or it may have a format wich is unsupported by the FDC or the Linux kernel. @item unknown filesystem type No magic number of any of the supported filesystems (see above) could be identified. @item sorry, can't figure out format (@var{fs} filesystem) The size of the filesystem on the disk is incompatible with the track layout detected by the kernel and an integer number of tracks. This may occur if the filesystem uses only part of the disk, or the track layout was detected incorrectly by the kernel. @item failed to mount @var{fs> >$outfile echo .TH\ $command\ 1\ \"$date\" $package >$outfile echo .SH Name >>$outfile grep -i $command cmdname >>$outfile #echo ".SH Description" >>$outfile # -e "1,/^@node $command/d" \ # -e "/^@node [^,]*, [^,]*, $command, Commands$/,/^@bye/d" \ # -e "/^@node [^,]*, [^,]*, Commands/,/^@bye/d" \ cat man-warning.texi $texifile | sed \ -e 's/^@section/@chapter/' \ -e 's/^@subs/@s/' \ -e 's/^@chapter.*$/@chapter Description/' \ -e 's/^@section/@chapter/' \ -e 's/^@subs/@s/' \ -e 's/^@c xMANoptions/@chapter Options/' \ -e "s/^@c MAN/@MAN/" | texi2roff -ma | sed -f strip-pp.sed >>$outfile echo ".SH See Also" >>$outfile echo "Fdutils' texinfo doc" >>$outfile } extract diskd extract diskseekd extract fdmount extract fdrawcmd extract floppycontrol extract floppymeter extract getfdprm extract makefloppies extract setfdprm extract superformat extract xdfcopy fdutils-5.6/doc/moredata.texi0000444000175000017500000005570507464324643015252 0ustar alainalain@node Extended formats, Autodetection, Drive descriptions, Top @chapter Storing more data on a floppy disk @cindex extended formats @cindex high capacity formats @cindex formatting disks This section describes the techniques that are used by Linux' floppy driver and superformat to store more data than usual on a floppy disk. Each section contains a description of the technique used, lists the usages of the disks formatted using this technique (whether they are bootable, whether they are accessible on MS-DOS and for which kind of filesystems they are suitable) and finishes with a table listing the most interesting formats which can be obtained by the described technique. The table lists for each format the media type it is used for, the total capacity which can be achieved, the throughput for large reads or writes and the media description for these disks. This description can the be used with superformat to make such disks, or with setfdprm to configure the drive to read/write to them. Some formats (the XDF and XXDF formats) cannot be accessed directly, and thus there is no media description for them. For these, we indicate a formatting command used to make these disks. The formatting command assume that the disk is in the first drive (@code{/dev/fd0}). Substitute @code{/dev/fd1} if you want to format XDF or XXDF disks in the second drive. @menu * More sectors:: Using more sectors per track by packing them close together * Interleave:: Use interleave to pack the sectors even closer together * Sector skewing:: Speeding up multi-track reads * More cylinders:: Use up to 83 cylinders * Larger sectors:: Minimize per byte overhead by using larger sectors * Mixed size sectors:: Minimize slack by using several sector sizes in a same track * Smart use of the dtr:: How to get more out of your disk by playing games with the data transfer rate * 2M:: Make autodetection easyer by using a readable first track * XDF:: Fast high capacity formats * XXDF:: Fast formats with even higher capacity @end menu @node More sectors, Interleave, Extended formats, Extended formats @section More sectors per cylinder @cindex more sectors per track @cindex sectors per track The official formats used by MS-DOS and other operating systems are generally very conservative. It is often possible to fit more sectors on each track than the default by simply reducing the size of the gap between tracks and/or the size of the leftover space at the end of the disk. For example, a 3 1/2 disk has a raw track capacity of around 12500 bytes. The raw capacity of a floppy disk is not rigorously constant among different boxes, because both the data transfer rate of the floppy controller, and the rotation speed of the drive are subject to small variations. In order to account for these, we have to use a safety margin, and we only use up 12450 bytes of the 12500 bytes that are theoretically available. A sector contains a header of 62 bytes and 512 bytes of data. A minimum gap of about 45 bytes should be used in order to leave enough time to the floppy controller to "rest" between reading two successive sectors. In total, 619 bytes per sector are thus needed. This shows that we can fit 12450 / 619 = 20 sectors per track. @strong{Usage:} These disks are bootable by Lilo, and can be read in MS-DOS using numerous shareware utilities such as @code{vgacopy}, or @code{fdformat} or many others. Check your nearest Simtel mirror. With dos6, you don't need any add-on utilities, just put the following line in your @code{config.sys}: @example drivparm=/d:0 /f:7 /h:2 /s:21 /t:82 ^ ^ \______________/ | | | drive number | max geometry | drive type, consult the dos help system for details @end example @strong{Interesting Formats:} @example density tot. cap. throughput media description 5 1/4 DD 800KB 30KB/s dd sect=10 3 1/2 DD 800KB 25KB/s dd sect=10 3 1/2 HD 1600KB 50KB/s hd sect=21 3 1/2 ED 3200KB 100KB/s ed sect=42 @end example The @code{--dd}, @code{--hd} and @code{--ed} options describe the density of the media to be formatted (double density, high density or extra density). The @code{-s} options describes the number of 512 byte sectors per track. @node Interleave, Sector skewing, More sectors, Extended formats @section Using interleave @cindex interleave After having read a sector, the floppy controller needs to "rest" for a short time. This time is used to compute checksums, to reset internal circuitry, etc. During this time, the floppy disk continues to rotate, and the "rest" time thusly translates to a certain minimal gap size. If a smaller gap is used, the next sector header flies by the read-write head before the floppy controller is ready again to pick up the data. Thus, it has to wait until the next disk rotation until that sector comes back again. This leads to an unacceptably low throughput, as now the system can only read one sector per rotation instead of all sectors in one rotation. If we want to use smaller gaps, we have thus to use @emph{sector interleaving}. This technique consists in arranging the sectors in a way such that the next logical sector does not immediately follow the current sector, but instead another sector is inserted between two successive sectors. Instead of having the following order: @example 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 @end example we would use the following order: @example 1,12,2,13,3,14,4,15,5,16,6,17,7,18,8,19,9,20,10,21,11, @end example This new order allows the floppy controller to rest during the whole time that sector 12 flies by between reading sector 1 and 2. This technique still cuts throughput in half, because two rotations are needed (one for reading sectors 1 to 11, and the second to read sectors 12 to 21). However, this is far better than the 21 rotations which would be needed without interleave. This technique allows us to use a gap size of just 1, and thus fit 21 sectors on one track. @strong{Usage:} Once formatted, interleaved disks can be used in a similar way to disks which have simply more tracks. They can be accessed using @code{vgacopy} in Dos, you can boot from them using Lilo, and you may install any filesystem on them. @strong{Interesting Formats:} @example density tot. cap. throughput media description 5 1/4 HD 1440KB 27KB/s hd sect=18 3 1/2 HD 1680KB 26KB/s hd sect=21 3 1/2 ED 3360KB 52KB/s ed sect=42 @end example You don't need to tell @code{superformat} to use interleaving, it figures out by itself when interleaving is needed. You don't need to tell @code{setfdprm} either that a disk is interleaved, as this information is not needed to read the disk @node Sector skewing, More cylinders, Interleave, Extended formats @section Sector skewing @cindex sector skewing @cindex skewing Sector skewing is a technique that allows bigger throughputs. It does not increase the capacity of the disk. Sector skewing is only relevant during formatting. Sector skewed disks are indistinguishable from non-skewed disk by software, except for a different throughput. The principle of sector skewing is to start each track a little bit later than the previous one, i.e. the first logical sector of the second cylinder would for exemple lie near the sixth logical sector of the first cylinder. This is done in order to account for the time needed to seek the drive head from the first cylinder to the second. Without skewing, the first sector would already have passed the drive head after seeking, and we would need to wait for a whole rotation for it to come back again. By default, superformat applies appropriate skewing to all formats, and the listed throughput values refer to skewed disks. It is possible to provide different values for the skew using the @code{--head_skew} and @code{--track_skew} parameters. @code{head_skew} refers to the offset between both sides of the same cylinder, and @code{track_skew} refers to the offset of two consecutive cylinders. 0 means no skew. @node More cylinders, Larger sectors, Sector skewing, Extended formats @section More Cylinders @cindex more cylinder @cindex cylinders @cindex tracks @cindex 83 cylinders Many nominally 40-cylinders or 80-cylinder drives are capable of more cylinders, usually 41 and 83 respectively. These can be used to get extra capacity. However, not all drives can seek to these unofficial extra cylinders, and even on drives which can, these extra cylinders tend to be less reliable. @strong{WARNING}: Although most drives are able to use 83 cylinders, some may not. If your drive is making strange noises while accessing these tracks. Although most drives support more than 80 tracks, I have heard rumors that some do not, and repeatedly trying to read beyond track 80 might be damaging to them. In order to know wether your drive supports more than eighty tracks, first set the number of allowed tracks to 82. (using @code{floppycontrol --cylinders 82 -d }@var{drive}) Then format a disk with a 82 track format (for example @file{/dev/fd0H1722}), and copy on or several files to the disk until there are less than 18 KB of free space on the disk. Then eject and reinsert the disk, and compare the files on the disk with the originals. If they are the same, your drive does support 82 tracks. If so, you might want to go further and try with 83 cylinders: @file{/dev/fd0H1743}) This single experience should not damage the drive, although repeating it many times may be dangerous. If you do have a drive which supports more than 80 cylinders, you have to call @code{floppycontrol --cylinders 82 @var{drive}} before you can use the extra cylinders. You may put this line into your @file{/etc/rc.local}, so that the driver is automatically configured for the addition cylinder after each boot. If on the other hand your drive doesn't support more than 80 tracks, you should remove the entries for formats 13-19 from your @file{/dev} directory after running @code{MAKEFLOPPIES}, and you should call @code{floppycontrol --cylinder 80 @var{drive}} from your @file{/etc/rc.local} (or @code{floppycontrol --cylinder 40 @var{drive}} for 5 1/4 DD drives). By default, 83 cylinder are enabled for any high density and double density drives. 3 1/2 double density drives have 80 cylinders enables, and 5 1/4 double density drives have 40 enabled. @strong{Usage:} These disks can be booted from using LILO, and can be accessed in MS-DOS using @code{vgacopy}. @strong{Interesting Formats:} All formats presented in the two previous sections may be amended to use 83 cylinders instead of 80. Just add the @code{cyl=83} to the format description for superformat. Using more cylinders has no effect on the throughput. @example density tot. cap. throughput media description 5 1/4 HD 1494KB 27KB/s hd sect=18 cyl=83 3 1/2 HD 1743KB 26KB/s hd sect=21 cyl=83 3 1/2 ED 3486KB 52KB/s ed sect=42 cyl=83 @end example @node Larger sectors, Mixed size sectors, More cylinders, Extended formats @section Larger sectors @cindex larger sectors The floppy controller allows us to use larger sectors than the default size of 512 bytes. All powers of two larger than 256 bytes are acceptable sector sizes. Large sectors have the same header and gap sizes than smaller sectors, thus the overhead per byte of data is smaller. A little calculation shows this: A 1024 byte sector takes up at least 1024+62+1 = 1087 raw bytes. You can fit eleven sectors of this size into a 12450 byte track. This represents 11KB of data per track, versus the 10.5KB only that can be achieved with 512 byte sectors. @strong{Usage:} MS-DOS and other operating systems cannot normally read these formats. Lilo is not yet able to boot from this kind of disks. @strong{Performance:} When any portion of one of these larger sectors is read, the entire sector must be read. When any portion of such a sector is written to, the entire sector must be read, and then written back with just the necessary portion modified. Both of these circumstances can entail worse performance than are listed in this table for small reads and (especially) small writes. @strong{Interesting Formats:} @example density tot. cap. throughput media description 5 1/4 HD 1440KB 30KB/s dd sect=9 ssize=1KB 3 1/2 HD 1760KB 55KB/s hd sect=11 ssize=1KB 3 1/2 ED 3520KB 110KB/s ed sect=11 ssize=2KB @end example The @code{ssize} parameter of the format description indicates the sector size to be used. @node Mixed size sectors, Smart use of the dtr, Larger sectors, Extended formats @section Mixed sector size (MSS) formats @cindex MSS @cindex 2M (mixed sector sizes) @cindex XDF (mixed sector sizes) Using larger sectors has the disadvantage that the granularity is larger. For example, when using 4096 byte sectors, there is enough space to fit two sectors in a track of 12450 bytes raw capacity, but not three. However, the two sector format leaves plenty of space available (4132 bytes), in which smaller sectors would fit. For example, these 4142 raw bytes can be put to good use by filling them with a 2 KB sector (2048+62), plus an 1 KB sector (1024+62) and a 512 byte sector, leaving still 362 bytes for gaps. Mixed sector size formats take advantage of this by using sectors of several different sizes on a same track. This way, a maximum capacity of 12KB per track, distributed in one 8k sector and one 4k sector can be achieved. @strong{Usage:} There is no known MS-DOS utility which can read basic MSS disks. Lilo is not yet able to boot from this kind of disks. @strong{Performance:} As any format with larger sectors, the performance for small reads and writes is worse due to the larger granularity. @strong{Interesting Formats:} @example density tot. cap. throughput media description 3 1/2 DD 880KB 28KB/s hd tracksize=11b mss 5 1/4 HD 1600KB 30KB/s hd tracksize=10KB mss 3 1/2 DD 880KB 28KB/s hd tracksize=11b mss 3 1/2 HD 1840KB 28KB/s hd tracksize=23b mss 3 1/2 HD 1920KB 30KB/s hd tracksize=12KB mss 3 1/2 ED 3680KB 56KB/s ed tracksize=23KB mss 3 1/2 ED 3840KB 60KB/s ed tracksize=24KB mss @end example For MSS formats, the system figures out the most efficient repartition of sector sizes by itself. You do not need to describe the number of sectors and their size. For MSS disks, the capacity of one track is described directly, using the @code{tracksize} parameter. The @code{1920KB} and @code{3840KB} formats may be unreliable on some computers. @node Smart use of the dtr, 2M, Mixed size sectors, Extended formats @section Smart use of the data transfer rate Due to different drive rotations speeds, 5 1/4 double density disks and 3 1/2 double density disks are accessed using different raw data transfer rates (300 kb/s for the faster spinning 5 1/4 disks, and only 250 kb/s for the slower spinning 3 1/2 disks). The method described in this section consists in using the faster data transfer rate intended for 5 1/4 disks on 3 1/2 disks, and thus boost the raw capacity per track of these disks. This is possible because 300 kb/s is still low enough not to excede the specification of the disk surface of a double density disk (which 500 kb/s would). @strong{Usage: this method is only available for 3 1/2 double density disks. The disk obtained cannot be booted from by LILO, and are inaccessible from MS-DOS.} The following table shows the media description for a format using this method in conjuncion with the previous methods: @example density tot. cap. throughput media description 3 1/2 DD 1120KB 17KB/s qd tracksize=7KB mss @end example We use the @code{QD} density selector to describe this particular DTR set-up, although the acronym @code{QD} is already taken to name 96tpi double density 5 1/4 disks. However, as this dtr trickery is only meaningful for 3 1/2, we hope that there will be no ambiguity. @node 2M, XDF, Smart use of the dtr, Extended formats @section 2M formats @cindex MSS (2M) @cindex Mixed sector size formats (2M) @cindex 2M 2M formats use a standard geometry (18 normal sized sectors) on the first side of the first cylinder, and an MSS geometry on the rest of the disk. They are inspired for Ciriaco Garcia de Celis' 2M utility for MS-DOS. The advantage of 2M disks over simple MSS disks is twofold: @itemize @bullet @item They can be accessed from DOS @item They do not need an autodetect entry, as the boot sector is readable using a standard geometry. Mtools can then use the information contained in the boot sector to configure the floppy driver to read the rest of the disk. @end itemize Although 2m disk have less sectors on the first track than on the others, the Linux floppy driver, and 2M's low level floppy access routines pretend that it contains the same number of sectors. The missing sectors are called phantom sectors. Writes to these sectors are ignored, and reads return random data. In order to make up for this, 2M and mtools pretend that there is a duplicate FAT in the missing sectors, which is simulated by using data from the first (real) FAT. Thus 2M disks work fine for their intended purpose, which is to hold an MS-DOS filesystem. @strong{Never use 2M disks for anything other than a MS-DOS filesystem. For example, never make an ext2 filesystem on a 2M disk. If you need a high capacity ext2 filesystem (or minix fs, raw tar or cpio archive), use the corresponding MSS format instead} @strong{Usage:} 2M disks are not bootable by LILO. They can be accessed in MS-DOS using the 2M utility. 2M can be found at ftp://FTP.Coast.NET/SimTel/msdos/diskutil/2m30.zip or at any other simtel mirror. @strong{2M disks are not suitable for non MS-DOS filesystems}. @strong{Performance:} Just as with MSS disks, performance is bad for small reads and writes. To describe a 2M format, add the keyword @code{2m} to its media description: @example density tot. cap. throughput media description 3 1/2 HD 1840KB 28KB/s hd tracksize=23b mss 2m @end example @node XDF, XXDF, 2M, Extended formats @section XDF formats @cindex MSS (XDF) @cindex Mixed sector size formats (XDF) @cindex XDF @cindex OS/2 (XDF) XDF is the format used for OS/2 installation floppies. Just like 2M, XDF uses mixed sector sizes on "generic tracks". The first cylinder uses 512 byte sectors. However, for XDF disks, the logical order of the sectors on a given track, and their physical order is not the same. This allows a faster access, in a similar way that interleaving does for disk with normal sized sectors and too small gaps. XDF's sector arrangement allows it to read sectors alternatively from both sides, i.e. the first sector from side 0, the second from side 1, and the third from side 0 again. This differs from the usualy formats, where first the entire side 0 is read, and then the entire side 1. This technique allows to read both sides of a disk in roughly three rotations. The following example illustrates how this is done. In our example we use the XDF format used for 3 1/2 HD disks, which contains one 8KB sector, one 2KB sector, one 1KB sector, and one 512 byte sector per track. The upper line represents the sectors on side 0, and the lower line represents the sectors on side 1. Different numbers represent different sectors. Repeated identical numbers represent a single larger sector. As the disk is circular, some sectors wrap around at the end: we find parts of the 8KB sector, represented by 6, both at the beginning and at the end of each track. @example position:| 1 2 5 4 | 1234567890123456789012345678901234567890 |========================================== side 0: | 6633332244444446666666666666666666666666 side 1: | 6666444444422333366666666666666666666666 2 512 byte sector 3 1KB sector 4 2KB sector 6 8KB sector @end example When reading a track, sectors are read in the following order: @example sector id head position at start position at end ---------------------------------------------------------- 3 0 3 7 4 0 9 16 6 1 18 5 (1st wrap around) 2 0 7 9 2 1 12 14 6 0 16 3 (2nd wrap around) 4 1 5 12 3 1 14 18 @end example We notice that the start of each sector happens at least 2 units of position (around 300 bytes), after the end of the previously read sector, thus allowing the floppy disk controller sufficient time to rest. Moreover, we notice two wrap-arounds, yielding three rotations to read the whole cylinder (the third rotation is due to the fact that we stop at a higher position than we started, and that we also need to allow some time for seeking to the next track). MSS or 2M formats of the same capacity nead at least 2 rotations per side (i.e. 4 per track), yielding a lower throughput. @strong{Usage:} XDF disks are not bootable by LILO. They can be accessed from MS-DOS and OS/2 using @code{xdfcopy.exe} or @code{xdf.com}. They are only suitable for MS-DOS filesystems. The floppy driver has no direct support for this format yet, but @code{mtools} is able to read them using the @code{FDRAWCMD} ioctl. @strong{Interesting Formats:} @example density tot. cap. throughput formatting command 5 1/4 HD 1600KB 46KB/s xdfcopy -0 /dev/fd0 3 1/2 HD 1840KB 38KB/s xdfcopy -1 /dev/fd0 3 1/2 ED 3840KB 102KB/s xdfcopy -2 /dev/fd0 @end example The options @code{-1}, @code{-2} and @code{-3} descibre one out of the five formats understoood by @code{xdfcopy} (3 XDF formats and 2 XDF formats). @node XXDF,, XDF, Extended formats @section XXDF formats @cindex MSS (XXDF) @cindex Mixed sector size formats (XXDF) @cindex XXDF These use the simple principle as XDF, but use a higher geometry. No new principle is used, these formats are simply more daring (smaller gaps, and smaller margin at the end of the sector). @strong{Usage:} XXDF disks are not bootable by LILO, and can't be accessed by MS-DOS. They are only suitable for MS-DOS filesystems. The floppy driver has no direct support for this format yet, but @code{mtools} is able to read them using the @code{FDRAWCMD} ioctl. Due to their smaller tolerances, XXDF formats may not work on all drives. Problems may also occur if you write to XXDF disks using a different drive than the one you used to format the disk. @strong{Interesting Formats:} @example density tot. cap. throughput formatting command 3 1/2 HD 1920KB 45KB/s xdfcopy -3 /dev/fd0 3 1/2 ED 3840KB 90KB/s xdfcopy -4 /dev/fd0 @end example fdutils-5.6/doc/setfdprm.texi0000444000175000017500000000340007464324643015263 0ustar alainalain@node setfdprm, superformat, makefloppies, Commands @section setfdprm @pindex setfdprm @cindex setting the geometry information @cindex geometry information (setting) @example @code{setfdprm} [@code{-p}] @var{device} @var{media-description} @code{setfdprm} [@code{-c} | @code{-y} | @code{-n}] @var{device} @end example @code{setfdprm} is a utility that can be used to load disk parameters into the auto-detecting floppy devices and "fixed parameter" floppy devices, to clear old parameter sets and to disable or enable diagnostic messages. These parameters are derived from a media-description, @pxref{Media description} for more details. Without any options, @code{setfdprm} loads the @var{device} (for example @file{/dev/fd0} or @file{/dev/fd1}) with a new parameter set with the @var{name} entry found in @file{/etc/fdprm} (usually named 360/360, etc.). For autodetecting floppy devices, these parameters stay in effect until the media is changed. For "fixed parameter" devices, they stay in effect until they are changed again. @code{Setfdprm} can also be used by the superuser to redefine the default formats. @subsection Options @table @code @item -p @var{device name} Permanently loads a new parameter set for the specified auto-configuring floppy device for the configuration with @var{name} in @file{/etc/fdprm}. Alternatively, the parameters can be given directly from the command line. @item -c @var{device} Clears the parameter set of the specified auto-configuring floppy device. @item -y @var{device} Enables format detection messages for the specified auto-configuring floppy device. @item -n @var{device} Disables format detection messages for the specified auto-configuring floppy device. @end table @subsection Bugs This documentation is grossly incomplete. fdutils-5.6/doc/strip-pp.sed0000444000175000017500000000007107464324643015020 0ustar alainalain:1 /^\.[IP]P$/N s/^\.[IP]P\n\(\.[ITP]P\)$/\1/ /^\.PP$/b1 fdutils-5.6/doc/superformat.texi0000444000175000017500000002604711101416105015774 0ustar alainalain@node superformat, xdfcopy, setfdprm, Commands @section superformat @pindex superformat @cindex formatting disks (non XDF) @example @code{superformat} [@code{-D} @var{dos-drive}] [@code{-v} @var{verbosity-level}] [@code{-b} @var{begin-track}] [@code{-e} @var{end-track}] [@code{--superverify}] [@code{--dosverify}] [@code{--noverify}] [@code{--verify_later}] [@code{--first-sector-number} @var{n}] [@code{--zero-based}] [@code{-G} @var{format-gap}] [@code{-F} @var{final-gap}] [@code{-i} @var{interleave}] [@code{-c} @var{chunksize}] [@code{-g} @var{gap}] [@code{--absolute-skew} @var{absolute-skew}] [@code{--head-skew} @var{head-skew}] [@code{--track-skew} @var{track-skew}] [@code{--biggest-last}] @var{drive} [@var{media-description}] @end example @code{superformat} is used to format disks with a capacity of up to 1992K HD or 3984K ED. @xref{Extended formats}, for a detailed description of these formats. @xref{Media description}, for a detailed description of the syntax for the media description. If no media description is given, superformat formats a disk in the highest available density for that drive, using standard parameters (i.e. no extra capacity formats). When the disk is formatted, @code{superformat} automatically invokes @code{mformat} in order to put an MS-DOS filesystem on it. You may ignore this filesystem, if you don't need it. Supeformat allows to format 2m formats. Be aware, however, that these @code{2m} formats were specifically designed to hold an MS-DOS filesystem, and that they take advantage of the fact that the MS-DOS filesystem uses redundant sectors on the first track (the FAT, which is represented twice). The second copy of the FAT is @emph{not} represented on the disk. High capacity formats are sensitive to the exact rotation speed of the drive and the resulting difference in raw capacity. That's why @code{superformat} performs a measurement of the disks raw capacity before proceeding with the formatting. This measurement is rather time consuming, and can be avoided by storing the relative deviation of the drive capacity into the drive definition file file. @xref{Drive descriptions}, for more details on this file. The line to be inserted into the drive definition file is printed by superformat after performing its measurement. However, this line depends on the drive and the controller. Do not copy it to other computers. Remove it before installing another drive or upgrade your floppy controller. Swap the drive numbers if you swap the drives in your computer. @menu * Common options:: The most frequently used options * Advanced options:: For experts * Sector skewing options:: Optimizing throughput by creatively arranging the sectors * Examples:: Some example command lines * Troubleshooting:: Most common failure modes * Superformat bugs:: Nobody is perfect @end menu @node Common options, Advanced options, superformat, superformat @subsection Common Options Many options have a long and a short form. @table @code @item -h @itemx --help Print the help. @item -D @var{drive} @itemx --dosdrive @var{dos-drive} Selects DOS drive letter for @code{mformat} (for example @code{a:} or @code{b:}). The colon may be omitted. The default is derived from the minor device number. If the drive letter cannot be guessed, and is not given on the command line, @code{mformat} is skipped. @item -v @var{verbosity-level} @itemx --verbosity @var{verbosity-level} Sets the verbosity level. 1 prints a dot for each formatted track. 2 prints a changing sign for each formatted track (- for formatting the first head, = for formatting the second head, x for verifying the first head, and + for verifying the second head). 3 prints a complete line listing head and track. 6 and 9 print debugging information. @item --superverify Verifies the disk by first reading the track, than writing a pattern of U's, and then reading it again. This is useful as some errors only show up after the disk has once been written. However, this is also slower. @item -B @itemx --dosverify Verifies the disk using the @code{mbadblocks} program. @code{mbadblocks} marks the bad sectors as bad in the FAT. The advantage of this is that disks which are only partially bad can still be used for MS-DOS filesystems. @item -V @itemx --verify_later Verifies the whole disk at the end of the formatting process instead of at each track. Verifying the disk at each track has the advantage of detecting errors early on. @item -f @itemx --noverify Skips the verification altogether. @end table @node Advanced options, Sector skewing options, Common options, superformat @subsection Advanced Options Usually, superformat uses sensible default values for these options, which you normally don't need to override. They are intended for expert users. Most of them should only be needed in cases where the hardware or superformat itself has bugs. @table @code @item -b @var{begin-track} @itemx --begin_track @var{begin-track} Describes the track where to begin formatting. This is useful if the previous formatting failed halfway through. The default is 0. @item -e @var{end-track} @itemx --end_track @var{end-track} Describes where to stop formatting. @var{end_track} is the last track to be formatted plus one. This is mainly useful for testing purposes. By default, this is the same as the total number of tracks. When the formatting stops, the final skew is displayed (to be used as absolute skew when you'll continue). @item -S @var{sizecode} @itemx --sizecode @var{sizecode} Set the sector size to be used. The sector size is 128 * (2 ^ @var{sizecode}). Sector sizes below 512 bytes are not supported, thus sizecode must be at least 2. By default 512 is assumed, unless you ask for more sectors than would fit with 512 bytes. @item --stretch @var{stretch} Set the stretch factor. The stretch factor describes how many physical tracks to skip to get to the next logical track (2 ^ @var{stretch}). On double density 5 1/4 disks, the tracks are further apart from each other. @item -G @var{fmt-gap} @itemx --format_gap @var{fmt-gap} Set the formatting gap. The formatting gap tells how far the sectors are away from each other. By default, this is chosen so as to evenly distribute the sectors along the track. @item -F @var{final-gap} @itemx --final_gap @var{final-gap} Set the formatting gap to be used after the last sector. @item -i @var{interleave} @itemx --interleave @var{interleave} Set the sector interleave factor. @item -c @var{chunksize} @itemx --chunksize @var{chunksize} Set the size of the chunks. The chunks are small auxiliary sectors used during formatting. They are used to handle heterogeneous sector sizes (i.e. not all sectors have the same size) and negative formatting gaps. @item --biggest-last For MSS formats, make sure that the biggest sector is last on the track. This makes the format more reliable on drives which are out of spec. @item --first-sector-number @var{n} Formats the disk with sector numbers starting at @var{n}, rather than 1. Certain CP/M boxes or Music synthesizers use this format. @item --zero-based Shorthand for @code{--first-sector-number 0} @end table @node Sector skewing options, Examples, Advanced options, superformat @subsection Sector skewing options In order to maximize the user data transfer rate, the sectors are arranged in such a way that sector 1 of the new track/head comes under the head at the very moment when the drive is ready to read from that track, after having read the previous track. Thus the first sector of the second track is not necessarily near the first sector of the first track. The skew value describes for each track how far sector number 1 is away from the index mark. This skew value changes for each head and track. The amount of this change depends on how fast the disk spins, and on how much time is needed to change the head or the track. @table @code @item --absolute_skew @var{absolute-skew} Set the absolute skew. This skew value is used for the first formatted track. It is expressed in raw bytes. @item --head_skew @var{head-skew} Set the head skew. This is the skew added for passing from head 0 to head 1. It is expressed in raw bytes. @item --track_skew @var{track-skew} Set the track skew. This is the skew added for seeking to the next track. It is expressed in raw bytes. @end table Example: (absolute skew=3, head skew=1, track skew=2) @example track 0 head 0: 4,5,6,1,2,3 (skew=3) track 0 head 1: 3,4,5,6,1,2 (skew=4) track 1 head 0: 1,2,3,4,5,6 (skew=0) track 1 head 1: 6,1,2,3,4,5 (skew=1) track 2 head 0: 4,5,6,1,2,3 (skew=3) track 2 head 1: 3,4,5,6,1,2 (skew=4) @end example N.B. For simplicitie's sake, this example expresses skews in units of sectors. In reality, superformat expects the skews to be expressed in raw bytes. @node Examples, Troubleshooting, Sector skewing options, superformat @subsection Examples In all the examples of this section, we assume that drive 0 is a 3 1/2 and drive 1 a 5 1/4. The following example shows how to format a 1440K disk in drive 0: @example superformat /dev/fd0 hd @end example The following example shows how to format a 1200K disk in drive 1: @example superformat /dev/fd1 hd @end example The following example shows how to format a 1440K disk in drive 1: @example superformat /dev/fd1 hd sect=18 @end example The following example shows how to format a 720K disk in drive 0: @example superformat /dev/fd0 dd @end example The following example shows how to format a 1743K disk in drive 0 (83 cylinders times 21 sectors): @example superformat /dev/fd0 sect=21 cyl=83 @end example The following example shows how to format a 1992K disk in drive 0 (83 cylinders times 2 heads times 12 KB per track) @example superformat /dev/fd0 tracksize=12KB cyl=83 mss @end example The following example shows how to format a 1840K disk in drive 0. It will have 5 2048-byte sectors, one 1024-byte sector, and one 512-byte sector per track: @example superformat /dev/fd0 tracksize=23b mss 2m ssize=2KB @end example All these formats can be autodetected by mtools, using the floppy driver's default settings. @node Troubleshooting, Superformat bugs, Examples, superformat @subsection Troubleshooting @table @code @item FDC busy, sleeping for a second When another program accesses a disk drive on the same controller as the one being formatted, @code{superformat} has to wait until the other access is finished. If this happens, check whether any other program accesses a drive (or whether a drive is mounted), kill that program (or unmount the drive), and the format should proceed normally. @item I/O errors during verification Your drive may be too far out of tolerance, and you may thus need to supply a margin parameter. Run @code{floppymeter} (@pxref{floppymeter}) to find out an appropriate value for this parameter, and add the suggested @code{margin} parameter to the command line @end table @node Superformat bugs, , Troubleshooting, superformat @subsection Bugs Opening up new window while @code{superformat} is running produces overrun errors. These errors are benign, as the failed operation is automatically retried until it succeeds. fdutils-5.6/doc/texi-linearize.c0000444000175000017500000000171507560760747015656 0ustar alainalain#include #include #include FILE *my_open(char *directory, char *file) { char path[8192]; FILE *r; strcpy(path, directory); strcat(path,"/"); strcat(path, file); r= fopen(path, "r"); if(r == NULL) { fprintf(stderr,"Could not open %s\n", path); perror("open"); exit(1); } return r; } int main(int argc, char **argv) { FILE *stack[256]; int sp; char line[4096]; char *directory; sp = 0; if(argc < 3) { fprintf(stderr,"Usage: %s directory root texi file\n", argv[0]); exit(1); } directory = argv[1]; stack[sp++] = my_open(directory, argv[2]); while(sp) { if(fgets(line, 4095, stack[sp-1]) ) { line[strlen(line)-1]='\0'; if(!strncmp(line, "@input", 6)) { stack[sp++] = my_open(directory, line+7); continue; } if(!strncmp(line, "@include", 8)) { stack[sp++] = my_open(directory, line+9); continue; } puts(line); } else sp--; } exit(0); } fdutils-5.6/doc/tips.texi0000444000175000017500000002243507464324643014427 0ustar alainalain@node Basic usage, Device numbers, Location, Top @chapter Basic usage This chapter describes basic usage of floppies, and gives a few simple tips for using floppies under Linux. @menu * Disk organisation :: How a disk is organized, high-level and low-level formats * File systems :: Which file systems does Linux support * Device names :: How floppy drives are named * Identifying disks :: How to identify a disk * Nickel tours :: Short summaries of the various storage methods * New features :: New features of the kernel, mtools, and fdutils @end menu @node Disk organisation, File systems, Basic usage, Basic usage @section How disks are organized @cindex low level format @cindex format (low level vs. high level) @cindex high level format All floppies have two levels of @emph{formatting}, both of which must be known in order to read them. The first is the @emph{binary} or @emph{sector} level format, which is how raw data is stored on the disk. The second is a higher level organization, often called a @emph{file system}, which allows multiple files to be conveniently stored on the disk. For example, a typical 1.44MB disk contains a low-level format, with 18 sectors per track, 80 tracks, and two sides (or heads); each sector can hold 512 bytes of data for a total of 1474560 bytes (or 1440 KB). When used under MS-DOS, this floppy would have a small portion of the disk used to keep track of files on the disk (including a bootsector, file allocation tables, directories, etc.). The floppy driver generally takes care of reading the binary, or low-level format. It can often "guess" the low-level disk geometry needed to read the disk. This is called autodetection (@pxref{Autodetection}). If the driver can't autodetect the disk (e.g. if it is in an unusual format) you can tell the driver what the geometry is either by using the @code{setfdprm} (@pxref{setfdprm}) utility or by using a fixed geometry device device (e.g. @file{/dev/fd0H1440}). Under Linux, many different file systems from many sources can be used. Some of these file systems are interpreted via a utility program (for example @code{mtools} for using disks with an MS-DOS file system). Many file systems can alternatively be "mounted" to appear in the UNIX directory structure until subsequently being unmounted; this is usually implemented by having the kernel itself interpret the file system on the disk. @node File systems, Device names, Disk organisation, Basic usage @section File systems supported by Linux @cindex supported file systems @cindex file systems supported by linux The following file systems are supported: @table @strong @item OS/2 HPFS: read-only support (mount/kernel) @item Mac HPFS 1.44MB: read-only (xhfs utility) @item MS-DOS: read, write, format (mtools utility @emph{and} mount/kernel) @item tar, cpio: compatible with many variations of UNIX (tar, cpio utilities) @item System V, minix, xia, ext, ext2: (mount/kernel) @item pure binary disk access: no file system (any program, usually dd, cat, and cp) @end table @node Device names, Identifying disks, File systems, Basic usage @section What's in a name @cindex floppy device name @cindex file name of floppy devices @cindex name of floppy devices The following figure shows the meaning of the different parts of the name of a floppy device: @example +--------------- /dev: directory for devices | +------------- fd: floppy disk device prefix | | +------------ 0: floppy drive #0 (A:) (0-1 typical, 0-7 | | | possible) | | |+-- 3.5" drive: (use d for 5.25" double density drives, and | | || h for 5.25" high density drives, | | || u for 3.5" drive of any density) | | || +---- 1440: Capacity (in KB) of format (usually between | | || | 360 and 3920) /dev/fd0u1440 @end example @node Identifying disks, Nickel tours, Device names, Basic usage @section What to do if you get an unidentified floppy disk @cindex indentifying unknown disks @example dd if=/dev/fd0 of=/tmp/foo count=1 # If it works: getfdprm # This will report what geometry the disk has file /tmp/foo # This may indicate the type of file system mdir a: # Check for an MS-DOS file system tar tvf /dev/fd0 # Check for a tar archive cpio -itv < /dev/fd0 # Check for a cpio archive e2fsck /dev/fd0 # Check for an "ext2" file system # If it doesn't work: # Try the above dd command using various /dev/fd0* devices @end example @node Nickel tours, New features, Identifying disks, Basic usage @section Nickel tours @cindex nickel tours @menu * Mtools :: Access MS-Dos disks from Unix * Tar :: Tarring files directly to floppy disks * CPIO :: Another archive format * Ext2 :: Seconded Extended File System @end menu @node Mtools, Tar, Nickel tours, Nickel tours @subsection mtools @cindex mtools (nickel tour) @example mdir a: # Read directory of MS-DOS disk in drive A: mcopy /tmp/foo\* a: # Copy files beginning with foo in /tmp to A: mcopy a:\* . # Copy all files from A: to current directory mformat a: # Add MS-DOS file system to formatted disk @end example @node Tar, CPIO, Mtools, Nickel tours @subsection Tar (Tape ARchive) @cindex tar @example tar tvf /dev/fd0 # Read directory of tar archive in # drive A: tar cvf /dev/fd0 foo1 foo2 # Write foo1 and foo2 to A: in tar # format foo1/foo2 can be entire # directory trees tar xvfp /dev/fd0 # extract entire tar archive in # drive A: @end example Tar is not a file system. Only low-level format (@code{superformat}, @pxref{superformat}) are needed to prepare a disk to accept a tar archive. @node CPIO, Ext2, Tar, Nickel tours @subsection CPIO (CoPy In/Out) @cindex CPIO @example cpio -itv < /dev/fd0 # Read directory of cpio archive in A: find foo1 foo2 -print | cpio -ov < /dev/fd0 # Write foo1/foo2 to A: # foo1/foo2 can be entire directory trees cpio -idumv < /dev/fd0 # extract entire CPIO archive in drive A: @end example Note: blocks reported are in 512-byte units (due to UNIX System V heritage). Cpio is not a file system. Only low-level format (fdformat or superformat (@pxref{superformat}) needed. @node Ext2,, CPIO, Nickel tours @section Ext2 (Second Extended File System) @cindex Ext2 @example mke2fs /dev/fd0 1440 # Makes an ext2 filesystem of 1440 # block on A: mke2fs -c /dev/fd0 1440 # Same as above, but tests floppy first e2fsck /dev/fd0 # Tests filesystem integrity. (like # chkdsk in Dos) e2fsck -p /dev/fd0 # Repairs filesystem. (like chkdsk /f # in Dos) mount -t ext2 /dev/fd0 /mnt # Mounts the disk in A: on /mnt. # The directory /mnt must already exist umount /mnt # Unmounts /mnt. No process should # have its working directory in /mnt # No process should have open files in # /mnt @end example Note: don't use ext2 on 2m disks On some systems @code{mke2fs} is also called mkfs.ext2, and e2fsck is also called fsck.ext2 @node New features,, Nickel tours, Basic usage @section New Features of 1.2+ kernels @cindex New features @menu * kernel :: New kernel features since 1.2.0 * mtools :: New mtools features since mtools-3.0 * fdutils :: Utilities contained in the fdutils package @end menu @node kernel, mtools, New features, New features @subsection New features of 1.2+ kernels @cindex Kernel (new features) @itemize @bullet @item Faster and more comprehensive automatic sensing of floppy formats @item Second Floppy Disk Controller (FDC) supported @item DOS fdformat-style formats (up to 21 sectors on HD 3.5" disk) @item DOS 2m-style formats (up to 24 sectors equivalent on HD 3.5" disk) @item non-DOS 2m-inspired formats @item Several long-standing bugs fixed @item More exact detection of FDC type @item More exact detection of floppy drives @end itemize @node mtools, fdutils, kernel, New features @subsection New features of mtools-3.0 @cindex Mtools (new features) @itemize @bullet @item Support for new floppy formats (fdformat, 2m, 2m-like, ED) @item 2.88MB (Extra Density) floppies supported @item More friendly syntax (e.g. "mcopy a:", "mmove") @item Improved mmount @item 16-bit FATs (needed for some ED formats) @item Automatically sets disk geometry for Linux @item Several bug fixes @end itemize NOTE: Mtools has no longer maintained by its original maintainer Emmet P. Gray after 2.0.7. @node fdutils,, mtools, New features @subsection New Utilities @cindex Fdutils (brief list of supplied utilities) @itemize @bullet @item @code{superformat} (replaces fdformat; up to 3.84 MB floppies, faster, calls mformat) @item new @code{getfdprm}/@code{setfdprm} @item @code{fdrawcmd} (allows user-mode programs to do low-level floppy actions) @code{floppycontrol} (general-purpose floppy driver configuration utility) @item @code{MAKEFLOPPIES} (makes floppy devices) @end itemize fdutils-5.6/doc/utilities.texi0000444000175000017500000000434507464324643015463 0ustar alainalain@node Utilities @chapter Included utilities The following utilities are included in the fdutils package @table @code @item floppycontrol This program sets the various error tresholds (error reporting, operation abortion, and read track), prints out drive drive types, and flushes buffers. There is a -h help option. This program provides examples on how to use the new ioctl's. To compile this program just type make in the util directory. See also the included manpage. (in the utils directory) @item MAKEFLOPPIES This shell script creates the new floppy block device files. It uses the floppycontrol program to translate the minor device numbers into meaningful names. It also uses these names to decide wether to create a given block device file or not, depending on the type of the physical drive (for instance, for a 3 1/2 drive, the formats corresponding to a 5 1/4 drive are not created). If you have more than two floppy drives, the kernel cannot find out the types of these additional drives, and you need to specify them with the environmental variables FD2 and FD3. The following types are available: H1440 ( HD 3''1/2), h1200 (HD 5''1/4), D720 (DD 3''1/2) and d360 (DD 5''1/4). Sample command line: @example FD2=1.44M FD3=1.2M MAKEFLOPPIES @end example The names of the device are a letter describing the _drive_ types, followed by a letter describing the size of the _format_. The letters are @table @code @item E 3.5" ED drive @item H 3.5" HD drive @item D 3.5" DD drive @item h 5.25" HD drive @item d 5.25" DD drive @end table Example: @file{h360} is a device for accessing a @file{360KB} disk in a @file{5.25" HD} drive. This convention is the same as used by Slackware and the @code{MAKEDEV} script, except for the ED drives (which are named @code{H2880} by @code{MAKEDEV}, and don't yet exist in Slackware) @strong{Important}: The @code{MAKEFLOPPIES} script needs the floppycontrol program on the search @code{PATH}. @item Setfdprm This program is used to set the media parameters for a drive. @item Superformat This program is used to format floppy disks. The old fdformat doesn't work for disks with bigger sectors. WARNING: DO READ THIS MANPAGE CAREFULLY. IMPROPER USAGE MAY LEAD TO DATA LOSS. @item Others: see the manpages @end table fdutils-5.6/doc/xdfcopy.texi0000444000175000017500000000574207464324643015126 0ustar alainalain@node xdfcopy, , superformat, Commands @section xdfcopy @pindex xdfcopy @cindex XDF (formatting and copying disks) @cindex formatting XDF disks @example @code{xdfcopy} [@code{-}@var{format-id}] [@code{-d}] [@code{-n}] [@code{-h} @var{head-skew}] [@code{-t} @var{cylinder-skew}] [@code{-T} @var{end-cylinder}] [@var{source}] @var{target} @end example @code{Xdfcopy} is a utility to copy and format XDF disks. XDF (eXtended Density Format) is a format used by OS/2 which can hold 1840KB of data (on a 3 1/2 high density disk). Its advantage over 2m formats is that it is faster: 38KB/s. Because of this fast speed, I extended the XDF standard to higher capacities (1992KB) with a transfer rate of 45KB/s. I called the new formats XXDF. This program works best with kernels newer than 2.0.0. If both source and target are given, xdfcopy copies the disk image from file to floppy disk or vice-versa. When copying to a floppy disk, the disk is first formatted, unless the @code{-n} option is given. If no source is given, the target is only formatted. In this case, the target must be a floppy drive. @subsection Options @subsubsection Selecting a format Formats are selected by the format_id. The following formats are understood: @table @code @item 0 Formats a 5 1/4 XDF disk (1520 KB, 45.6 KB/s). @item 1 Formats a 3 1/2 high density XDF disk (1840 KB, 38.3 KB/s). @item 2 Formats a 3 1/2 extra density XDF disk (3680 KB, 102 KB/s) @item 3 Formats a 3 1/2 high density XXDF disk (1920 KB, 45 KB/s) @item 4 Formats a 3 1/2 extra density XXDF disk (3840 KB, 90 KB/s) @end table @subsection Misc options @table @code @item -D @var{dosdrive} Describes the DOS drive letter for mformat. If this option is given, an MS-DOS filesystem is automatically installed on the disk after the low-level format is complete. In order for this to work, the drive has to be configured to accept the 23x2x80 geometry in your /etc/mtools or your ~/.mtoolsrc file. Moreover, this only works with a version of mtools that is more recent than 3.0. Example of a working mtoolsrc line: @example A /dev/fd0 0 0 0 0 @end example Examples of a non-working mtoolsrc line: @example A /dev/fd0 12 80 2 18 @end example @item -n Don't format the disk before copying the disk image to the disk. @end table @subsection Options for power users @table @code @item -t @var{cylinder skew} Uses a different track skew than the default (14). For more details on skews, @pxref{superformat}. In this version of xdfcopy, the @code{-t} parameter is ignored. @item -h @var{head skew} Uses a different head skew than the default (0) In this version, this parameter is ignored @item -d Debugging. For each read or write operation, the time it took to complete the operation is printed (in milliseconds). This can be used to optimize the skews. @item -T @var{end-cylinders} Tells how many cylinders to format. With the XXDF formats, it is actually possible to format up to 83 cylinders, yielding a format of up to 1992KB on a 3 1/2 high density disk. @end table fdutils-5.6/doc/diskd.10000644000175000017500000000650714004347713013730 0ustar alainalain.TH diskd 1 "27Jan21" fdutils-5.6 .SH Name diskd - disk daemon; wait for disk to be inserted '\" t .de TQ .br .ns .TP \\$1 .. .tr \(is' .tr \(if` .tr \(pd" .SH Note This manpage has been automatically generated from fdutils's texinfo documentation. However, this process is only approximative, and some items, such as crossreferences, footnotes and indices are lost in this translation process. Indeed, these items have no appropriate representation in the manpage format. Moreover, only the items specific to each command have been translated, and the general information about fdutils has been dropped in the manpage version. Thus I strongly advise you to use the original texinfo doc. .TP * \ \ To generate a printable copy from the texinfo doc, run the following commands: .nf .ft 3 .in +0.3i ./configure; make dvi; dvips fdutils.dvi .fi .in -0.3i .ft R .lp \&\fR .TP * \ \ To generate a html copy, run: .nf .ft 3 .in +0.3i ./configure; make html .fi .in -0.3i .ft R .lp \&\fRA premade html can be found at: \&\fR\&\f(CW\(ifhttp://www.tux.org/pub/knaff/fdutils\(is\fR .TP * \ \ To generate an info copy (browsable using emacs' info mode), run: .nf .ft 3 .in +0.3i ./configure; make info .fi .in -0.3i .ft R .lp \&\fR .PP The texinfo doc looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the quoting conventions used in info. .SH Description .iX "p diskd" .PP The diskd command has the following syntax: .PP .nf .ft 3 .in +0.3i \&\fR\&\f(CWdiskd [\fR\&\f(CW-d \fIdrive\fR\&\f(CW] [\fR\&\f(CW-i \fIinterval\fR\&\f(CW] [\fR\&\f(CW-e \fIcommand\fR\&\f(CW] .fi .in -0.3i .ft R .lp \&\fR .PP Diskd waits for a disk to be inserted into a given \fIdrive\fR, and then either executes the \fIcommand\fR or exits. This program can be used to automatically mount a disk as soon as it is inserted. .PP .SH Warning .PP This program works by switching the motor on for a very short interval, and then seeking to track -1. This might damage hardware in the long run. Amigas, which also use these techniques, are known for having problems with their disk drives no longer spinning up properly after a few month of usage. .PP .SH Options .TP \&\fR\&\f(CW-d\ \fIdrive\fR\&\f(CW\fR\ Selects the drive to observe for disk insertion. By default, drive 0 (\fR\&\f(CW/dev/fd0\fR) is observed. .TP \&\fR\&\f(CW-i\ \fIinterval\fR\&\f(CW\fR\ Selects the polling interval. The interval is given in tenths of seconds. Default is 10 (one second). .TP \&\fR\&\f(CW-e\ \fIcommand\fR\&\f(CW\fR\ Gives the command to be executed when a disk is inserted. If no command is given the program simply exits. Typically, the command mounts the disk. It can be a shell scripts which probes for several filesystems and disk geometries until it succeeds. .PP .SH Bugs .IP .TP * \ \ Automatic unmounting cannot yet be handled. It is indeed not enough to scan for disk removal, because when the disk is removed, it is already too late: There might be some buffers needing flushing. However, the \&\fR\&\f(CWfdmountd\fR program allows automatic unmounting by using the \&\fR\&\f(CWSYNC\fR mount options, which switches off write buffering (see section fdmount). .TP * \ \ The drive motor is running all the time, and on some computers, the drive led flickers at each time the drive is polled. .SH See Also Fdutils' texinfo doc fdutils-5.6/doc/diskseekd.10000644000175000017500000000632614004347713014577 0ustar alainalain.TH diskseekd 1 "27Jan21" fdutils-5.6 .SH Name diskseek, diskseekd - disk seek daemon; simulates Messy Dos' drive cleaning effect '\" t .de TQ .br .ns .TP \\$1 .. .tr \(is' .tr \(if` .tr \(pd" .SH Note This manpage has been automatically generated from fdutils's texinfo documentation. However, this process is only approximative, and some items, such as crossreferences, footnotes and indices are lost in this translation process. Indeed, these items have no appropriate representation in the manpage format. Moreover, only the items specific to each command have been translated, and the general information about fdutils has been dropped in the manpage version. Thus I strongly advise you to use the original texinfo doc. .TP * \ \ To generate a printable copy from the texinfo doc, run the following commands: .nf .ft 3 .in +0.3i ./configure; make dvi; dvips fdutils.dvi .fi .in -0.3i .ft R .lp \&\fR .TP * \ \ To generate a html copy, run: .nf .ft 3 .in +0.3i ./configure; make html .fi .in -0.3i .ft R .lp \&\fRA premade html can be found at: \&\fR\&\f(CW\(ifhttp://www.tux.org/pub/knaff/fdutils\(is\fR .TP * \ \ To generate an info copy (browsable using emacs' info mode), run: .nf .ft 3 .in +0.3i ./configure; make info .fi .in -0.3i .ft R .lp \&\fR .PP The texinfo doc looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the quoting conventions used in info. .SH Description .iX "p diskseekd" .iX "c dust (shaking it off from a drive)" .iX "c shaking off dust from a drive" .PP Several people have noticed that Linux has a bad tendency of killing floppy drives. These failures remained completely mysterious, until somebody noticed that they were due to huge layers of dust accumulating in the floppy drives. This cannot happen under Messy Dos, because this excuse for an operating system is so unstable that it crashes roughly every 20 minutes (actually less if you are running Windows). When rebooting, the BIOS seeks the drive, and by doing this, it shakes the dust out of the drive mechanism. \fR\&\f(CWdiskseekd\fR simulates this effect by seeking the drive periodically. If it is called as \fR\&\f(CWdiskseek\fR, the drive is seeked only once. .PP .SH Options .PP The syntax for \fR\&\f(CWdiskseekd\fR is as follows: .nf .ft 3 .in +0.3i \&\fR\&\f(CWdiskseekd [\fR\&\f(CW-d \fIdrive\fR\&\f(CW] [\fR\&\f(CW-i \fIinterval\fR\&\f(CW] [\fR\&\f(CW-p \fIpidfile\fR\&\f(CW] .fi .in -0.3i .ft R .lp \&\fR .TP \&\fR\&\f(CW-d\ \fIdrive\fR\&\f(CW\fR\ Selects the drive to seek. By default, drive 0 (\fR\&\f(CW\(if/dev/fd0\(is\fR) is seeked. .TP \&\fR\&\f(CW-i\ \fIinterval\fR\&\f(CW\fR\ Selects the cleaning interval, in seconds. If the interval is 0, a single seek is done. This is useful when calling diskseek from a crontab. The default is 1000 seconds (about 16 minutes) for \&\fR\&\f(CWdiskseekd\fR and 0 for \fR\&\f(CWdiskseek\fR. .TP \&\fR\&\f(CW-p\ \fIpidfile\fR\&\f(CW\fR\ Stores the process id of the diskseekd daemon into \fIpidfile\fR instead of the default \fR\&\f(CW\(if/var/run/diskseekd.pid\(is\fR. .PP .SH Bugs .TP 1.\ Other aspects of Messy Dos' flakiness are not simulated. .TP 2.\ This section lacks a few smileys. .SH See Also Fdutils' texinfo doc fdutils-5.6/doc/fdmount.10000644000175000017500000002706114004347713014304 0ustar alainalain.TH fdmount 1 "27Jan21" fdutils-5.6 .SH Name fdmount - Floppy disk mount utility '\" t .de TQ .br .ns .TP \\$1 .. .tr \(is' .tr \(if` .tr \(pd" .SH Note This manpage has been automatically generated from fdutils's texinfo documentation. However, this process is only approximative, and some items, such as crossreferences, footnotes and indices are lost in this translation process. Indeed, these items have no appropriate representation in the manpage format. Moreover, only the items specific to each command have been translated, and the general information about fdutils has been dropped in the manpage version. Thus I strongly advise you to use the original texinfo doc. .TP * \ \ To generate a printable copy from the texinfo doc, run the following commands: .nf .ft 3 .in +0.3i ./configure; make dvi; dvips fdutils.dvi .fi .in -0.3i .ft R .lp \&\fR .TP * \ \ To generate a html copy, run: .nf .ft 3 .in +0.3i ./configure; make html .fi .in -0.3i .ft R .lp \&\fRA premade html can be found at: \&\fR\&\f(CW\(ifhttp://www.tux.org/pub/knaff/fdutils\(is\fR .TP * \ \ To generate an info copy (browsable using emacs' info mode), run: .nf .ft 3 .in +0.3i ./configure; make info .fi .in -0.3i .ft R .lp \&\fR .PP The texinfo doc looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the quoting conventions used in info. .SH Description .iX "p fdmount" .iX "p fdmountd" .iX "p fdlist" .iX "p fdumount" .iX "c automounting" .PP .nf .ft 3 .in +0.3i \&\fR\&\f(CWfdmount [\fR\&\f(CW-l] [\fR\&\f(CW--list] [\fR\&\f(CW-d] [\fR\&\f(CW--daemon] [\fR\&\f(CW--detach] [\fR\&\f(CW-i \fIinterval\fR\&\f(CW] [\fR\&\f(CW--interval \fIinterval\fR\&\f(CW] [\fR\&\f(CW-o \fImount-options\fR\&\f(CW] [\fR\&\f(CW-r] [\fR\&\f(CW-readonly] [\fR\&\f(CW-s] [\fR\&\f(CW--sync] [\fR\&\f(CW--nosync] [\fR\&\f(CW--nodev] [\fR\&\f(CW--nosuid] [\fR\&\f(CW--noexec] [\fR\&\f(CW-f] [\fR\&\f(CW--force] [\fR\&\f(CW-h] [\fR\&\f(CW--help] [\fIdrivename\fR\&\f(CW] [\fImountpoint\fR\&\f(CW] \&\& \&\fR\&\f(CWfdumount [\fR\&\f(CW-f] [\fR\&\f(CW--force] [\fIdrivename\fR\&\f(CW] \&\& \&\fR\&\f(CWfdlist \&\& \&\fR\&\f(CWfdmountd [\fR\&\f(CW-i \fIinterval\fR\&\f(CW] [\fR\&\f(CW--interval \fIinterval\fR\&\f(CW] [\fR\&\f(CW-r] [\fR\&\f(CW-readonly] [\fR\&\f(CW-s] [\fR\&\f(CW--sync] [\fR\&\f(CW--nosync] [\fR\&\f(CW--nodev] [\fR\&\f(CW--nosuid] [\fR\&\f(CW--noexec] [\fR\&\f(CW--help] [\fIdrivename\fR\&\f(CW] [\fImountpoint\fR\&\f(CW]] \&\& .fi .in -0.3i .ft R .lp \&\fR .PP The \fR\&\f(CWfdmount\fR program mounts a floppy disk in the specified drive. It tries to figure out the exact format and filesystem type of the disk from data in the disk's boot sector or super block and the auto-detected track layout. .PP Currently, fdmount supports the filesystems \fR\&\f(CWminix\fR, \fR\&\f(CWext\fR, \&\fR\&\f(CWext2\fR, \fR\&\f(CWxia\fR, and \fR\&\f(CWmsdos\fR, and includes special support for disks formatted by the \fR\&\f(CW2M\fR utility for MS-DOS. .PP It also checks whether the disk is write protected, in which case it is mounted read-only. .PP The symbolic \fIdrivename\fR is (currently) one of \fR\&\f(CW\(iffd[0-7]\(is\fR, corresponding to the special device files \fR\&\f(CW\(if/dev/fd[0-7]\(is\fR. If \&\fIdrivename\fR is not specified, \fR\&\f(CW\(iffd0\(is\fR is assumed. .PP The disk is mounted on the directory \fImountpoint\fR, if specified, or on \fR\&\f(CW\(if/fd[0-7]\(is\fR. In either case, the mount point must be an existing, writable directory. .PP \&\fBDue to a bug in the floppy driver (?), the polling interval (-i flag) must be longer than the spindown offset. Thus you need to do (for example) floppycontrol --spindown 99 before starting fdmountd in daemon mode\fR .PP .SH Options .IP .TP \&\fR\&\f(CW-l\ \fI--list\fR\&\f(CW\fR\ List all known drives with their symbolic name, type, and mount status. .TP \&\fR\&\f(CW-d\ \fI--daemon\fR\&\f(CW\fR\ Run in daemon mode (see below). .TP \&\fR\&\f(CW--detach\fR\ Runs daemon in background, and detaches it from its tty. Messages produced after the fork are logged to syslog. .TP \&\fR\&\f(CW-p\ \fIfile\fR\&\f(CW\fR\ .TQ \&\fR\&\f(CW--pidfile\ \fIfile\fR\&\f(CW\fR .IP Dumps the process id of the daemon to \&\fIfile\fR. This makes killing the daemon easier: \&\fR\&\f(CWkill -9 `cat \fIfile\fR\&\f(CW`\fR .TP \&\fR\&\f(CW-i\ \fIinterval\fR\&\f(CW\fR\ .TQ \&\fR\&\f(CW--interval\ \fIinterval\fR\&\f(CW\fR Set the polling interval for daemon mode. The unit for \fIinterval\fR is 0.1 seconds, the default value is 10 (i.e. 1 second). .TP \&\fR\&\f(CW-o\ \fIoptions\fR\&\f(CW\fR\ .TQ \&\fR\&\f(CW--options\ \fIoptions\fR\&\f(CW\fR Sets filesystem-specific options. So far, these are only available for DOS and Ext2 disks. The following DOS options are supported: \&\fR\&\f(CWcheck\fR, \fR\&\f(CWconv\fR, \fR\&\f(CWdotsOK\fR, \fR\&\f(CWdebug\fR, \fR\&\f(CWfat\fR, \&\fR\&\f(CWquiet\fR, \fR\&\f(CWblocksize\fR. The following Ext2 options are supported: \fR\&\f(CWcheck\fR, \fR\&\f(CWerrors\fR, \fR\&\f(CWgrpid\fR, \fR\&\f(CWbsdgroups\fR, \&\fR\&\f(CWnogrpid\fR, \fR\&\f(CWsysvgroups\fR, \fR\&\f(CWbsddf\fR, \fR\&\f(CWminixdf\fR, \&\fR\&\f(CWresgid\fR, \fR\&\f(CWdebug\fR, \fR\&\f(CWnocheck\fR. When running as a daemon, options not applying to the disk that is inserted (because of its filesystem type) are not passed to mount. .TP \&\fR\&\f(CW-r\ \fI--readonly\fR\&\f(CW\fR\ Mount the disk read-only. This is automatically assumed if the disk is write protected. .TP \&\fR\&\f(CW-s\ \fI--sync\fR\&\f(CW\fR\ Mount with the \fR\&\f(CWSYNC\fR option. .TP \&\fR\&\f(CW--nosync\fR\ Mounts without the \fR\&\f(CWSYNC\fR option, even when running as daemon. .TP \&\fR\&\f(CW--nodev\fR\ Mount with the \fR\&\f(CWNODEV\fR option. Ignored for \fR\&\f(CWmsdos\fR filesystems, otherwise always set for non-root users. .TP \&\fR\&\f(CW--nosuid\fR\ Mount with the \fR\&\f(CWNOSUID\fR option. Ignored for \fR\&\f(CWmsdos\fR filesystems, otherwise always set for non-root users. .TP \&\fR\&\f(CW--noexec\fR\ Mount with the \fR\&\f(CWNOEXEC\fR option. .TP \&\fR\&\f(CW-f\ \fI--force\fR\&\f(CW\fR\ Attempt a mount or unmount operation even \fR\&\f(CW\(if/etc/mtab\(is\fR says that the drive is already mounted, or not mounted, respectively. This option is useful if \fR\&\f(CW\(if/etc/mtab\(is\fR got out of sync with the actual state for some reason. .TP \&\fR\&\f(CW-h\ \fI--help\fR\&\f(CW\fR\ Show short parameter description .PP .SH Security .PP When mounting on the default mount point, the mount points' owner is set to the current user, and the access flags according to the user's umask. For a specified mountpoint, owner and permissions are left unchanged. Default mount points are called \fR\&\f(CW/fd0\fR, \fR\&\f(CW/fd1\fR, \&\&... , \fR\&\f(CW/fd7\fR. .PP The user running fdmount must have read access to the floppy device for read only mounts, and read/write access for read/write mounts. .PP Fdmount can be run suid root, allowing users to mount floppy disks. The following restrictions are placed upon non-root users: .TP * \ \ If a mountpoint is specified explicitly, it must be owned by the user. .TP * \ \ A user may only unmount a disk if the mount point is owned by the user, or if it the disk has been mounted by the same user. .TP * \ \ Non-msdos disks are automatically mounted with the \fR\&\f(CWnodev\fR and \&\fR\&\f(CWnosuid\fR flags set. .PP However, \fBdo not rely on fdmount being secure at the moment\fR. .PP .SH Daemon\ mode .PP In daemon mode, the specified drive is periodically checked and if a disk is inserted, it is automatically mounted. .PP When the disk is removed, it is automatically unmounted. However, it is recommended to unmount the disk manually \fIbefore\fR removing it. In order to limit corruption, disks are mounted with the SYNC option when running in daemon mode, unless the \fR\&\f(CW--nosync\fR flag is given. .PP Note that this mode has some potential drawbacks: .TP * \ \ Some floppy drives have to move the drive head physically in order to reset the disk change signal. It is strongly recommended not to use daemon mode with these drives. See section floppycontrol, for details. .TP * \ \ If a disk does not contain a filesystem (e.g. a tar archive), the mount attempt may slow down initial access. .TP * \ \ As fdmount cannot identify the user trying to use the disk drive, there is no way to protect privacy. Disks are always mounted with public access permissions set. .PP .SH Diagnostics .IP .TP \&\fR\&\f(CWerror\ opening\ device\ \fIname\fR\&\f(CW\fR\ .TP \&\fR\&\f(CWerror\ reading\ boot/super\ block\fR\ fdmount failed to read the first 1K of the disk. The disk might be damaged, unformatted, or it may have a format wich is unsupported by the FDC or the Linux kernel. .TP \&\fR\&\f(CWunknown\ filesystem\ type\fR\ No magic number of any of the supported filesystems (see above) could be identified. .TP \&\fR\&\f(CWsorry,\ can\(fmt\ figure\ out\ format\ (\fIfs\fR\&\f(CW\ filesystem)\fR\ The size of the filesystem on the disk is incompatible with the track layout detected by the kernel and an integer number of tracks. This may occur if the filesystem uses only part of the disk, or the track layout was detected incorrectly by the kernel. .TP \&\fR\&\f(CWfailed\ to\ mount\ \fIfs>\ Frequently asked question about the Linux floppy driver
Join the Big Noise! Pay fair prices to coffee growers
No Software Patents!

Fdutils

Frequently asked question about the Linux floppy driver

Most of the floppy utilities mentioned in this FAQ can be found in the fdutils package. For others, consult the lsm or archie. Alpha releases of fdutils are named fdutils-version-YearMonthDay..diff.gz

How do I access floppy drives in Linux?

Either use mtools or mount the disk. Mtools can be found here.

It is a collection of utilities to access DOS disks. These utilities behave mostly like their DOS counterparts, i.e. mdir is like dir, mcopy is like copy, etc. Specifics are in the manpages.

To mount a disk on /mnt, use the following command lines:

 mount -t msdos /dev/fd0 /mnt
The directory /mnt must already exist:
 mkdir /mnt

How should I report bugs?

If you have a question or a bug report about the floppy driver, mail me at alain @ linux.lu . If you post to the news, use preferably one of the groups comp.os.linux.help (for questions) or comp.os.linux.hardware (for bug reports). As the volume in these groups is rather high, be sure to include the word "floppy" (or "FLOPPY") in the subject line.

  • In case of a kernel panic, or OOPS, please note the EIP, and the values on the stack (some of these are the calling functions). Then look up those values in your zSystem.map (or System.map)
  • In case of a lock-up (operation never completes), try to figure out what operations are needed to reproduce it. (If you don't succeed in reproducing it, please mention the floppy operations you remember.)
  • If you can't access a disk, include the output of
     floppycontrol -pP --printfdcstate
    into your bug report.
  • If something weird happens during boot (lock-up, no floppy drives accessible, trouble with unrelated hardware), include a listing of the messages at boot. (You can obtain this with dmesg. If the boot doesn't complete only note the most important messages down [few lines before the crash, and floppy related lines]).
  • In case of I/O errors, first switch the error reporting threshold to 0. If that doesn't yield any more error messages, switch on full debugging with floppycontrol --debug and floppycontrol --reporting 0. Note that floppycontrol --debug generates a huge output. Thus, try first with --reporting. Please note also that both commands are drive specific, and that the default drive is /dev/fd0. So, if you experience a problem on /dev/fd1, use floppycontrol --debug -d/dev/fd1. Then include the kernel messages as well as the application messages with your bug report. If you're using X windows, you won't see the kernel messages appear in your xterm window. Use dmesg to get them. dmesg includes all messages since boot (or as many as fit in the buffer, if there are too many messages). Use dmesg also before executing the command, in order to find out which messages were generated by the command, and which ones were generated by earlyer commands. Alternatively, you may get the user-printk module which allows you to insert "comments" into the stream of console messages.
  • Be aware that after a crash, no user program runs, not even syslog. If you direct your kernel messages only to syslog, you may see nothing at all in the log file after rebooting. Thus, I recommend directing the messages also to the console, and noting them down. If there are more than a few lines, note only the last few lines, and the addresses of EIP and the stack trace, if applicable. Obviously, this only applies when investigating bugs which lead to a crash. If no crash happens (like for instance read errors), syslog is actually an useful and beneficial feature, as it is able to keep far more messages than fit into dmesg's buffer.
  • If you have other patches in the kernel, report them (especially ftape). If it is easy enough to undo these other patches, please try whether the problem happens without them.
  • Be sure to include complete command lines of the floppy commands which led to the problem, as well as a history of the disk changes.
  • Is the problem repeatable?
  • If you notice that the problem is very time dependent, try to find out if there is any correlation between the occurrence of the problem, and the state of the drive LED.
  • If the problem is that the drive becomes inaccessible, but everything else just works fine, try to find out the following:
    • Are all floppy drives inaccessible?
    • Does the drive LED stay on?
    • Does the drive make any noises?
    • Do all floppy related commands fail, or only those that try to actually read or write to the drive. In particular, what does floppycontrol -P do?
  • Give some description of your computer! Is it a Laptop? A particularly slow computer (386 SX)? PCI based?
  • If you can't supply all these items, go ahead anyways, I want just to make sure you aren't forgetting anything.

I can't fdformat the new formats.

Fdformat is considered obsolete. Use superformat instead.

Mtools says "12 bit FAT on a: sure?" when trying to access an ED disk (or a similar message) when formatting a disk

Some ED (extra density) disks use 16 bit FATS. The FAT type (12 or 16 bit) is described in the configuration file (/etc/mtools or ~/.mtoolsrc). It is the first number. Example:
A /dev/fd0 12 0 0 0
           ^^ 12 bit FAT

12means12 bit FAT
16means16 bit FAT
0means"use whatever is appropriate"
-12means12 bit FAT, even if it looks fishy
-16means16 bit FAT, even if it looks fishy

CAUTION: If you have an /etc/mtools file AND an ~/.mtoolsrc file, the ~/.mtoolsrc file overrides /etc/mtools. The home directory used for ~/.mtoolsrc is $HOME, if that is undefined, it is derived from $LOGNAME, and if that's undefined too, it is derived from getlogin, and finally from getuid.

There are also compiled-in defaults, which are used if neither /etc/mtools, nor ~/.mtoolsrc are found.

Mtools says "fat_read: Wrong FAT encoding 12 16?" (or similar) when accessing a disk formatted with the old mtools.

mtools does some sanity checks on the size of the FAT. Unfortunately, these are too strict for certain disks formatted with the old mtools, and for hard disk partitions formatted by DOS 6, and probably for other conditions as well. Define the environment variable MTOOLS_FAT_COMPATIBILITY to override this check.

(to do this, type

 setenv MTOOLS_FAT_COMPATIBILITY 1
in csh or tcsh, and
 export MTOOLS_FAT_COMPATIBILITY=1
in sh/bash/zsh/...)

How should I describe the new 2m formats in /etc/mtools?

Support for both disk drives a: and b: for all formats (except Xdf) is already built into the new version of mtools (3.9.10). Definitions for new drive letters no longer override these default definitions.

Just for the record, here are definitions to mimic the standard behavior:

 drive a: file="/dev/fd0"
 drive b: file="/dev/fd1"

How should I describe the Xdf formats in /etc/mtools?

The following /etc/mtools lines allow to access all disks, including Xdf:

drive a: file="/dev/fd0" use_xdf=1 drive b: file="/dev/fd1" use_xdf=1
However, the use_xdf flag slightly slows down initial access to non Xdf disks.

Which minor device number should I use for 2m formats?

2m formats don't have a minor number associated with them, they can only be accessed using the "generic " devices (i.e. /dev/fd0, /dev/fd1).

I have an IBM Thinkpad :-(

Don't panic. Add the line 'floppy=thinkpad' to your lilo boot parameters. This can be entered at the lilo prompt after the name of the kernel image. It can also be specified in the lilo.conf file, by adding the following line:
 append = "floppy=thinkpad"
With some IBM thinkpads, it's also possible to make their floppy drive work by toggling the "FLOPPY" option in CMOS from "auto" to "on". However, apparently this CMOS option is not available on all models.

On some models, both options may be required, on others, none are required.

More info about IBM Tinkpads on Linux can be found here.

What are the minor device numbers for the floppy device nodes?

The major device number for the floppy drives is 2. The minor device number is calculated using the following formula:
    minor_device = format_nr * 4 + 128 * fdc_nr + unit_nr
(fdc_nr identifies the floppy disk controller, and unit_nr identifies which drive on the floppy disk controller to be used) format_nr identifies the (see the README file in fdutils for more details). If format_nr is 0, the device is an autodetection device. Use the MAKEFLOPPIES script included in the fdutils package to automatically create the needed devices.

What are the recommended names for the floppy device nodes?

Floppy drives are named fd drive_nr type max_capacity.

Drive_nr identifies the drive. It ranges from 0 to 3 for drives connected to the first controller, and from 4 to 7 for drives connected to the second controller.

Type is the type of the drive or media. The exact meaning of this (drive or media) is still being discussed. Traditionally, this letter described the type of the drive (density, 5 1/4 or 3 1/2). Lower case letters described 5 1/4 drives, and upper case letters describe 3 1/2 drives. h or H meant high density drives, d or D meant double density drives.

Initially this letter described the type of the drive and not the type of the media in the drive. For instance, a meant for accessing 720k double density disks in a high density drive was called h720k and not d720k. The reason for this is that for 5 1/4 drives the parameters for accessing a disk do not only depend on the of the disk, but also on the drive type. The of the disk is already implied by the capacity, and so the type letter is used to describe the type of the drive.

However, this dependency on the drive type only exists for 5 1/4 drives. For 3 1/2 drives, this is not needed, and as 3 1/2 drives are more frequent, people started forgetting about this, and understood that the letter described the media . When support for extra density drives was added to the kernel, people still used the name H1440 for accessing high density disks using their extra density drive. By the way, several distribution use this scheme.

In order to calm down the confusion, we propose to make the type letter again describe the type of the drive. However, all 3 1/2 drives are now described by a unique type letter: "u". This means universal (one letter fits all 3 1/2 formats). Moreover the u resembles the Greek letter mu, as in microfloppy.

So the recommended name for a device node allowing to read 1440K disks in a 3 1/2 drive (no matter its density) is called u1440. Note that this is now lowercase.

However, this new convention is still subject to discussion.

Capacity is the capacity of the media in K bytes. Fortunately, this leads to no ambiguity.

Example:

A device node allowing to use 720K 5 1/4 floppies in a high density drive connected as first unit to the second controller is called /dev/fd4h720 Right now, MAKEFLOPPIES supports all three conventions (media, drive, and "u"), you may chose amongst them using command line switches.

14. My drive doesn't detect disk changes / When I type mdir a:, I get the directory listing of the previous disk. This means that there is a problem with the disk change line. This problem may have several reasons:

a. The disk change line is near the edge of the cable, and is the first line to suffer if the cable is not inserted straight. Press gently on the connectors of your floppy disk cable, in order to ensure that all wires make contact.

b. Because the disk change line is near the edge of the cable, it is also the first line to suffer if the cable is damaged. If necessary, buy a new cable, they cost less than five dollars.

c. On some drives, the disk change line may be chosen by jumper. Make sure that your floppy controller board and your drive agree which line is the disk change line. The usual location is line 34.

d. Some older drives don't support the disk change line at all. In this case, you have to configure the floppy driver to work around the problem. Use 'floppycontrol --broken_dcl' to do this. Now the floppy driver assumes that the disk is changed whenever the device node is closed and then re-opened. This is less efficient, as it results in many useless cache flushes, so use it only if you really need it. This command has to be issued after each reboot, so I suggest you put it into your /etc/rc files.

I get "No such device or address" errors for various floppy related commands.

This message can mean one of several things:

  1. No floppy driver is compiled into the kernel, and no floppy module is inserted. Kerneld may fail to automatically insert the floppy module when you upgraded your kernel without upgrading the module and moving it to a place where kerneld finds it.
  2. The drive doesn't exist (mistyped drive name?)
  3. No disk is in the drive.
  4. A problem with the disk change line: The disk change line is not only used to detect disk changes, but also to tell whether there is a disk in the drive at all.) See question 13 for fixes for disk change line problem.
  5. The floppy geometry is unknown for the getfdprm or fdformat programs. If you a disk, rather use superformat.

I have a HP Omnibook 6000 :(

These laptops are supplied with a floppy-drive & fdc combo which doesn't support DMA :( Just add floppy=nodma to your Lilo command line. More info about the Omnibook and linux can be found here.

I can't get my floppy drive going, is there another method to install?

You may also install via hard disk and initrd. You need a big enough hard disk to do this (and it takes a little bit more time than the usual method). The following method presumes that it is possible to access the disk using DOS.

  1. Leave a small DOS partition (with enough spare space to hold the tar files from a few install disks). The bigger that partition is, the less come and goes from DOS are needed later. However, the bigger it is, the less space is available for Linux itself.
  2. On a desktop computer, using Linux, make a filesystem on a smallish spare partition (for instance on your swap partition). This filesystem should contain the files usually found on the install root disks. Add a '/linuxrc' file which contains the following lines:
    
    #!/bin/sh
    . etc/rc
    /bin/sh
    
  3. On the desktop computer, unmount the filesystem, and dd it to a file. Compress the file, and copy it to a floppy disk.
  4. Copy it to the Laptops hard disks.
  5. Copy the tar files from the first few install disks to the laptops hard disk.
  6. Use loadlin to boot Linux on the laptop (use the umsdos fs as root).
  7. Start installation (tell the install program to look for the tar files on your hard disk).
  8. If the first few files are installed, move back to DOS to erase the tar files which you already unpacked, and copy the next ones.
  9. reboot Linux.
  10. repeat until all is installed.
  11. After installation, it is wise to leave that DOS partition, in case you need to bring more files later.
Steps 5 to 10 may be skipped if your laptop has a CD-ROM drive :-)

Is it possible to use two floppy disk controllers under Linux?

YES. To use both controllers, boot the kernel with the lilo parameter 'floppy=two_fdc'. This parameter can be given on the lilo prompt, just after the name of the kernel. It can also be specified in the /etc/lilo.conf file by adding the following line:
 append = "floppy=two_fdc"

It is assumed that your second controller lives at 0x370. If it uses another I/O base-address, change this address in the floppy.c. The drives on the second controller use the minor device numbers 128-131 for the generic device, and 132-255 for the fixed geometry device. The following formula gives the minor number:

	minor = fdc * 128 + geometry * 4 + unit 
See the README file in fdutils for more details.

Is it possible to boot off these special disks?

Yes. Make sure you have a version of lilo more recent than v18, and put the following line into your /etc/lilo.defines before compiling it:
 -DXL_SECS=44
This enables Lilo to boot from disks with up to 44 sectors (i.e. more than you'll ever see :-) ) It allows to boot from ED disks and from disks with more sectors than usual (up to 21 on a HD disk, 42 on an ED disk). However, 2m and Xdf disks cannot be booted using this method.

I get "Unable to allocate DMA memory" messages when trying to use the floppy.

This happens whenever the memory is too scarce to allocate the floppy driver's DMA buffer. It is possible to use the floppy driver without DMA, and in that case, the floppy driver uses vmalloc'ed memory, which is more readily available. In order to disable DMA, use the floppy=nodma boot flag. If you use the floppy driver as a module, set the environment variable 'floppy' to 'dma'.

I have a Micron Millenia Transport.

Apparently, these laptops are supplied with a floppy controller which doesn't support the fifo.

Switch off the FIFO by adding floppy=nofifo to your Lilo command line.


Last modified: Thu Mar 3 23:29:19 CET 2005 fdutils-5.6/doc/Makefile.in0000644000175000017500000000734314004350432014604 0ustar alainalainMAKEINFO = makeinfo TEXI2DVI = texi2dvi TEXI2HTML = texi2html top_srcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ infodir = @infodir@ mandir = @mandir@ infodir = @infodir@ sysconfdir = @sysconfdir@ datarootdir = @datarootdir@ mandir1 = $(mandir)/man1 mandir4 = $(mandir)/man4 mandir8 = $(mandir)/man8 MANPAGES1 = diskd.1 fdrawcmd.1 getfdprm.1 superformat.1 diskseekd.1 \ floppycontrol.1 makefloppies.1 xdfcopy.1 fdmount.1 \ floppymeter.1 setfdprm.1 MANPAGES4 = fd.4 MANPERM = 644 UID = root GID = root INSTALL = @INSTALL@ INSTALL_DATA= @INSTALL_DATA@ INSTALL_INFO= @INSTALL_INFO@ CC = @CC@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ all: info dvi TEXISRC = \ acronyms.texi fdrawcmd.texi ioctl.texi superformat.texi \ autodetect.texi fdutils.texi lilo.texi tips.texi \ commands.texi floppycontrol.texi location.texi utilities.texi \ diskd.texi floppymeter.texi makefloppies.texi xdfcopy.texi \ diskseekd.texi formatlist.texi moredata.texi \ fdmount.texi getfdprm.texi setfdprm.texi html: Fdutils.html dvi: Fdutils.dvi info: fdutils.info %.info: $(TEXISRC) $(MAKEINFO) -I @srcdir@ @srcdir@/fdutils.texi %.dvi: Fdutils.texi $(TEXI2DVI) Fdutils.texi clean: rm -f fdutils.aux fdutils.cp fdutils.cps fdutils.dvi fdutils.fn rm -f fdutils.log fdutils.pg fdutils.ps fdutils.toc fdutils.tp rm -f fdutils.ky fdutils.vr fdutils.info fdutils.pgs rm -f Fdutils.aux Fdutils.cp Fdutils.cps Fdutils.dvi Fdutils.fn rm -f Fdutils.log Fdutils.pg Fdutils.pgs Fdutils.toc Fdutils.tp rm -f Fdutils.ky Fdutils.vr Fdutils.pgs rm -f fdutils.info* rm -f texi-linearize Fdutils.texi %.html: Fdutils.texi $(TEXI2HTML) $< Fdutils.texi: $(TEXISRC) texi-linearize ./texi-linearize $(srcdir) fdutils.texi > $@ # Don't cd, to avoid breaking install-sh references. install-info: info $(top_srcdir)/mkinstalldirs $(infodir) if test -f fdutils.info; then \ for i in fdutils.info*; do \ $(INSTALL_DATA) $$i $(infodir)/$$i; \ done; \ else \ for i in $(srcdir)/fdutils.info*; do \ $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \ done; \ fi; \ if [ -n "$(INSTALL_INFO)" ] ; then \ if [ -f $(infodir)/dir.info ] ; then \ $(INSTALL_INFO) $(infodir)/fdutils.info $(infodir)/dir.info; \ fi; \ if [ -f $(infodir)/dir ] ; then \ $(INSTALL_INFO) $(infodir)/fdutils.info $(infodir)/dir; \ fi; \ fi install-man: $(top_srcdir)/mkinstalldirs $(mandir1) $(top_srcdir)/mkinstalldirs $(mandir4) $(top_srcdir)/mkinstalldirs $(mandir8) for i in $(MANPAGES1); do \ install -c -m $(MANPERM) -o $(UID) -g $(GID) \ $(srcdir)/$$i $(mandir1)/$$i; \ done for i in $(MANPAGES4); do \ install -c -m $(MANPERM) -o $(UID) -g $(GID) \ $(srcdir)/$$i $(mandir4)/$$i; \ done # for i in $(MANPAGES8); do \ # install -c -m $(MANPERM) -o $(UID) -g $(GID) \ # $(srcdir)/$$i $(mandir8)/$$i; \ # done ( cd $(mandir1); \ ln -sf fdmount.1 $(mandir1)/fdumount.1; \ ln -sf fdmount.1 $(mandir1)/fdlist.1; \ ln -sf fdmount.1 $(mandir1)/fdmountd.1; \ ln -sf xdfcopy.1 $(mandir1)/xdfformat.1 \ ) install-zman: for i in $(MANPAGES1); do \ gzip < $(srcdir)/$$i >_; \ install -c -m $(MANPERM) -o $(UID) -g $(GID) \ _ $(mandir1)/$$i.gz; \ done for i in $(MANPAGES4); do \ gzip < $(srcdir)/$$i >_; \ install -c -m $(MANPERM) -o $(UID) -g $(GID) \ _ $(mandir4)/$$i.gz; \ done for i in $(MANPAGES8); do \ gzip < $(srcdir)/$$i >_; \ install -c -m $(MANPERM) -o $(UID) -g $(GID) \ _ $(mandir8)/$$i.gz; \ done rm _ install: install-man install-info fdutils-5.6/doc/README0000444000175000017500000004033314004347614013421 0ustar alainalain This package contains utilities to configure and debug the floppy driver, and utilities to format floppy disks. ----------------------------------------------------------------------------- WARNING ======= Although most drives are able to use 83 tracks, some may not. If your drive is making strange noises while accessing these tracks, don't use formats which use more than 80 tracks (13-19). (You may still gain something by the increased number of sectors) ----------------------------------------------------------------------------- The fdutils allows you to access some of the extended features of the linux floppy driver. These include: 1. Formatting disks with a higher capacity than usual (up to 1992k on a 3 1/2 HD disk). 2. Reconfiguration of the autodetection sequence to automatically detect some of these extended formats. 3. Limitation by the superuser of the highest allowable number of tracks. 4. Access to various internal driver structures, and drive configuration using the floppycontrol program. Floppy ioctls: ============== All these ioctl's may be issued using the floppycontrol program. (See also floppycontrols man page) 1. FDSETPRM sets the geometry (number of tracks, heads and sectors, etc) of a drive. 2. FDDEFPRM sets the geometry in a permanent way (not cleared after a disk change) 3. FDGETPRM read a previously set drive geometry (or an autodetected geometry) back. 4. FDCLRPRM makes the driver forget the geometry for a given drive (to trigger autodetection) 5. FDFLUSH forgets the contents of the floppy buffers. CAUTION: This doesn't write dirty buffers to the disk. Use fsync first. 6. FDGETDRVTYP displays the type of a drive (name parameter). This is used by MAKEFLOPPIES. For the naming convention, see the description of the MAKEFLOPPIES script. For formats which work in several drive types, FDGETDRVTYP return a name which is appropriate for the oldes drive type which supports this format. 7. FDSETDRVPRM sets various drive parameters. 8. FDGETDRVPRM reads these parameters back. 9. FDGETDRVSTAT gets the cached drive state (disk changed, write protected et al.) 10. FDPOLLDRVSTAT polls the drive and return its state. 11. FDGETFDCSTAT gets the floppy controller state. 12. FDRESET resets the floppy controller under certain conditions. 13. FDRAWCMD sends a raw command to the floppy controller. 14. FDWERRORCLR clear the write error stats. 15. FDWERRORGET gets the write error stats. 16. FDSETMAXERRS sets the error thresholds (when to display error messages on the console, and when to abort operations). The maxerror structure is part of the drive parameters, but this ioctl is needed in addition to FDSETDRVPRM because FDSETDRVPRM is only accessible to the superuser whereas FDSETMAXERRS is accessible to whoever has write access to the floppy device. 17. FDMSGON/FDMSGOFF switch informational messages on/off. This flag is part of the drive parameters as well, but FDMSGON/FDMSGOFF don't need superuser status. There are other ioctls as well, but they are considered obsolete and their use is discouraged. The extended formats ==================== Some formats use more than 80 tracks. It is not possible for the kernel to autodetect the number of tracks in a reasonable time, so you have to use a sufficiently recent version of mtools o set the number of tracks according to the boot sector of the disk. Mtools 2.5 and up are ok. This doesn't obviously work with disks containing something else than a MSDOS filesystem. The minor device number for the floppy devices is calculated as follows: minor_device = format_nr * 4 + 128 * fdc_nr + unit_nr (fdc_nr identifies the floppy disk controller, and unit_nr identifies which drive on the floppy disk controller to be used) The major device number is 2. The format_nr is the number of the entry in the table in floppy.c. Valid numbers and formats are: format_nr Format --------- ------ 0 autodetect 1 360kB, 5.25" DD drive 2 1200kB, 5.25" HD drive 3 360kB, 3.5" DD drive 4 720kB, 3.5" DD drive 5 360kB, 5.25" DD disk in HD drive 6 720kB, 5.25" DD disk in HD drive 7 1440kB, 3.5" HD drive 8 2880kB, 3.5" ED drive 9 2880kB, 3.5" CompaQ ED drive (???) 10 1440kB, 5.25" HD drive 11 1680kB, 3.5" HD drive 12 410kB, 5.25" DD disk in HD drive 13 820kB, 3.5" DD drive 14 1476kB, 5.25" HD drive 15 1722kB, 3.5" HD drive 16 420kB, 5.25" DD disk in HD drive 17 830kB, 3.5" DD drive 18 1494kB, 5.25" HD drive 19 1743kB, 3.5" HD drive 20 880kB, 5.25" DD drive 21 1040kB, 3.5" DD drive 22 1120kB, 3.5" DD drive 23 1600kB, 5.25" HD drive 24 1760kB, 3.5" HD drive 25 1920kB, 3.5" HD drive 26 3200kB, 3.5" ED drive 27 3520kB, 3.5" ED drive 28 3840kB, 3.5" ED drive 29 1840kB, 3.5" HD drive 30 800kB, 3.5" DD drive 31 1600kB, 3.5" HD drive This table lists first the format_nr (0-31) used to compute the minor number, then the capacity of the format (360kb - 3200kb), and then the type of the drive in which this format is used. The formats 0..8 are the standard PC formats, 9 is apparently needed for certain weird CompaQ computers. The remaining formats are extended capacity formats. Some of them have been taken from Heiko Schroeder's fdpatches (after correcting some minor bugs). Others have been added by David Niemi and me (Alain Knaff). Formats 30 and 31 are non-interleaved formats with normal sized sectors, and have the highest capacity that can be achieved without resorting to interleaving or bigger sectors. Formats 20 to 29 use bigger sectors than usual, and thus are probably not readable with most DOS utilities (fdformat, vgacopy etc. Get 2m instead :-) ) BEWARE OF FORMATS 13-19 IF YOUR DRIVE ONLY SUPPORTS 80 TRACKS. You can redefine these formats using the setfdprm program (Written by Werner Almesberger). To use the new formats, you have to make new /dev/fd* entries, using the MAKEFLOPPIES shell script. You may also make the devices manually: (This is needed if you redefine your default formats using setfdprm) Example: Make a device entry for a 1.74MB floppy in drive 0: The format number is 19, drive 0, floppy disk controller 0 so the minor device number is 128*0+4*19+0=76. The command line to make the new device entry is: mknod /dev/fd0H1743 b 2 76 ^ ^ ^ ^ | | | Minor device number | | Major device number (always 2!) | Blockdevice A name that you choose for the format. I recommend the names I used in floppy.c, but you can choose any name you want. Other formats: ============== Linux is able to read almost any MFM disks. These include many CP/M disks and also Commodore 1581 disks. Please get Michael Haardt's documentation on floppy drives for a detailed description of those formats. This can be ftp'ed from http://www.moria.de/~michael/floppy/floppy.ps Commodore 1581 disks are not yet described in this documentation. Use 'setfdprm /dev/fd0 1600 10 2 80 2 0x2A 0x02 0xDF 0x2E' to use these. If you want to use these disks often, redefine one of the "default" formats to be Commodore 1581, and then put it into the autodetection list for the drive. The following example describes how to redefine format number 31 (minor device number 124) to be Commodore 1581: mknod /dev/fd0cbm1581 b 2 124 setfdprm /dev/fd0cmb1581 1600 10 2 80 2 0x2A 0x02 0xDF 0x2E floppycontrol --autodetect /dev/fd0 31,7,8,4,25,28,22,21 The two latter commands have to be issued after each reboot, so I suggest you put them into your /etc/rc files if you use many Commodore 1581 disks. Using more than 80 tracks: ========================== Although most drives support more than 80 tracks some may not, and repeatedly trying to read beyond track 80 might be damaging to them. In order to know wether your drive supports more than eighty tracks, first set the number of allowed tracks to 82. (using floppycontrol --tracks 82 -d ) Then format a disks with a 82 track format (for example /dev/fd0H1722), and copy a file on it large enough to fill the disk it completely. (Many small files will do too. The disk is full enough if the free space is less than a track, in this case 18k) Then eject and reinsert the disk, and compare the file on the disk with the original. If they are still the same, your drive supports 82 tracks. (If yes, you might want to try also with 83 tracks: /dev/fd0H1743)) (This single experience should not damage the drive.) If you do have a drive which supports more than 80 tracks, you have to enable the additional tracks after each boot, for instance by calling floppycontrol --tracks 82 from your /etc/rc.local in order to allow programs to use these tracks. (Alternatively, you could also change it in the default_drive_params structure) If your drive doesn't support more than 80 tracks, please remove the entries for formats 13-19 from your /dev directory after running MAKEFLOPPIES. N.B. I have yet to see a 3.5" drive which doesn't support 82 tracks. If you have such a beast, please mail me. Configuring the floppy driver via lilo: ======================================= The floppy driver is configured using the 'floppy=' option in lilo. This option can be typed at the boot prompt, or entered in the lilo configuration file. Example: If your kernel is called linux-72, type the following line at the lilo boot prompt (if you have a thinkpad): linux-72 floppy=thinkpad You may also enter the following line in /etc/lilo.conf, in the description of linux-72: append = "floppy=thinkpad" Several floppy related options may be given, example: linux-72 floppy=daring floppy=two_fdc append = "floppy=daring floppy=two_fdc" If you give options both in the lilo config file and on the boot prompt, the option strings of both places are concatenated, the boot prompt options coming last. That's why there are also options to restore the default behaviour. The floppy related options include: floppy=daring Tells the floppy driver that you have a well behaved floppy controller. This allows more efficient and smoother operation, but may fail on certain controllers. floppy=0,daring Tells the floppy driver that your floppy controller should be used with caution. floppy=one_fdc Tells the floppy driver that you have only floppy controller (default) floppy=two_fdc floppy=
,two_fdc Tells the floppy driver that you have two floppy controllers. The second floppy controller is assumed to be at
. If
is not given, 0x370 is assumed. two_fdc is implied if you use the cmos option with a drive of id 4 to 7. floppy=thinkpad Tells the floppy driver that you have a Thinkpad. Thinkpads use an inverted convention for the disk change line. floppy=0,thinkpad Tells the floppy driver that you don't have a Thinkpad. floppy=,,cmos Sets the cmos type of to . Additionnaly, this drive is allowed in the bitmask. This is useful if you have more than two floppy drives (only two can be described in the physical cmos), or if your BIOS uses non-standard CMOS types. The CMOS types are: 0 - unknown or not installed 1 - 5 1/4 DD 2 - 5 1/4 HD 3 - 3 1/2 DD 4 - 3 1/2 HD 5 - 3 1/2 ED 6 - 3 1/2 ED (Note: there are two valid types for ED drives. This is because 5 was initially chosen to represent floppy *tapes*, and 6 for ED drives. AMI ignored this, and used 5 for ED drives. That's why the floppy driver handles both) Setting the CMOS to 0 for the first two drives (default) makes the floppy driver read the physical cmos for those drives. floppy=unexpected_interrupts Print a warning message when an unexpected interrupt is received (default behaviour) floppy=no_unexpected_interrupts floppy=L40SX Don't print a message when an unexpected interrupt is received. This is needed on IBM L40SX laptops in certain video modes. (There seems to be an interaction between video and floppy. The unexpected interrupts only affect performance, and can safely be ignored.) (There are other options as well, but they are considered obsolete) Included utilities: =================== 1. floppycontrol. This program sets the various error tresholds (error reporting, operation abortion, and read track), prints out drive drive types, and flushes buffers. There is a -h help option. This program provides examples on how to use the new ioctl's. To compile this program just type make in the util directory. See also the included manpage. (in the utils directory) 2. MAKEFLOPPIES. This shell script creates the new floppy block device files. It uses the floppycontrol program to translate the minor device numbers into meaningful names. It also uses these names to decide wether to create a given block device file or not, depending on the type of the physical drive (for instance, for a 3 1/2 drive, the formats corresponding to a 5 1/4 drive are not created). If you have more than two floppy drives, the kernel cannot find out the types of these additional drives, and you need to specify them with the environmental variables FD2 and FD3. The following types are available: H1440 ( HD 3''1/2), h1200 (HD 5''1/4), D720 (DD 3''1/2) and d360 (DD 5''1/4). Sample command line: FD2=1.44M FD3=1.2M MAKEFLOPPIES The names of the device are a letter describing the _drive_ types, followed by a letter describing the size of the _format_. The letters are E = 3.5" ED drive H = 3.5" HD drive D = 3.5" DD drive h = 5.25" HD drive d = 5.25" DD drive Example: h360 is a device for accessing a 360k disk in a 5.25" HD drive. This convention is the same as used by Slackware and the MAKEDEV script, except for the ED drives (which are named H2880 by MAKEDEV, and don't yet exist in Slackware) IMPORTANT: The MAKEFLOPPIES script needs the floppycontrol program on the search PATH. 3. Setfdprm. This program is used to set the media parameters for a drive. See manpage (in the utils directory) 4. Superformat. This program is used to format floppy disks. The old fdformat doesn't work for disks with bigger sectors. WARNING: DO READ THIS MANPAGE CAREFULLY. IMPROPER USAGE MAY LEAD TO DATA LOSS. 5. Others: see the manpages Reading these disks under dos: ============================== *formats with normal sector sizes: (10..19) There are zillions of utilities which are able to read these: fdformat, vgacopy, ... With dos6, you don't even need those, just put the following line in your config.sys: drivparm=/d:0 /f:7 /h:2 /s:21 /t:82 ^ ^ \______________/ | | | drive number | max geometry | drive type, consult the dos help for details *formats with bigger sectors: There is only one utility which can do this: 2m20 (by Ciriaco Garcia) You can get this program from nic.switch.ch:/mirror/msdos/diskutil/2m20.zip (for other adresses, see archie) This program uses a normal format for the first track and first head (18 sectors), and enhanced formats for the other tracks (up to 24*512 bytes per track !) See the manpage of superformat (option --2m) to know how to format disks readable by this program. This man page is in the utils directory. WARNING: DO READ THIS MANPAGE CAREFULLY. IMPROPER USAGE MAY LEAD TO DATA LOSS. DO ONLY PUT MSDOS FILESYSTEMS ON 2M DISKS. Other Doc: ========== There are man pages for mtools (in mtools/) and the utilities (in utils/) included. There's also a FAQ list. It is regularily updated on http://fdutils.linux.lu/FAQ.html . You can find alpha versions of fdutils on http://fdutils.linux.lu/ . (They are named fduddmm.taz, where dd stands for the day and mm for the month. I'll only leave these for a limited time, and then move them into an old directory, or remove them.) fdutils-5.6/doc/acronyms.texi0000444000175000017500000001275414004347614015275 0ustar alainalain@node Acronyms, Interesting formats, Compile-time configuration, Top @appendix Acronyms @table @emph @item SD (Single density) Single density disks use a data transfer rate of 125 kb/s and are no longer in use today, because of their low capacity. @item DD (Double density) Double density disks normally hold 360KB (5 1/4) or 720KB (3 1/2) of data per disk. Double density disks have only a hole on one side (for write protection). Double density uses a data transfer rate of 250 kb/s or 300 kb/s depending on the drive type: 5 1/4 high density drives use 300 kb/s when writing to a double density diskm 250 kb/s is used in all other circumstances. The reason why double density disks in high density drives need a higher data transfer rate is because these drives rotate faster (360 rpm instead of 300 rpm). @item HD (High density) High density disks normally hold 1200KB (5 1/4) or 1440KB (3 1/2) of data per disk. High density 3 1/2 disks are marked as such by the presence of a second square hole, just opposed to the write protect hole. 3 1/2 high density disks are the most commonly used type of disks today. @item QD (Quad density) Quad density is a hybrid between double and high density. It only exists for 5 1/4 disks, and holds 720KB of data. It can be obtained by formatting DD disks in a HD drive. QD uses double density for the density along the tracks (data transfer rate), and high density for the density perpendicular to the tracks (spacing between tracks, and thus number of tracks). This came to existence because these two aspects are limited by two different factors: the density along the track is limited by the quality of the media, whereas the density perpendicular to the tracks is mainly limited by the drive mechanism (this density, expressed in bits per inch comes nowhere near the limits of the media, even with HD). Thus quad density is an easy way to double the capacity of an ordinary double density disk, just by formatting it in a HD drive. @item ED (Extra density) Extra density refers to a disk density that can normally hold 2880KB of data per disk. Extra density disks only exist as 3 1/2 disks. ED disks are marked with a second squared hole opposed to the square hole, which is a little bit closer to the middle of the edge than that of HD disks. This format never really took off, because it only was released when storage media with a much higher capacity, such as CD-Roms, tapes and Zip disks became popular. ED uses a data transfer rate of 250 kb/s. @item DS (Double sided) Self explanatory. @item SS (Single sided) Self explanatory @item MSS (Mixed size sectors) Mixed sector size formats are formats which use sectors of several different sizes on a single track. @xref{Mixed size sectors}, for details. @item 2M (2 Megabytes) 2M is a high capacity format developped by Ciriaco de Celis. The basic principle is the same as MSS: mix sectors of several sizes on a same track, in order to minimize both slack space and header overhead. 2M is different from MSS in that it uses a normal 18 sector format on its first track. @xref{2M}, for details. @item rpm (Rotations per minute) All 3 1/2 drives and 5 1/4 DD drives run at 300 rotations per minute, whereas 5 1/4 HD drives run at 360 rotations per minute. @item rps (Rotations per second) See above. @item tpi (tracks per inch) Expresses how close cylinders are to each other. Usually, 5 1/4 double density disks have 48 tpi, whereas 5 1/4 high density and quad density disks have 96 tpi. 3 1/2 disks use 135.5 tpi. @item XDF (eXtended Density Format) XDF is a disk format used for the OS/2 distribution disks. Its operating systems are similar to 2M and MSS disk, but it is faster due to a more creative arrangement of sectors. @xref{XDF}, for details. @item XXDF (eXtended XDF) XXDF is an Linux enhancement for XDF. It can store 1992 KB of data on an ED disk instead of just 1840 available with the regular XDF format. @xref{XXDF}, for details. @item MFM (Multi Frequency Modulation) MFM is a low level encoding of disk data. It is used for DD, HD and ED disks, i.e. virtually all disks that are available today. The PC hardware can only read MFM and FM disks. The doc at: @example http://www.moria.de/~michael/floppy/floppy.ps @end example contains more detailed information about FM and MFM encoding. @item FM (Frequency modulation) FM is a low level encoding of disk data. It was used for SD disks, and is now considered to be obsolete. The doc at: @example http://www.moria.de/~michael/floppy/floppy.ps @end example contains more detailed information about FM and MFM encoding. @item kb (kilobit) 1000 bits @item kb/s (kilobit per second) We express the raw data throughput to and from the disk in this unit, which is also used in the documentation of the floppy disk controller. @item B Byte. A byte is 8 bits, and is the smallest individually addressable unit of data. @item KB (K-Byte) 1024 bytes. Sometimes also noted K. @item KB/s (K-Byte) We express the usable data throughput to and from the disk in KB/s. Roughly, 1 KB/s = 8 kb/s. However, the usable data throughput is always lower than the raw throughput due to header overhead, interleaving and seek overhead. @item MB (Megabyte) Initially, 1 megabyte was 1024*1024 bytes (i.e. 1048576 bytes). However, when talking of floppy disk capacity, we understand it as 1000KB, that is 1000*1024 bytes, i.e. 1024000 bytes. @item MB/s (million bytes per second) We express (high) raw data throughput to and from the disk in kb/s, which is also used in the documentation of the floppy disk controller. @end table fdutils-5.6/doc/autodetect.texi0000444000175000017500000001040014004347614015565 0ustar alainalain@node Autodetection, Boottime configuration, Extended formats, Top @chapter How autodetection works @cindex autodetection @cindex format @cindex recognize a disk The principle of autodetection is rather simple. When a floppy disk is first accessed, and its geometry is not yet known, the floppy driver tries out a list of up to 8 geometries (format descriptions) until one is found that matches (i.e. that makes it possible to read the first sector or track). This list of geometries is called the @emph{autodetection list}. There is one autodetection list per drive type (as indicated in the cmos). The autodetection list doesn't contain the geometry descriptions themselves, but rather references to entries in the @emph{geometry list} (@pxref{geometry list}). Each list may contain up to 8 such references. Each reference can be tagged with a @code{t} flag. If this tag is set, the floppy driver tries to read the whole track when trying out that description; if it is not set, it only tries to read the boot sector. Reading the whole track is useful to distinguish among geometries which differ only in the amount of sectors per track. In order to do this, put the geometry with the most sectors first in the list, and set its @code{t} tag. Use the @code{t} tag only in this case, as it makes autodetection slower. Autodetection cannot distinguish between geometries that only differ in the number of heads or in the number of tracks. Autodetection is meant to supply only a first approximation of the actual format of the disk. It supplies enough information to enable a program such as @code{mtools} to read the boot sector, which contains the exact information. @code{Mtools} then uses the information contained in the boot sector to set the exact geometry. The autodetection list is set using the following command: @example floppycontrol --autodetect @var{list} @end example @section Example The following example restores the default autodetection sequence for a 3 1/2 ED drive: @example floppycontrol --autodetect 7,8,4,25,28,22,31,21 @end example The following example changes this sequence, so as to add the 1680KB format (number 11). As only 8 formats are allowed in the autodetection list, we have to dump one entry (we chose the last, which is numbered 21). The 1680KB format is identical with the default 1440KB format except for the number of sectors. Thus we must read the whole track in order to distinguish it from the 18 sector format (@code{t} flag). Furthermore, the the 1680KB sector format should be detected first, as an 21 sector disk would also matches the standard format with its 18 sectors. @example floppycontrol --autodetect 11t,7,8,4,25,28,22,31 @end example The following example attempts to autodetect CBM 1581 disks along with the more usual formats. CBM 1581 disks are not among the predefined formats. Thus we first have to pick one of the predefined formats and change it so it fits our needs. We may for example pick one of the rarely used 5 1/4 formats, such as h880, which bears number 20). We first make a device node bearing the requested number (so that we have a filename to pass to setfdprm), then we chmod it so it becomes accessible to mortal users, finally we configure the geometry of the new node, and enter it into the autodetection list. We place it at the 4th position, just behind the usual ED, HD and DD formats, and before the more exotic extended formats. Indeed, formats which are nearer to the head of the list are autodetected faster, and hence more commonly used formats should be put nearer to the beginning @footnote{except of course if several formats only differ in the number of sectors per track, in which case the formats with the most sectors should come first}. @example mknod /dev/fd0cbm1581 b 2 80 chmod 666 /dev/fd0cbm1581 setfdprm /dev/fd0cbm1581 DD DS sect=10 cyl=80 ssize=512 fmt_gap=35 gap=12 swapsides floppycontrol --autodetect 7,8,4,20,25,28,22,31 @end example Some formats use more than 80 tracks. It is not possible for the kernel to autodetect the number of tracks in a reasonable time, so you have to use a sufficiently recent version of mtools to set the number of tracks according to the boot sector of the disk. Mtools 3.0 and up are ok. This doesn't obviously work with disks containing something else than a MS-DOS filesystem. fdutils-5.6/doc/cleanup0000555000175000017500000000051214004347614014111 0ustar alainalain#!/bin/sh rm -f fdutils.aux fdutils.cp fdutils.cps fdutils.dvi fdutils.fn fdutils.ky rm -f fdutils.log fdutils.pg fdutils.ps fdutils.toc fdutils.tp fdutils.vr rm -f fdutils.info* rm -f Fdutils.aux Fdutils.cp Fdutils.cps Fdutils.dvi Fdutils.fn Fdutils.ky rm -f Fdutils.log Fdutils.pg Fdutils.pgs Fdutils.toc Fdutils.tp Fdutils.vr fdutils-5.6/doc/cmdname0000444000175000017500000000115714004347614014071 0ustar alainalaindiskd - disk daemon; wait for disk to be inserted diskseek, diskseekd - disk seek daemon; simulates Messy Dos' drive cleaning effect fd - floppy disk device fdmount - Floppy disk mount utility fdrawcmd - send raw commands to the floppy disk controller floppycontrol - floppy driver configuration utility floppymeter - measure raw capacity and exact rotation speed of floppy drive getfdprm - print the current format information MAKEFLOPPIES - Creates the default floppy device nodes. setfdprm - sets user-provided floppy disk parameters superformat - format floppies xdfcopy - Program to copy and format Xdf disks in Linux fdutils-5.6/doc/commands.texi0000444000175000017500000000237414004347614015240 0ustar alainalain@node Commands, Compile-time configuration, Floppy ioctls, Top @chapter Command list @cindex Command list @cindex List of available commands This section describes the available fdutils commands, and the command line parameters that each of them accepts. @menu * diskd:: detect a disk change and execute a command * diskseekd:: seeks the drive from time to time to shake of the dust * fdmount:: automatically mounts and unmounts floppy disks * fdrawcmd:: send raw commands to the floppy disk controller * floppycontrol:: configure the floppy driver * floppymeter:: measures characteristic parameters of a floppy drive * getfdprm:: print current geometry parameters * makefloppies:: makes the floppy device entries * superformat:: formats high capacity disks * setfdprm:: changes the current and permanent geometry parameters * xdfcopy:: copies and formats XDF disks @end menu @include diskd.texi @include diskseekd.texi @include fdmount.texi @include fdrawcmd.texi @include floppycontrol.texi @include floppymeter.texi @include getfdprm.texi @include makefloppies.texi @include setfdprm.texi @include superformat.texi @include xdfcopy.texi fdutils-5.6/doc/configure.texi0000444000175000017500000000267214004347614015421 0ustar alainalain@node Compile-time configuration, Acronyms, Commands, Top @chapter Compile-time configuration via GNU autoconf @cindex configure options @cindex compile-time configuration Before it can be compiled, fdutils must be configured using the GNU autoconf script @code{./configure}. In most circumstances, running @code{./configure} without any parameters is enough. However, you may customize fdutils using various options to @code{./configure}. The following options are supported: @table @code @item --prefix @var{directory} Prefix used for any directories used by fdutils. By default, this is @file{/usr/local}. Fdutils is installed in @file{$prefix/lib}, looks for its system wide configuration file in @file{$prefix/etc}. Man pages are installed in @file{$prefix/man}, info pages in @file{$prefix/info} etc. @item --sysconfdir @var{directory} Directory containing the system-wide configuration files such as @file{mediaprm} and @file{driveprm}. By default, this is derived from @code{prefix} (see above). N.B. For backward compatibility reasons, the old-style floppy parameter file @file{fdprm} is always in @file{/etc}, regardless of the setting for @code{sysconfdir} @item --enable-fdmount-floppy-only Allows usage of the @code{fdmount} program only to members of the group @code{floppy} @end table In addition to the above-listed options, the other standard GNU autoconf options apply. Type @code{./configure --help} to get a complete list of these. fdutils-5.6/src/0000755000175000017500000000000014004352135012554 5ustar alainalainfdutils-5.6/src/MAKEFLOPPIES0000555000175000017500000001173707560752410014401 0ustar alainalain#!/bin/sh # # MAKEFLOPPIES # # requires: expr # Note quirk of expr: if it prints "0", it always # returns "1" regardless of whether this makes sense! # # 1995.01.03 David Niemi Created set -e set -u MAJOR=2 TMPDEVICE=/dev/tmpfloppy$$ if [ ! -b /dev/fd0 ] ; then mknod /dev/fd0 b $MAJOR 0 fi if floppycontrol 2>/dev/null; then FLOPPYCONTROL=yes else FLOPPYCONTROL=no fi MINORNAMES='d360 h1200 D360 D720 h360 h720 H1440 E2880 CompaQ h1440 H1680 h410 H820 h1476 H1722 h420 H830 h1494 H1743 h880 D1040 D1120 h1600 H1760 H1920 E3200 E3520 E3840 H1840 D800 H1600' CMOSNAMES='360K_PC 1.2M_AT 720K 1.44M 2.88M_AMI_BIOS 2.88M' ## Used only with -t option CMOSLETTERS='d h D H E E' UCMOSLETTERS='d h u u u u' CMOSFORMATS='d h D DH DHE DHE' LOCAL= DRIVES= USAGE= TYPE_OVERRIDE=u REMAINDER= DRYRUN= VERBOSE= ## getword nth parameter of all the subsequent parameters getword () { if [ $# -lt 1 ]; then return fi if [ "$1" -lt 1 -o "$1" -ge $# ]; then return fi shift $1 echo $1 } basenumber() { if [ $1 -ge 4 ] ; then expr $1 + 124 else echo $1 fi } minorname () { if [ "$FLOPPYCONTROL" = no ]; then ## No floppycontrol program, so use default values getword "$1" $MINORNAMES else rm -f "$TMPDEVICE" mknod "$TMPDEVICE" b "$MAJOR" "$1" floppycontrol -T "$TMPDEVICE" 2>/dev/null || : rm -f "$TMPDEVICE" fi } cmosid () { if [ "$FLOPPYCONTROL" = yes ]; then case `minorname $1` in d360) echo 1 ;; h1200) echo 2 ;; D720) echo 3 ;; H1440) echo 4 ;; E2880) echo 6 ;; "(null)") echo none ;; "") echo none ;; *) echo unknown ;; esac elif [ "$1" = 0 ]; then echo 4 # 1.44MB default for drive 0 elif [ "$1" = 1 ]; then echo 2 # 1.2MB AT default for drive 1 else echo none # Nothing for everybody else fi } # main() PERMISSION=666 while [ $# -ge 1 -o -n "${REMAINDER}" ]; do if [ -n "$REMAINDER" ]; then ## Continue processing options stuck together ARG=$REMAINDER else ## Get a fresh argument ARG=$1 shift case "$ARG" in ## Remove dash in front of option(s) -?*) ARG=`expr "-$ARG" : '-*\(.*\)' || :` ;; esac fi ## Break compound options up case "$ARG" in ??*) REMAINDER=`expr "$ARG" : '.\(.*\)' || :` ARG=`expr "$ARG" : '\(.\)' || :` ;; *) REMAINDER= ;; esac case $ARG in ## Process drive number(s) [0-7]) DRIVES="$DRIVES $ARG" ;; [nN]) DRYRUN=yes ;; ## Make devices in current directory, not /dev [lL]) LOCAL=yes ;; ## Base device name on drive type [tT]) TYPE_OVERRIDE=yes ;; [dD]) TYPE_OVERRIDE=yes ;; ## Base device name on media type [mM]) TYPE_OVERRIDE=no ;; ## New naming scheme [uU]) TYPE_OVERRIDE=no ;; [vV]) VERBOSE=yes ;; ## Allow access only for group floppy [gG]) PERMISSION=660 ;; *) echo "$0: unrecognized argument \"$ARG\"." >&2 USAGE=yes ;; esac done if [ -n "$USAGE" ]; then echo "Usage: $0 [