delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/09/25/07:46:50

Date: Wed, 25 Sep 1996 13:41:19 +0200 (MET DST)
From: Mark Habersack <grendel AT ananke DOT amu DOT edu DOT pl>
Reply-To: grendel AT ananke DOT amu DOT edu DOT pl
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: Chris Matrakidis <cmatraki AT eleceng DOT ucl DOT ac DOT uk>, djgpp-workers AT delorie DOT com
Subject: Re: `_flush_disk_cache'
In-Reply-To: <Pine.SUN.3.91.960924135705.11882B-100000@is>
Message-ID: <Pine.NEB.3.95.960925133250.19799F-100000@ananke.amu.edu.pl>
MIME-Version: 1.0

On Tue, 24 Sep 1996, Eli Zaretskii wrote:

>> I looked at smartdrv, ncache2 and superpck and found out that they all
[snip]
>Why should we assume that floppy drives aren't cached?  I know quite a 
>few people who use write-behind caching on A: and B: too.
I think INT 13h is better and only hardware platform dependent, it'll work on
any OS not only on DOS.

>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, 
>`_flush_disk_cache' does a questionable job here (although I wasn't able 
>to crash it even when I launched it from a CD-ROM drive).  How can I know 
>if e.g. drive F: belongs to the first physical drive (0x80 in BIOS 
>parlance) or to the second (0x81 for BIOS)?
>
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)
  Subsequent letters are assigned in the following manner:
    1) remaining primary partitions on 0x80 drive (in MBR order)
    2) primary partitions on 0x81 (if any)
    3) any disks defined in extended partitions of 0x81 (in order of
       definition)
    4) logical drives from 0x81

But there's a simpler way. You have to get a hold of head of DDT (Drive
Description Table) chain. In each DDT every drive is described in detail,
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).

---------------------------------------------------------------------------
You can't brush me under the carpet, you can't hide me under the stairs,
The custodian of your private fears, your leading actor of yesteryear,
Who as you crawled out of the alleys of obscurity, sentenced to rejection
 in the morass of anonymity. You who I directed with a lover's will, you
 who I let hypnotise the lens. You who I let bathe in the spotlights glare.
You who wiped me from your memory like a greasepaint mask, just like a
 greasepaint mask...
-------------------- http://ananke.amu.edu.pl/~grendel -------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019