@node biosdisk, bios @subheading Syntax @example #include int biosdisk(int cmd, int drive, int head, int track, int sector, int nsects, void *buffer); @end example @subheading Description This function interfaces with the BIOS disk service (interrupt 0x13). Please refer to a BIOS reference manual for detailed information about the parameters of this call. The function assumes a sector size of 512 bytes. The following functions of Int 13h are currently supported: @table @asis @item 0 - reset disk subsystem @item 1 - get status of last operation (see @ref{_bios_disk}, for possible values) @item 2 - read one or more sectors @item 3 - write one or more sectors @item 5 - format a track @item 6 - format a cylinder and set bad sector flag @item 7 - format drive from specified cylinder @item 8 - get drive parameters @item 9 - initialize drive parameters @item 10 - read long sectors @item 11 - write long sectors @item 12 - seek to cylinder @item 13 - alternate fixed disk reset @item 14 - read sector buffer @item 15 - write sector buffer @item 16 - test for drive ready @item 17 - recalibrate drive @item 18 - controller RAM diagnostic @item 19 - controller drive diagnostic @item 20 - controller internal diagnostic @item 21 - get DASD type @item 22 - read disk change line status @item 23 - set DASD type (pass DASD code in @var{nsects}) @item 24 - set media type for format @end table The first request with more sectors than will fit in the transfer buffer will cause a DOS buffer to be allocated. This buffer is automatically freed when your application exits. Requests for more sectors than 18 sectors (9K) will fail. Function 8 returns values in @var{buffer} as follows: @table @asis @item byte 0 = sectors per track (bits 0..5), top two bits of cylinder (in bits 6..7) @item byte 1 = cylinders (bits 0..7) @item byte 2 = number of drives @item byte 3 = number of heads @end table @subheading Return Value The value of AH returned by the BIOS. See @ref{_bios_disk}, for a detailed list of possible status and error codes. @subheading Portability @portability !ansi, !posix @subheading Example @example char buffer[512]; if (biosdisk(2, 0x80, 0, 0, 0, 1, buffer)) error("disk"); @end example