The driver supports floppy disk formatting using the interfaces in
<sys/fdio.h>:
FDIOCGETFORMAT struct fdformat_parms
Fetch current formatting parameters. This gets the default parameters for the open device if no parameters have been set during the session.
FDIOCSETFORMAT struct fdformat_parms
Set formatting parameters. The driver saves this state and it persists while the device is open.
FDIOCFORMAT_TRACK struct fdformat_cmd
Format a track on the medium. If this call returns EINVAL, the track formatting parameters were out of range for the medium. If it returns EIO, there was a medium error while formatting the track.
FDIOCSETOPTS int
Set driver options which persist until the device is closed. The options should be the logical OR of the desired values below:
FDOPT_NORETRY
Do not retry operations on failure
FDOPT_SILENT
Do not print error messages to the console
FDIOCGETOPTS int
Fetch drive options.
A typical use of the formatting facilities would be to open the device, call
FDIOCGETFORMAT to fetch the current format parameters, perhaps change a parameter or two, display the formatting details to the user, and then call
FDIOCSETFORMAT followed by a series of calls to
FDIOCFORMAT_TRACK.