Path: utzoo!censor!geac!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: How do you make a RAMDISK? Message-ID: <258B2E0D.13306@maccs.dcss.mcmaster.ca> Date: 17 Dec 89 06:11:25 GMT References: <18100@netnews.upenn.edu> <3610@jarthur.Claremont.EDU> <2301@leah.Albany.Edu> Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Distribution: usa Organization: McMaster University, Hamilton, Ontario Lines: 68 In article <2301@leah.Albany.Edu> ppd491@leah.Albany.Edu (Peter P. Donohue) writes: $ What drive letter would you use to call on it? It will be automatically assigned the next drive letter above whatever you have in your system. If you have one floppy and a signle hard disk partition, it will be D:. If you have two floppies and a hard disk partitioned into five drives, you'll get H:. $ What is the advantage to having more or less bytes in each sector? If the ramdisk driver in question uses clusters of one sector, the sector size can be altered to reduce wasted space on the disk, or to speed up access. If you are using very small files (like a whole load of five-line batch files or something similar), you would perhaps want to decrease the sector size so that less disk space is wasted. DOS allocates space one cluster at a time, where a cluster is some power of 2 sectors (1, 2, and 4 are probably the only sizes a ramdisk would use). If your file is sub- stantially shorter than one cluster, tough luck ... a whole cluster gets allocated for it. If, on the other hand, your files are typically of a pretty good size and you need every last ounce of speed, you might want to increase the size of the sectors for two reasons. With large sectors, there is less overhead associated with figuring out which sector to read next, because you don't have to do it as often. Secondly, using extended memory, every time you issue a read request for a sector, the machine has to enter protected mode, copy the data, and reset the processor (that's the only way out of protected mode) ... this takes time. (Incidentally, if you can configure your memory as expanded rather than extended, the ramdisk will run faster since you no longer need to go in and out of protected mode). WARNING: Some versions of DOS do not like sector sizes larger than 512 bytes (which is what disks use in general). I had an IBM AT running DOS 3.10 which would not allow a ramdisk unless the sector size was 512 or smaller. Keep this in mind if you want to use larger sectors. The above is only of any significance if the cluster size is one sector; the relevance diminishes as the cluster size increases. $ Is there any disadvantage (or limit) to setting ENTRIES to some $absurdly high number just so you wont have to worry about exceeding the $limit? Yes, there is a disadvantage. Directory entries take up 32 bytes each, and they must be allocated one sector at a time. You get 32 entries per K of disk space, so it you set the number of entries to 512, for example, you have just lost 16K of disk space. This may not worry you if you're only going to put 128K of stuff on a 384K ramdisk, but remember that files grow to fill the available disk space, and if you use an absurdly high number of directory entries, sooner or later you'll run out of space on that ramdisk. It doesn't take that much thought to come up with a fairly reasonable number, depending on how you're going to use the ramdisk. $ Is there a way to put it in any memory above 1k (say if you have 2 meg $of memory on board)? You mean 1M, I think. Older versions of RAMDRIVE.SYS and VDISK.SYS would allow you to use either conventional (the first 640K) or extended (in ATs only, above 1M) memory, and I think they will use as much extended memory as you have if you want them to. The most recent versions (with DOS 4) also allow you to use expanded memory (a.k.a. LIM EMS). -- Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate!!!\n"; **************************************************************************** If it's true that love is only a game//Well, then I can play pretend