Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!ralf From: ralf@b.gp.cs.cmu.edu (Ralf Brown) Newsgroups: comp.sys.ibm.pc Subject: Re: Magic Number Five in turbo C, MS C, and int 21/0E Keywords: drives, C programming Message-ID: <6477@pt.cs.cmu.edu> Date: 11 Oct 89 03:58:36 GMT References: <483@schaefer.MATH.WISC.EDU> Organization: Carnegie-Mellon University, CS/RI Lines: 23 In article <483@schaefer.MATH.WISC.EDU> wayne@schaefer.MATH.WISC.EDU (Rick Wayne) writes: }determine the number of disk drives on a machine at runtime. there's a DOS }interrupt service for this: interrupt 0x21, function 0x0E, "set default }disk drive". it's supposed to return the number of drives in the system. } }for all the machines we have here (AST Premium 386, Standard 286, Compaq }Deskpro, Dell 210), we get the answer of...five. needless to say, these }disparate machines have differing numbers of drives. the one number we }CANNOT come up with, of course, is five. The value you are seeing is the value of LASTDRIVE= in CONFIG.SYS, which defaults to 5 if not present. The value returned by INT 21/AH=0Eh is the maximum of actual drives in system (including virtual drives) value of LASTDRIVE 5 -- {backbone}!cs.cmu.edu!ralf ARPA: RALF@CS.CMU.EDU FIDO: Ralf Brown 1:129/46 BITnet: RALF%CS.CMU.EDU@CMUCCVMA AT&Tnet: (412)268-3053 (school) FAX: ask DISCLAIMER? |"Humor is laughing at what you haven't got when you ought to What's that?| have it." -- Langston Hughes