MS-DOS provides input-and-output-control (IOCTL) functions to read from, write to, and format sectors on drives. The IOCTL functions, like the Absolute Disk Read and Write functions, can access one or more sectors at a time. Unlike the Absolute Disk Read and Write functions, however, the IOCTL functions can read and write hidden sectors, such as those containing partition tables and other file-system data structures.
A program can read and write sectors on a drive by using Read Track on Logical Drive (Interrupt 21h Function 440Dh Minor Code 61h) and Write Track on Logical Drive (Interrupt 21h Function 440Dh Minor Code 41h). These functions require the program to specify the cylinder number, head number, and starting-sector number of the sectors to read or write.
The numbers of cylinders, heads, and sectors are properties of the medium and are specified in its device parameters. For example, the dpHeads field in a logical drive's DEVICEPARAMS structure returned by the Get Device Parameters function specifies the number of heads for the drive. For a full description of the DEVICEPARAMS structure, see Section 3.9, “Structures.”