Xref: news2.mv.net comp.os.msdos.djgpp:1019 Newsgroups: comp.os.msdos.djgpp From: kaikow AT standards DOT com Subject: bios Originator: kaikow AT mv DOT mv DOT com Message-ID: Sender: kaikow AT standards DOT com Reply-To: kaikow AT standards DOT com Organization: MV Communications, Inc. Date: Mon, 12 Feb 1996 17:06:52 GMT Followup-To: kaikow AT standards DOT com Lines: 47 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Where are the valid values for the device numbers documented? I thought that the device numbers were just 0, 1, 2, ... The following program works for devices A and B, but not for C. /* READDISK.C: This program reads a disk sector. */ #include #include #include int main (int argc, char **argv) { unsigned char buffer [2352]; unsigned status = 0; int i, drive; drive = (int) toupper (argv[1] [0]) - (int) 'A'; struct _diskinfo_t disk_info; disk_info.drive =0; disk_info.head =0; disk_info.track =0; disk_info.sector =1; disk_info.nsectors =1; disk_info.buffer =&buffer [0]; disk_info.drive = drive; printf("%d\n", drive); status = _bios_disk(_DISK_RESET, &disk_info); if (status & 0xff00) printf("DISK RESET Error: 0x%.4x\n", status); printf("Insert disk into drive %c: and press any key\n", drive + 'A'); getchar(); status = _bios_disk(_DISK_READ, &disk_info); if (status & 0xff00) printf("DISK READ Error: 0x%.4x\n", status); for (i = 0; i < 62; i++) { if (i % 32 == 0) printf("\n%d\t",i); printf("%02X", buffer [i]); } }