🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5155

Re: Help: Finding legal drives on system

#5155
From: Richard Hancock
Date: Tue, 12 Mar 1991 13:13
37 lines
1647 bytes
/ hpopd:comp.os.msdos.programmer / jnelson@plains.NoDak.edu (Jim Nelson) /  1:47 am  Mar 11, 1991 /
In article <3815@ac.dal.ca> merrett@ac.dal.ca writes:
>>Is there any way of checking for 'legal' drives on a particular system, in
>>C, without actually having to read from the drive?  (i.e. I don't want it
>>plopping that 'insert floppy' message in the middle of my pretty windows)

>About the only way to do it is to check the biosequip word for number of
>floppies.  I don't know it's memory address at the moment, but TC has a
>function to find it for you, then you do a little bit manipulation to do the
>rest.

I can't remeber if the int21h, function 0eh prompts with an "insert floppy"
message if you try to select a floppy drive as the current drive. If it does
you could trap int24h and instruct DOS to fail the system call.

Something along the lines of :-

	unsigned int DriveID;

        // trap int24h

	for ( DriveID = 0; DriveID < 26; DriveID++; )
	{
	    // set ah = 0eh ; select disk 
	    // set dl = DriveID
	    // int21h

	    // set ah = 19h ; determine currect disk
	    // int21h

	    // if al == DriveID then DriveID is valid
	
	}

	// restore original int24h

Richard@tvs
Technical Details
Message-ID: <37390004@hpopd.pwd.hp.com>
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!hplabs!otter.hpl.hp.com!hpopd!richardh
References: <8795@plains.NoDak.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!hplabs!otter.hpl.hp.com!hpopd!richardh
From: richardh@hpopd.pwd.hp.com (Richard Hancock)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Help: Finding legal drives on system
Message-ID: <37390004@hpopd.pwd.hp.com>
Date: 12 Mar 91 13:13:17 GMT
References: <8795@plains.NoDak.edu>
Organization: The Vicuna Sanctuary
Lines: 37