 This package contains utilities which take advantage of the new floppy
driver introduced in linux 1.1.41.

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

 Since 1.1.41, linux allows you to use formats with more than the
usual 18 (or 15) sectors per track, with more than 80 tracks (only for
drives which support this), and with bigger sectors.

I. New features:
================
 1. Every user with write-permission to the device may now change its
geometry (instead of just the superuser). The superuser may still
specify a maximal number of tracks allowed on a given drive, which can
not be overriden by "normal" users. I added some sanity checks for the
geometry parameters. (Number of sectors, heads and tracks must be
strictly positive.) This patch comes with a new mtools program which
uses this feature to set the geometry according to the geometry found
on the msdos bootsector...
 2. ... thus it is no longer necessary to autodetect formats with
more than the standard number of sectors. Autodetection of these
formats has now become option (option in make config)
 3. The autodetection sequence is now configurable via an ioctl.
 4. Arbitrary logical blocksizes (interface to fs code) can now be
handled. It should for instance be possible to use the floppy drive as
(slow) swap device.
 5. Physical sector sizes of 1024, 2048, 4096, 8192 and 16384 bytes
can now be handled (this gives us the 1826K HD and 3520 ED formats)
 6. Several sector sizes may be mixed on one track. (This gives us the
1992K HD and 3840 ED formats)
 7. Requests are now clustered. This is needed if you use a sector
size which is bigger than the logical blocksize. It doesn't speed up
operations on normal disks however :-(
 8. There is now support for two controllers (untested). If you want to try
this out, define HAVE_2_CONTROLLERS at the beginning of floppy.c
 9. Access to internal driver structures, and drive configuration
using the floppycontrol program.

New ioctls: 
===========

 All these ioctl's may be issued using the floppycontrol program. (See also
floppycontrols man page)

 1. 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.
 2. FDSETDRVPRM sets various drive parameters.
 3. FDGETDRVPRM reads these parameters back.
 4. FDGETDRVSTAT gets the cached drive state (disk changed, write
protected et al.)
 5. FDPOLLDRVSTAT polls the drive and return its state.
 6. FDGETFDSTAT gets the floppy controller state.
 7. FDRESET resets the floppy controller under certain conditions.
 8. FDRAWCMD sends a raw command to the floppy controller.

 Floppypatches 2 already introduced some new ioctls. These are still
available, but their use is discouraged (read they might disappear in
the next version), as the parameters they get/set are included in the
drive state.
 I didn't get around to writing the documentation to these calls yet,
but a lot can be figured out from floppycontrol's man page.

 The new 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 the mtools coming with this package to set the number of
tracks according to the boot sector of the disk. (This doesn't
obviously work with disks containing something else than a MSDOS
filesystem)

 After recompiling your kernel and rebooting, you can use a few more
minor device numbers for disks with the new formats.  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 (fixed)
                  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"  ED drive (obsolete since pl30)

                 10        1440kB, 5.25" HD drive
                 11        1680kB, 3.5"  HD drive
                 12        410kB,  5.25" DD disk in HD drive (fixed)
                 13        820kB,  3.5"  DD drive (fixed)
                 14        1476kB, 5.25" HD drive
                 15        1722kB, 3.5"  HD drive
                 16        420kB,  5.25" DD disk in HD drive (fixed)
                 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

 The formats 0..8 existed before pl23, 9 is apparently needed for
certain CompaQ computers. All other formats have been added in 1.1.41.
 10..19 are formats with normal sized sectors (taken from Heiko
Schroeder's fdpatches. Some of these had wrong parameters initially,
and have been corrected), and 20..29 are formats with bigger sectors,
added by David Niemi and me (Alain Knaff). Formats 26-28 are ED
formats with bigger sectors.  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.
 BEWARE OF FORMATS 13-19 IF YOUR DRIVE ONLY SUPPORTS 80 TRACKS.

 Formats 3, 12, 13, 17 and 18 were buggy in Heiko's fdpatches.
 3 used stretch=1 double sided instead of stretch=0 single sided (there were
never 40-track 3.5" drives. Thus stretch != 0 doesn't make sense for a
3.5" disk)

 12 and 16 used a transfer rate of 250Kb/s and stretch=1 in Heiko's patches.
Now they use 300Kb/s as it should be.

 13 and 17 used a transfer rate of 300Kb/s in Heiko's patches. Now they use
250KB/s as it should be. However, the old formats worked on 5.25 disks, and
some people might use them for this purpose. If that is your case, just
change their rate field back to 1. (Using setfdprm, or by editing the 
floppy_type structure)

 Formats 8 and 9 were buggy in Heiko's patches too, and since pl23 they are
used for the ED drives.

 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.


I hope this description helps using the new features.

 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 <drive>)
 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 --track 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=<mask>,allowed_drive_mask         
	Sets the bitmask of allowed drives to <mask>. By default, only units
	0 and 1 of each floppy controller are allowed. This is done because
	certain non-standard hardware (ASUS PCI motherboards) mess up the
	keyboard when accessing units 2 or 3. This option is somewhat
	obsoleted by the cmos option.

 floppy=all_drives
	Sets the bitmask of allowed drives to all drives. Use this if you have
	more than two drives connected to a floppy controller.

 floppy=asus_pci
	Sets the bitmask to allow only units 0 and 1. (The default)

 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=<address>,two_fdc
	Tells the floppy driver that you have two floppy controllers. The
	second floppy controller is assumed to be at <address>. If <address>
	is not given, 0x370 is assumed.

 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=<drive>,<type>,cmos
	Sets the cmos type of <drive> to <type>. 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.)


 Included utilities:
 ===================

 1. mtools. This version of mtools configures the geometry according
to the on found in the boot sector. It also supports formats with bug
sectors, and 2m formats.
 This version of mtools reads the bootsector of msdos disks and
automatically sets the geometry according to the one found in the
bootsector. It is based on mtools-2.0.7.
 I added some other new features to it, see mtools/Release.Notes
for details.
 You can use this new mtools with older kernels (in that case, it
doesn't adjust the geometry and can't handle the formats with bigger
sectors, but you still will get the other features.)
 The file mtools/Configure contains more information about mtools.

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

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

 4. Setfdprm. This program is used to set the media parameters for a drive.
See manpage (in the utils directory)

 5. 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.
Superformat is not made by default. Type 'make superformat' to make it.

 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
ftp.imag.fr:pub/ZLIBC/fdutils/ALPHA. In the same directory, you can
find alpha versions of fdutils too. (They are named fduddmm.taz, where
dd stands for the day and mm for the month. I'll only leave these in
for a month, and then move them into an old directory, or remove
them.)
