Subj : Re: How to detect RAM disks (Was: how to detect cdrom?) To : Charles Dye From : Matthias Paul Date : Thu Feb 14 2002 08:28 pm From: Matthias.Paul@f3.n342.z1.cereal.mv.com (Matthias Paul) Subject: Re: How to detect RAM disks (Was: how to detect cdrom?) From: "Matthias Paul" On 2002-02-13, Charles Dye wrote: >> Yes, but as Steve Fabian and others explained, FINDRAMD searches for >> the "MS-RAMDRIVE" label and thus does not work with other RAM disks, >> not even with the RAMDRIVE.SYS from PC DOS. > > It does work correctly with XMSDSK, which uses the same volume label > by default. I wasn't aware of this. Thanks. > I think an adequate approach for most RAMdisks would be to > verify that (1) the drive is readable by INT 25h (hence FAT12 or > FAT16), (2) has only one FAT, and (3) has a media byte of F8. Well, most drives are readable through INT 25h, but you would at least cut off redirector/network drives for sure... Another attempt might be to hook INT 13h first, and then read a sector via INT 25h. If it does not touch the disk (INT 13h), you know the drive must be provided by a block device driver, and many block device drivers are RAM disks, but not all... Also, I know at least one very special virtual disk driver, which works down at INT 13h level. However, it's an invasive detection method, and therefore should be avoided if we'd knew a better method... RAMDRIVE.SYS in fact uses F8h as a media byte, but DR DOS' VDISK.SYS uses FEh to emulate a single sided 8 sectors/track disk, with 128 byte sector size (160 Kb). TDSK and BITDISK used to use FAh like Tandy DOS, but I have changed this to F8h meanwhile. It's really hairy... Greetings, Matthias -- ; http://www.uni-bonn.de/~uzs180/mpdokeng.html; http://mpaul.drdos.org -- |Fidonet: Matthias Paul 1:342/3 | | Origin: The Cereal Port BBS (603)899-3335 199.125.78.133 (1:132/152) --- # Origin: (1:132/152.4) * Origin: Baddog BBS (1:218/903) .