Subj : Re: How to detect RAM disks (Was: how to detect cdrom?) To : Matthias Paul From : Jasen Betts Date : Sun Feb 17 2002 06:19 am From: Jasen.Betts@p42.f531.n640.z3.cereal.mv.com (Jasen Betts) Subject: Re: How to detect RAM disks (Was: how to detect cdrom?) Hi Matthias. 13-Feb-02 17:48:12, Matthias Paul wrote to Brian.Iglesias@xspamp0.f321.n751.z6 MP> SET RAMDRIVE=:: MP> @CALL TDSK %1 MP> IF "::"=="%RAMDRIVE%" GOTO nochg MP> %RAMDRIVE% MP> :nochg what's in tdsk.bat ? what does %1 represent? MP> Difficult and unreliable. If you really want a generic solution, you'd MP> have to MP> check various properties of a drive before you can be almost sure its a MP> RAM MP> disk. Unfortunately there is no such thing as a "RAM disk flag" (it's on MP> my list MP> for a possible future DOS issue) the definition of ram disk is becoming a little blurred, is a memory stick (tm) a ram disk? MP> Typical signs of a RAM disk are that the drive has only 1 instead of MP> the usually 2 FATs, but this alone is not reliable enough, as you can MP> configure a RAM disk to have more than one FAT as well. Some tape MP> streamers (for example the HP-IB HP 9142), which - through a special MP> block device driver loaded in CONFIG.SYS - can be accessed just like MP> a normal disk drive, also represent themselves as having only one MP> FAT. MP> Being "virtual disks" as well, but at track seeking times of up to MP> several minutes, they are not particularly what I would call high MP> speed drives... ;- I've seen a ram disk that wasn't "vitrual" it represented itself as having tracks and sectors and responded to things like format. MP> The approach to use the disk label, as it is used by FINDRAMD, is fatally MP> MP> flawed, because you can easily change the disk label of any drive with MP> LABEL. it's ok in the early boot process, but yeah if you called your hard disk that it could cause problems. MP> The label plus its time/date stamp might be used as an additional test, MP> but anyway, this should not be used as main criteria that's a good idea MP> Much more reliable is the OEM label in the disks BIOS Parameter Block MP> (BPB) starting at offset +3 in the first sector, however, if you MP> mount disk images onto RAM disk this too is not completely reliable and again this varies between ramdisk vendors, and may not be available with some brands of ramdisk. MP> Still incomplete, but for those interested in writing a better FINDRAMD MP> replacement, here is a list of RAM disk labels I currently know of MP> "MS-RAMDRIVE" MS-DOS 3.30 RAMDRIVE.SYS 1.19 - MP> MS-DOS 6.22 RAMDRIVE.SYS 3.07; MP> MS-DOS 7.0 RAMDRIVE 3.0? - MP> MS-DOS 8.0 RAMDRIVE.SYS 3.06 MP> "RAMDRIVE " IBM PC DOS 6.1 RAMDRIVE.SYS 3.06 - MP> PC DOS 7 RAMDRIVE.SYS 3.10 MP> "RDV"* (apparently some MS programs search for this as well) MP> "VDISK"* (apparently some MS programs search for this as well) MP> "VDISK " DR-DOS 7.03 VDISK.SYS MP> "VDISK 1-2"* older DR DOS VDISK.SYS issues (there may also be other MP> version numbers) MP> with corresponding time/date stamps: MP> 00h,0C0h,0C9h,0Ah MS-DOS 3.30 - RAMDRIVE.SYS 1.19 MP> MS-DOS 4.01 - RAMDRIVE.SYS 2.13 MP> 165Bh "1991-02-27" MS-DOS 5.0 - RAMDRIVE.SYS 3.06 MP> 1519h "1990-08-25" Russian MS-DOS 5.0 - RAMDRIVE.SYS 3.06 MP> 18F5h "1992-07-21" MS-DOS 6.0, 6.20, Japanese 6.20, Hangul 6.20, 6.22, MP> PRC 6.22 - RAMDRIVE.SYS 3.07 MP> 1715h "1991-08-21" MS-DOS 7.10 (Windows 95/Memphis, 1996-09-05 11:11), MP> MS-DOS 7.10 (Windows 98, 1998-05-15 20:01), MP> MS-DOS 7.10 (Windows 98SE, 1999-05-05 22:22), MP> MS-DOS 8.0 (Windows ME, 2000-06-08 17:00) - MP> RAMDRIVE.SYS 3.06 MP> 1A4Fh "1993-02-15" PC DOS 6.1 RAMDRIVE.SYS 3.06 MP> 1CBEh "1994-05-30" PC DOS 7 RAMDRIVE.SYS 3.10 MP> And here is a list of OEM labels for some RAM disk drivers: MP> "RDV 1.17" MS-DOS 3.30 RAMDRIVE.SYS 1.19 MP> "RDV 1.20" MS-DOS 4.01 RAMDRIVE.SYS 2.13, MP> MS-DOS 6.22 RAMDRIVE.SYS 3.07, MP> MS-DOS 7.10 - 8.0 RAMDRIVE.SYS 3.06; MP> PC DOS 6.1 RAMDRIVE.SYS 3.06, MP> PC DOS 7 RAMDRIVE.SYS 3.10 MP> "DRI V1.1" DR DOS VDISK.SYS MP> "NOVELL " Novell DOS VDISK.SYS MP> "DRDOS " DR-DOS VDISK.SYS MP> "VDISK"* (Novell DOS 7 - DR-DOS 7.03 NWCACHE look for "VD"*) MP> "RAM"* (Novell DOS 7 - DR-DOS 7.03 NWCACHE look for "RA"*) MP> "NEWLDR"* DR-DOS 7.0x LOADER, CCI Multiuser DOS 7.22 Gold LOADER MP> "RxVDISK " Michael Podanoffsky's RxDOS VDISK MP> "BDSK 1.1" Ciriaco Garcia de Celis' BITDISK.EXE 1.10 MP> "BDSK1.22" BITDISK.EXE 1.22 MP> "BDSK1.24" BITDISK.EXE 1.24 MP> "TDSK 2.1" Ciriaco Garcia de Celis' TDSK.EXE 2.1 MP> "TDSK 2.2" Ciriaco Garcia de Celis' TDSK.EXE 2.2 MP> "TDSK 2.3" Ciriaco Garcia de Celis' TDSK.EXE 2.3 MP> "TDSK2.40" TDSK.EXE 2.40 BETA MP> "TDSK2.41" TDSK.EXE 2.41 BETA MP> "TDSK2.42" TDSK.EXE 2.42 BETA MP> "RDV 2.4" TDSK.EXE 2.43 BETA MP> "TF--V1.0" Tommy Frandsen's VGADISK.SYS 1.0 MP> If you know of additional disk labels, OEM IDs, and driver signatures MP> used by MP> other RAM disk drivers or versions, please let me know. I am compiling MP> all this MP> info for RBIL and FreeDOS MP> To make this on-topic, it seems, 4DOS currently lacks two useful Variable MP> MP> Functions like %@DISKOEM[d:]% = "12345678" and %@RAMDISK[d:]% = 0,1. also %@DiskSerial[d:] debug can be used to extract that information from the boot sector... Dos doesn't know it's a ramdisk... all it knows is that it's non-removable writable, and local. MP> And %@FILEDATE[]% refuses to return the date of a disk label, MP> unfortunately. That's partly because labels aren't files... (you're allowed to have a file with the same name as the disk label...) That info can be got from dos tools like chkdsk... but as with using debug above gettting that info into a variable automatically needs specific or implied temporary files and that makes it unsuitable for a read-only boot diskette. (hmm, for a boot disk maybe you could grab the info off the screen (using %@readscr) instead of using a pipe..., still those tools are a lot of dead-weight for a boot diskette) MP> PS. Apparently a good "FINDRAMD" replacement is still needed in MP> many places. Any volunteer to develop one for FreeDOS MP> (www.freedos.org)? It would certainly be useful. findramd.exe can easily be patched with a new target string... not really suitable for redistribution though. -=> Bye <=- -- |Fidonet: Jasen Betts 3:640/531.42 | | 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) .