Date: Wed, 25 Sep 1996 15:09:11 +0200 (IST) From: Eli Zaretskii To: Mark Habersack Cc: Chris Matrakidis , djgpp-workers AT delorie DOT com Subject: Re: `_flush_disk_cache' In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 25 Sep 1996, Mark Habersack wrote: > >Btw, if anybody knows a simple enough way to map DOS drive letters to > >BIOS drive numbers, I'd like to know about it. Right now, > > > AFAIK, the DOS scheme to assign drive letters is as follows: > Letter 'C' is ALWAYS assigned to first primary partition on the first > physical HD (0x80) My problem is the opposite: given a DOS drive letter like "F:" find the BIOS drive number (0x80 or 0x81) which corresponds to it. Walking all of the partitions is (IMHO) too complicated. > But there's a simpler way. You have to get a hold of head of DDT (Drive > Description Table) chain. I don't want to walk the device driver chain either, since this is inherently DOS version-dependent, and probably won't work on DR-DOS, Windows 3.11 with 32-bit File Access, and the rest of compatible systems. I thought about something like getting the DPB (device parameter block) and using it and/or the corresponding BPB (BIOS parameter block) to get the info I need. Is there any way like that? > including physical drive it is on. If you want I can send you code that > identifies disks on the system (local, network, RAM, CD-ROMs) and takes > advantage of DDTs. All the necessary info can be found in Ralph Browns's > Interrupt List (I've used v51). This code is already part of DJGPP. Look at the source of `getmntent' function, it reports the type of every drive. But it loops through all the drives (which is slow) and it still doesn't tell me what BIOS drive number is disk F: on. Anyway, thanks for the info.