LKM - Block Device Drivers
Welcome to the tutorial guide. The guide will provide a user with advise and guidance about blocked device drivers.
floppy: floppy disk driver
This is the device driver for floppy disks. A user will need this in order to access a floppy disk in any way.nn. This LKM is documented in the file README.fd in the linux/drivers/block directory of the Linux source tree. For detailed up to date information refer directly to this file. Please note that if a user boots from a floppy disk or with a root filesystem on a floppy disk, then he/she must have the floppy disk driver bound into the base kernel, because the system will need it before it has a chance to insert the LKM.
For example:
modprobe floppy ‘floppy=”daring two_fdc 0,thinkpad 0×8,fifo_depth”‘
Please note that there is only one LKM parameter: floppy, but it contains many subparameters. The reason for this unusual parameter format is to be consistent with the way a user would specify the same things in the kernel boot parameters if the driver were bound into the base kernel.
The value of floppy is a sequence of blank-delimited words. Each of those words is one of the following sequences of comma-delimited words:
asus_pci
Sets the bit mask of allowed drives to allow only units 0 and 1. Obsolete, as this is the default setting anyways
daring
Tells the floppy driver that a user has a well behaved floppy controller. This allows more efficient and smoother operation, but may fail on certain controllers. This may speed up certain operations.
0,daring
Tells the floppy driver that the floppy controller should be used with caution.
one_fdc
Tells the floppy driver that the user has only floppy controller (default).
address,two_fdc
Tells the floppy driver that a user has two floppy controllers. The second floppy controller is assumed to be at address. This option is not needed if the second controller is at address 0×370, and if the user uses the cmos option
two_fdc
Like above, but with default address
thinkpad
Tells the floppy driver that a user has an IBM Thinkpad model notebook computer. Thinkpads use an inverted convention for the disk change line.
0,thinkpad
Tells the floppy driver that a user doesn’t have a Thinkpad.
nodma
Tells the floppy driver not to use DMA for data transfers. This is needed on HP Omnibooks, which don’t have a workable DMA channel for the floppy driver. This option is also useful if a user frequently gets “Unable to allocate DMA memory” messages. Indeed, DMA memory needs to be continuous in physical memory, and is thus harder to find, whereas non-DMA buffers may be allocated in virtual memory. A user will also need at least a 486 to use nodma. If a user uses nodma mode, it is recommended that a user also sets the FIFO threshold to 10 or lower, in order to limit the number of data transfer interrupts.
If a user has a FIFO-able FDC, the floppy driver automatically falls back on non DMA mode if it can’t find any DMA-able memory. If a user wants to avoid this, explicitly specify “yesdma”.
omnibook
Same as nodma.
yesdma
Tells the floppy driver that a workable DMA channel is available (the default).
nofifo
Disables the FIFO entirely. This is needed if a user gets “Bus master arbitration error” messages from a users Ethernet card (or from other devices) while accessing the floppy.
fifo
Enables the FIFO (default)
threshold,fifo_depth
Sets the FIFO threshold. This is mostly relevant in DMA mode. If this is higher, the floppy driver tolerates more interrupt latency, but it triggers more interrupts (i.e. it imposes more load on the rest of the system). If this is lower, the interrupt latency should be lower too (faster processor). The benefit of a lower threshold is fewer interrupts.
To tune the fifo threshold, switch on over/underrun messages using ‘floppycontrol –messages’. Then access a floppy disk. If a user gets a huge amount of “Over/Underrun - retrying” messages, then the fifo threshold is too low. A user can try with a higher value, until he/she only get an occasional Over/Underrun.
The value must be between 0 and 0xf, inclusive.
As a user inserts and removes the LKM to try different values, remember to redo the ‘floppycontrol –messages’ every time he/she inserts the LKM. A user shouldn’t normally have to tune the fifo, because the default (0xa) is reasonable.
drive,type,cmos
Sets the CMOS type of drive to type. This is mandatory if a user has more than two floppy drives or if he/she uses BIOS non-standard CMOS types. The CMOS types are:
0
Use the value of the physical CMOS
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
16
unknown or not installed
unexpected_interrupts
Print a warning message when an unexpected interrupt is received. (default behavior)
no_unexpected_interrupts
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.)
L40SX
Same as no_unexpected_interrupts.
broken_dcl
Don’t use the disk change line, but assume that the disk was changed whenever the device node is reopened. Needed on some boxes where the disk change line is broken or unsupported. This should be regarded as a stopgap measure, indeed it makes floppy operation less efficient due to unneeded cache flushings, and slightly more unreliable. A user can verify his/her cable, connection and jumper settings if a user have any DCL problems. However, some older drives, and also some laptops are known not to have a DCL.
debug
Print debugging messages
messages
Print informational messages for some operations (disk change notifications, warnings about over and underruns, and about autodetection)
silent_dcl_clear
Uses a less noisy way to clear the disk change line (which doesn’t involve seeks). Implied by daring.
nr,irq
Tells the driver to expect interrupts on IRQ nr instead of the conventional IRQ 6.
nr,dma
Tells the driver to use DMA channel nr instead of the conventional DMA channel 2.
slow
Use PS/2 stepping rate: PS/2 floppies have much slower step rates than regular floppies. It’s been recommended that take about 1/4 of the default speed in some more extreme cases.
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.
all_drives
Sets the bitmask of allowed drives to all drives. Use this if a user have more than two drives connected to a floppy controller.
If you followed advise and guidance as provided in this tutorial guide then you would have learnt about blocked device drivers.













