Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!dogie.macc.wisc.edu!schaefer!wayne From: wayne@schaefer.MATH.WISC.EDU (Rick Wayne) Newsgroups: comp.sys.ibm.pc Subject: Magic Number Five in turbo C, MS C, and int 21/0E Keywords: drives, C programming Message-ID: <483@schaefer.MATH.WISC.EDU> Date: 10 Oct 89 16:03:15 GMT Organization: Mathematics Department, University of Wisconsin - Madison Lines: 29 we've run into a little problem here that i find baffling. we're trying to 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. well, ok, i can't read, maybe a misprint, i'm reading the register wrong, who knows. i'll try using the setdisk() function in turbo C, which is supposed to return the right value. Five. Microsoft C? Five. hmm. a sort of subtle pattern emerges. have we discovered a secret numerological cabal here? (i have been approached in parking lots by religious nuts convinced that the number 666 was being seeded millions of times in the nation's computers to assist a Satanic takeover). i am a little frustrated, to say the least. many of our machines are using a special disk device driver to allow partitions >32 MB, but not all of them. any ideas, troops? rick wayne WISPLAN (UW Extension)