FORMAT(8) (native) FORMAT(8)
NAME
format - format floppy diskette
SYNOPSIS
disk/format [ -t type ] [ -f ] [ -d ] [ -b bfile ] [ -c
csize ] [ -l label ] drive [ files ... ]
DESCRIPTION
Format initialises the floppy diskette in the disk file
named drive, for example /dev/fd0disk. By default it for-
mats the diskette and copies in the given files. The options
are:
-f Do not physically format the disc. Used to install an
MS-DOS filesystem on a previously formatted disc. With
this option, drive can be a plain file.
-t specify a density and type of disk to be prepared. The
possible types are:
3½DD 3½" double density, 737280 bytes
3½HD 3½" high density, 1474560 bytes
5¼DD 5¼" double density, 368640 bytes
5¼HD 5¼" high density, 1146880 bytes
hard Hard disc, used in conjunction with -f to format
arbitrary sized plain files.
The default is the highest possible on the device,
unless -f is used, in which case the default is 3½HD.
-d add MS-DOS parameter block, file access table (FAT),
and root directory to the start of the floppy.
The remaining options have effect only when -d is specified:
-b use the contents of bfile as the bootstrap block
installed in sector 0.
-c use a DOS cluster size of csize sectors when creating
the DOS FAT.
-l add a label when creating the DOS parameter block.
Again under -d, any files listed are added, in order, to the
root directory of the MS-DOS filesystem. The files are con-
tiguously allocated and created with the READONLY attribute
Page 1 Plan 9 (printed 11/6/25)
FORMAT(8) (native) FORMAT(8)
set.
The file /os/boot/pc/bb is an example of a suitable bfile to
make the diskette a boot diskette. It gets loaded by the
BIOS at 0x7C00, reads the root directory into address
0x7E00, and looks at the first root directory entry. If
that file is called B.COM, it uses single sector reads to
load the file into address 0x10000 and then jumps to the
loaded file image.
EXAMPLE
Create a boot floppy on a previously formatted diskette:
disk/format -f -b bb -d /dev/fd0disk /os/boot/pc/b.com
Format an ftl(3) file system:
disk/format -fdt hard '#'X/ftldata
SOURCE
/appl/cmd/disk/format.b
/os/boot/pc/bb.s
SEE ALSO
floppy(3), b.com(8)
Page 2 Plan 9 (printed 11/6/25)