Date: Thu, 11 Nov 1999 07:58:46 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Ben Davis cc: djgpp AT delorie DOT com Subject: Re: Mixing BIOS and DOS disk functions In-Reply-To: <80cuqf$3k0$1@news5.svr.pol.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.