Use 0x80 to Access Drive C when Calling _bios_disk()

ID: Q39311

5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a 6.00ax | 1.00

MS-DOS                      | OS/2                   | WINDOWS
kbprg

The information in this article applies to:

SUMMARY

The first floppy drive in a computer is identified as drive 0, with additional floppy drives numbered sequentially. However, the first fixed disk is identified as drive 0x80 (128 decimal) with additional partitions numbered sequentially. Therefore, call _bios_disk() with the drive parameter set to 0x80 to access the first fixed disk. Note that the BIOS accesses physical disks, and is not aware of the logical MS-DOS disk partitions. If you have logical drives C and D, they would both be accessed by the _bios_disk() function as drive 0x80.

The following is an example:

   Physical Drive   diskinfo.drive
   --------------   --------------

         A                 0
         B                 1
         C                0x80
         D                0x81
         E                0x82
         .                 .
         .                 .
         .                 .

MORE INFORMATION

The _bios_disk() function calls BIOS interrupt 13h. For more information on this interrupt Peter Norton's "Programmer's Guide to the IBM PC and PS/2" (Microsoft Press), Chapter 10, is a good reference. The reason the fixed disks start at 0x80h is that a 1 in the high order bit of the drive designator byte indicates a fixed disk.

Additional reference words: kbinf 5.10 6.00 6.00a 6.00ax 7.00 1.00 KBCategory: kbprg KBSubcategory: CRTIss Keywords : kb16bitonly

Last Reviewed: July 18, 1997