FDCONTROL(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’Ύ FDCONTROL(8) β€” the floppy driver whisperer, section 8 of the System Manager's Manual πŸŽ€

ok so bestie, buckle up, because we're talking about the System Manager's Manual today and this one is a whole vibe. It's called fdcontrol and it's your little remote control for how your floppy disk behaves at runtime. Yes, floppies. Yes, in this economy. Let's go. ✨


✨ NAME ✨

fdcontrol β€” display and modify floppy disk parameters πŸ¦‹


🌸 SYNOPSIS 🌸

fdcontrol [-F] [-d dbg] [-f fmt] [-s fmtstr] [-v] device

πŸ’€ DEPRECATION NOTICE πŸ’€

Real talk first, because this matters: fdcontrol is deprecated and may not be present in FreeBSD 16.0 and later. So enjoy it while it's here, bestie. 😭


πŸ‘‘ DESCRIPTION πŸ‘‘

The fdcontrol utility lets you modify the run-time behavior of the fdc(4) driver β€” but only for the device you name in device.

There are commands to query the current device density settings, to query the underlying device hardware as registered with the driver, to manipulate debugging levels, and to adjust the device density settings themselves. Important vibe check: every operation that messes with kernel settings is restricted to the superuser (enforced by the device driver itself), while all the inquiry requests only need read access to device. So you can peek as a normie, but you need the crown πŸ‘‘ to poke.

device should always be a full path name, e.g. /dev/fd0. Not a nickname, not an abbreviation. Full path. Periodt.


πŸ” Inquiry Commands πŸ”

If you run fdcontrol with none of the optional flags, it reports the drive type registered with the device driver. In its shortest form it just returns one single string describing the drive type β€” and the possible values are: β€œ360K”, β€œ1.2M”, β€œ720K”, β€œ1.44M”, β€œ2.88M”, or β€œunknown”. This form is primarily intended to be easily parsable by scripts, so it's giving "I was built for machines, not for you" πŸ€–.

Want some human-readable descriptive text instead? Add the -v flag and it gets chatty.

Add the -F flag and it reports the device's density settings in a form that's suitable as input to the -s fmtstr option (more on that below). And again, pair it with -v and you get extra text, including the total capacity of the density settings in kilobytes β€” such a flex. πŸ’…


πŸ› οΈ Debug Control πŸ› οΈ

So the fdc(4) control utilities support two different ways to specify device density settings. Pick your fighter:

Form one: use -f fmt to specify the format of the medium in kilobytes. Depending on the underlying drive type, the value gets compared against a table of known commonly used device density settings for that drive, and if a match is found, those settings get used. Currently, these are the acceptable values for each respective drive type πŸ‘‡

2.88M and 1.44M drives:

KB     sectrac   secsize   ncyls   speed   heads   flags
1721   21        2 (512)   82      500     2       MFM
1476   18        2 (512)   82      500     2       MFM
1440   18        2 (512)   80      500     2       MFM
1200   15        2 (512)   80      500     2       MFM
 820   10        2 (512)   82      250     2       MFM
 800   10        2 (512)   80      250     2       MFM
 720   9         2 (512)   80      250     2       MFM

1.2M drives:

KB     sectrac   secsize    ncyls   speed   heads   flags
1200   15        2 (512)    80      500     2       MFM
1232   8         3 (1024)   77      500     2       MFM
1476   18        2 (512)    82      500     2       MFM
1440   18        2 (512)    80      500     2       MFM
1200   15        2 (512)    80      500     2       MFM
 820   10        2 (512)    82      300     2       MFM
 800   10        2 (512)    80      300     2       MFM
 720   9         2 (512)    80      300     2       MFM
 360   9         2 (512)    40      300     2       MFM,2STEP
 640   8         2 (512)    80      300     2       MFM

720K drives:

KB    sectrac   secsize   ncyls   speed   heads   flags
720   9         2 (512)   80      250     2       MFM

360K drives:

KB    sectrac   secsize   ncyls   speed   heads   flags
360   9         2 (512)   40      250     2       MFM

Form two: specify a device density with -s fmtstr to spell out every parameter in detail. The fmtstr argument is a comma-separated list of values shaped like this:

sectrac,secsize,datalen,gap,ncyls,speed,heads,f_gap,f_inter,offs2,flags

Here's what each parameter actually means, no gatekeeping πŸ’–

  • sectrac β€” the number of sectors per track.
  • secsize β€” the sector size code. 0 = 128 bytes (or less), 1 = 256 bytes, 2 = 512 bytes, 3 = 1024 bytes.
  • datalen β€” the actual sector size if the size code is 0, or the (ignored) value 0xFF for larger size codes.
  • gap β€” the length of the gap 3 parameter for read/write operations.
  • ncyls β€” the number of cylinders.
  • speed β€” the transfer speed in kilobytes per second. Can be 250, 300, 500, or 1000, but each drive type only supports a subset of these values. Know your limits, bestie.
  • heads β€” the number of heads.
  • f_gap β€” the length of the gap 3 when formatting media.
  • f_inter β€” the sector interleave to be applied when formatting. 0 means no interleave, 1 means 1:1 etc.
  • offs2 β€” the offset of the sector numbers on side 2 (i.e., head number 1). Normally, sector numbering on both sides starts with 1.
  • flags β€” a list from one of these flag values:
    • +mfm β€” use MFM encoding.
    • -mfm β€” use FM (single-density) encoding.
    • +2step β€” use 2 steps per each cylinder (for accessing 40-cylinder media in 80-cylinder drives).
    • -2step β€” do not use 2 steps per cylinder, i.e., access each physical cylinder of the drive.
    • +perpend β€” use perpendicular recording (for 2.88 MB media, currently not supported).
    • -perpend β€” use longitudinal recording.

For any missing parameter, the current value will be used, so you only have to specify the actual changes. Which is so convenient of it. 🫢 But heads up: to turn off a flag bit (like +mfm, which is the default for all drive types), you must explicitly use the form with a leading minus sign. No silent unsetting, you have to say it out loud.


🌈 EXAMPLES 🌈

A simple inquiry about the drive type. She's short, she's sweet, she's parseable:

$ fdcontrol /dev/fd0
1.44M

Same as above, but with verbose output. Note that the result is about the drive type, as opposed to a device density, so it is independent from the actual subdevice being used for device:

$ fdcontrol -v /dev/fd0
/dev/fd0: 1.44M drive (3.5" high-density)

Inquiry about the density settings:

$ fdcontrol -F /dev/fd0
18,512,0xff,0x1b,80,500,2,0x6c,1,0,+mfm

The verbose flag makes this human readable πŸ’…:

/dev/fd0: 1440 KB media type
        Format:         18,512,0xff,0x1b,80,500,2,0x6c,1,0,+mfm
        Sector size:    512
        Sectors/track:  18
        Heads/cylinder: 2
        Cylinders/disk: 80
        Transfer rate:  500 kbps
        Sector gap:     27
        Format gap:     108
        Interleave:     1
        Side offset:    0
        Flags           <MFM>

As indicated, trailing commas in the parameter list may be omitted. Yes queen, leniency. πŸŽ€


In order to access archaic 160 KB single-density (FM encoded) 5.25 media in a modern 1.2M drive, something like the following definition would be needed. (Note that not all controller hardware is actually capable of handling FM encoding at all β€” so this is a maybe slay, depending on your hardware.)

# fdcontrol -s 16,128,0x80,0x2,40,300,,0x10,,,-mfm,+2step /dev/fd1.1

It is still possible to hook up 8" drives to most modern floppy controllers, given the right cable magic. (On PC hardware, tell the BIOS that it is a 5.25" drive.) The classical 128/26/2/77 format can be read with this entry:

fdcontrol -s  26,128,0x80,0x2,77,500,2,0x10,,,-mfm /dev/fd0

πŸ¦‹ SEE ALSO πŸ¦‹


⭐ HISTORY ⭐

The fdcontrol utility appeared in FreeBSD 2.0, and was vastly overhauled in FreeBSD 5.0. A glow-up for the ages, honestly. ✨


πŸ’œ AUTHORS πŸ’œ

The program and this man page was contributed by JΓΆrg Wunsch, Dresden. Iconic of him, fr fr. πŸ‘‘


ok that's the whole page, bestie β€” every flag, every table row, every byte of detail, all intact. no cap. 🫢

this page came from the Debian edition of the manual, dated November 16, 2025 β€” mwah, thanks for reading, ilysm, go format a floppy πŸ’–

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms