Go to the first, previous, next, last section, table of contents.
Syntax
#include <bios.h>
int biosdisk(int cmd, int drive, int head, int track,
int sector, int nsects, void *buffer);
Description
This function interfaces with the BIOS disk sevice (interrupt 0x13).
Please refer to a BIOS reference manual for detailed information about
the parameters of this call. All known calls are supported. A sector
size of 512 bytes is assumed.
- 0 - reset disk subsystem
-
- 1 - get disk subsystem status
-
- 2 - read one or more sectors
-
- 3 - write one or more sectors
-
- 5 - format a track
-
- 6 - format back track
-
- 7 - format drive
-
- 8 - get drive parameters
-
- 9 - initialize drive parameters
-
- 10 - read long sectors
-
- 11 - write long sectors
-
- 12 - seek to cylinder
-
- 13 - alternate fixed disk reset
-
- 14 - read test buffer
-
- 15 - write test buffer
-
- 16 - test for drive ready
-
- 17 - recalibrate drive
-
- 18 - controller RAM diagnostic
-
- 19 - controller drive diagnostic
-
- 20 - controller internal diagnostic
-
- 15 - read fixed disk type
-
- 22 - read disk change line status
-
- 23 - set DASD type (pass dasd in nsects)
-
- 24 - set media type for format
-
-
-
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. Since this buffer is
big enough to hold 18 sectors, requests for more sectors than that
will fail.
Request eight returns values in buffer as follows:
- byte 0 = sectors per track (bits 0..5) and top two bits of cylinder (in bits 6..7)
-
- byte 1 = cyliders (bits 0..7)
-
- byte 2 = number of drives
-
- byte 3 = number of heads
-
-
-
Return Value
The value of AH returned by the BIOS.
Portability
not ANSI, not POSIX
Example
char buffer[512];
if (biosdisk(2, 0x80, 0, 0, 0, 1, buffer))
error("disk");
Go to the first, previous, next, last section, table of contents.