Mail Archives: djgpp/1999/11/11/03:04:49
On Wed, 10 Nov 1999, Ben Davis wrote:
> If I run the installation program off the hard disk, making sure the floppy
> disk is in the drive before it needs it, it does the following every time:
> 1. It calls biosdisk() to find out if the right disk is in (supposedly).
> 2. It doesn't detect the disk, and it asks for Disk 1.
> 3. Next time it calls biosdisk(), it detects the disk properly and
> continues.
>
> It is then that the rest of the disk is read using DOS functions.
BIOS is tricky, and it seems that your code that calls biosdisk is not
patient enough. The first call to biosdisk after a floppy was changed in
the drive usually fails with a special error code (I think it's 6, but
I'm not sure), to signal a disk change. You need to retry the call
again, sometimes several times (due to motor start time) until it
succeeds.
If you want a working example of such code, look at the source of the
library function `getmntent' (it's in djlsr202.zip, file name
src/libc/compat/mntent/mntent.c). It uses BIOS and DOS functions
together and it always works.
- Raw text -