Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!ginosko!uunet!portal!cup.portal.com!src From: src@cup.portal.com (Steve R Calwas) Newsgroups: comp.sys.ibm.pc Subject: Re: Magic Number Five in turbo C, MS C, and int 21/0E Message-ID: <22974@cup.portal.com> Date: 11 Oct 89 18:01:13 GMT References: <483@schaefer.MATH.WISC.EDU> Organization: The Portal System (TM) Lines: 27 In article <483@schaefer.MATH.WISC.EDU> wayne@schaefer.MATH.WISC.EDU (Rick Wayn e) 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. RALF@CS.CMU.EDU (Ralf Brown) responds: >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 I would like to add that the problem finding the actual number of drives on a system began with DOS 3.xx. Also, one method to determine how many drives really exist is to take the returned value from the INT 21h/AH=0Eh function (i.e. the 5 you keep getting) and try to get the current directory for each drive. If the drive does not exist, an error will result. Steve Calwas src@cup.portal.com Santa Clara, CA ...!sun!cup.portal.com!src