Microsoft KB Archive/69504

{|
 * width="100%"|

_bios_disk May Require 3 Tries Before Drive Up to Speed

 * }

Q69504

5.10 6.00 6.00a 6.00ax 7.00 | 1.00 MS-DOS | WINDOWS kbprg kbcode -- 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/C++ for MS-DOS, version 7.0 - Microsoft Visual C++ for Windows, version 1.0 -- SUMMARY ======= In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, C/C++ version 7.0, and Visual C++ version 1.0, the _bios_disk routine in the C run-time library uses BIOS interrupt 0x13 to provide several disk-access functions. The ROM BIOS does not automatically wait for the drive to come up to speed before attempting to read the sector, verify the sector, or write to the sector. In the book &quot;IBM ROM BIOS&quot; by Ray Duncan, the recommendation given in each case is to reset the floppy disk system and try the operation three times before assuming an error has occurred. MORE INFORMATION ================ The following sample program from the C 6.0 online help makes three attempts to read the disk before giving up. A printf statement is added to show which read attempt is successful. Sample Code --- /* * Compile options needed: none */ #include #include #include #include #include char _far diskbuf[512]; void main( int argc, char *argv[] ) { int count; unsigned status = 0, i; struct diskinfo_t di; struct diskfree_t df; unsigned char _far *p, linebuf[17]; if( argc != 5 ) { printf(&quot; SYNTAX: DISK