Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site voder.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!nsc!voder!gbs
From: gbs@voder.UUCP (George Smith)
Newsgroups: net.micro.pc
Subject: Re: How does a program detect disks on a PC?
Message-ID: <868@voder.UUCP>
Date: Thu, 26-Sep-85 13:52:43 EDT
Article-I.D.: voder.868
Posted: Thu Sep 26 13:52:43 1985
Date-Received: Mon, 30-Sep-85 01:46:13 EDT
References: <1054@phs.UUCP> <473@ecsvax.UUCP>
Distribution: net
Organization: National Semiconductor, Santa Clara
Lines: 36

> 
> It appears to me, from reading the documentation, that the correct way
> to determine how many disks DOS thinks there are is through the DOS
> function call Select Disk (0E hex).
> Unfortunately, the number DOS is returning seems to bear little
> relationship to the number of disk devices DOS currently knows about.
> Running DOS 3.10 on an IBM-PC/XT I get 5 drives. This doesn't change
> whether or not I have my ramdisk device driver installed.
> 
> -Bennett

The IBM DOS Technical Reference Manual for DOS 2.1 might lead you to
believe that the Select Disk Function (0EH) will supply you with the
information you want.  However, the Microsoft MS-DOS Programmers
Reference Manual includes the following large notice on the page
describing function 0EH:

	+----------------------------------------------------------+
	|                                                          |
	|                         NOTICE                           |
	|                                                          |
	| For future compatibility, treat the value returned in    |
	| AL with care.  For example, if AL returns 5, it is not   |
	| safe to assume drives A, B, C, D, and E are all valid    |
	| drive designators.                                       |
	|                                                          |
	+----------------------------------------------------------+

If anyone knows how to find out the number of drives currently
available to running software, please post this information to the
net.

-- 
George B. Smith
National Semiconductor
...!{ihnp4!nsc | decvax!decwrl!nsc | ucbvax}!voder!gbs