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

Last reviewed: July 17, 1997
Article 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:

  • The C Run-time (CRT), included with:

        - Microsoft C for MS-DOS, versions 5.1, 6.0, 6.0a, and 6.0ax
        - Microsoft C for OS/2, versions 5.1, 6.0, and 6.0a
        - Microsoft C/C++ for MS-DOS, version 7.0
        - Microsoft Visual C++ for Windows, version 1.0
    

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.