Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!nbires!isis!dragheb From: dragheb@isis.UUCP (Darius "OPRDRT" Ragheb) Newsgroups: comp.sys.ibm.pc Subject: Re: number of DOS drives Message-ID: <1450@isis.UUCP> Date: Thu, 4-Dec-86 01:10:02 EST Article-I.D.: isis.1450 Posted: Thu Dec 4 01:10:02 1986 Date-Received: Fri, 5-Dec-86 00:49:32 EST References: <2268@sdcsvax.UCSD.EDU> <623@bucsb.bu.edu.UUCP> Reply-To: dragheb@isis.UUCP (Darius "OPRDRT" Ragheb) Organization: Math/CS, University of Denver Lines: 41 Summary: Got it this time....I think :-) In article <623@bucsb.bu.edu.UUCP> madd@bucsb.bu.edu.UUCP (Jim Frost) writes: >> >>In article <1441@isis.UUCP> dragheb@isis.UUCP (Darius "OPRDRT" Ragheb) writes: >>> >>>I think this might work (I have not tried it): >>>use function (_FUNCTION_, not interrupt) call Eh. It will do two things: >>>make the drive selected in DL the current drive, and >>>return the number of drives in AL. >>> >>If you had tried it, you would have found out it *doesn't* work :-) :-) I think we have it licked now! I wrote the following program and tested it on a PC with 1 drive and a PC with 2 drives and it returned the correct number of floppies: #include #include main () { int intnum; REGS *regsin, *regsout; intnum = 0x11; int86 (intnum, regsin, regsout); printf ("%d\n",(regsout->ax & 192) +1); } What it does is call INT 11h and check bits 6 and 7 in the ax register. (0 means 1 drive, etc). (BTW REGS is a struct of ints) -- UseNet: {hplabs, seismo}!hao!isis!dragheb