www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/11/08:19:58

Newsgroups: comp.os.msdos.djgpp
From: Peter Berdeklis <peter AT atmosp DOT physics DOT utoronto DOT ca>
Subject: Re: Detecting connected disk drives
Message-ID: <Pine.SGI.3.91.970110103721.506A-100000@chinook.physics.utoronto.ca>
Nntp-Posting-Host: chinook.physics.utoronto.ca
Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator)
Mime-Version: 1.0
Organization: University of Toronto - Dept. of Physics
In-Reply-To: <VxLWbFAJI$0yEwhL@talula.demon.co.uk>
Date: Fri, 10 Jan 1997 15:48:41 GMT
References: <VxLWbFAJI$0yEwhL AT talula DOT demon DOT co DOT uk>
Lines: 27
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Wed, 8 Jan 1997, Shawn Hargreaves wrote:

> I have recently discovered a problem with the file selector routines in
> Allegro, which is caused by selecting disk B: on a machine with only one
> floppy drive. DOS displays the "please insert disk B into drive A"
> message, which results in a lockup because the Allegro keyboard handler
> prevents the continue keypress getting through to DOS.
> 
> I've racked my brains but can't think of any way round this - please
> someone tell me there is an easy solution :-) I need to either disable
> the message, or detect whether disk B really exists, but I have no idea
> how to do either. Any ideas?

How about _bios_equiplist(), or bios_equip() (aliases for the same
function I think).  Bits 6-7 of the return code tell how many floppy disk
drives are installed, 00 = 1, 01 = 2, etc.  If only one disk drive is
installed it must be drive A:.  I have no idea how easily fooled the bios 
is, but I think it's probably a good bet.

If you need to make certain that there is a disk in drive B:, try
getmntent().  Successive calls scan drive A:, then B:, then C:, etc.  If 
there is no disk in the drive, ex. drive B:, then the drive is skipped.

---------------
Peter Berdeklis
Dept. of Physics, Univ. of Toronto

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019