< Previous  |  Contents  |  Next >

9 : The Memory Disc        


Memory Discs in General

All versions of DOS provide, as standard, the ability to allocate a memory disc. These are often referred to as RAM discs. It is of course not a disc at all, but an area of memory set aside to appear to an application, or its user, like an extra disc drive. When created, the memory disc can be treated exactly like any other drive on the system, and can have directories and files for any purpose stored on it. However, there are several points to bear in mind when contemplating the use of a RAM disc, and these are explained in this chapter.

The main benefits of using a memory disc can be felt on floppy disc only systems, where the need to swap discs for even the most routine of tasks can be caused by the limited amount of on-line storage available, even when using the 800k format. Indeed, within some applications, you may not be able to swap discs at all. You may need to first save your work, leave the application, carry out the operation and then reload. In these cases the presence of a third disc drive can be even more useful, not only saving much time, but considerably increasing the flexibility of your system.

Some implementations of DOS have a (semi) permanently configured default memory disc. This appears (or not, as configured) automatically when the system is loaded, but to change the setting is a tedious and inconvenient process, since it usually requires the running of a special program, followed by the need to re-boot the entire system. This type of option is not available on the 512, but a rather more flexible approach is provided. The 512 requires no permanent settings and, given the limited memory for larger applications, the 512's chosen method provides a more easily configured system than the former.

Setting up the Memory Disc

To set up a memory disk you need to run the program called 'MEMDISK', initially provided on Issue Disc 1 as a transient command. If you might want to set up a memory disc with an application, you will find it more convenient to include the program (MEMDISK.COM) on your application's program disk, perhaps included in a batch file along with the command for the size of memory disc required (or allowable) with the application. Chapter 10 explains batch files in more detail, so for the moment example commands can be used manually. Assuming, as usual, that the current drive is A: and that the disc contains 'MEMDISK.COM' setting up a memory disc is simplicity itself. You may care to follow the examples if you are unfamiliar with the memory disc.

As is usual with COM files the command takes the form of the filename, without the extension, and in this case uses a single parameter to define the size of the required memory disc in kilobytes. For example, to create a 100k memory disc you would enter:

memdisk 100

Note the spelling of disk with a 'k' as this is how the file is named on the disc. The 'MEMDISK' transient will execute and, on completion, confirm that a 100k memory disc is installed. The above example is the only form of the command, and the only variable is the required memory disc size. One fixed item that you cannot specify is the drive name you would like to use; the resulting memory disk is always drive M and this cannot be altered. This may have implications for some applications, since they may well expect to see their other modules only on the drive from which they were loaded, so not everything can be run from the memory disc.

Another point to note is that, no matter what size you tell 'MEMDISK' to allocate, the resultant size is always an even number. For example, if you need a 49k memory disk for your current purposes you must allocate it as 50k. Any attempt to create it as an odd number size will always be rounded down by the system. This may not matter, but if you are, perhaps, being careful with memory your RAM disc may now be too small.

The final important point to note about the 512's implementation of memory disk is that after it's created you cannot remove it or even change its size, in fact, you can't change anything about the memory disc even when it's empty. To do this requires the system to be re-booted. It should be noted, however, that this restriction is peculiar to neither the 512, nor even to DOS Plus.

Limitations of a Memory Disc

Most of the limitations of the memory disc are likely to be caused by the combination of the 512's memory size and the applications software you are using. However, before considering this there is one overriding factor that should always govern how they are used.

A memory disc can save considerable quantities of time if used correctly, but it is not a real disc and neither it nor its contents should be regarded as permanent. Unlike any external 'real' disc a machine failure is fatal to the memory disc, and the contents are lost. Use it, therefore, only for temporary storage, for example to hold transient command software or batch files, but never for data files, unless these are also temporary or fully recoverable (ie fixed contents, copied from elsewhere).

When deciding on the suitability of a memory disc for your applications bear in mind that programs designed for MS-DOS, (even a 512k machine) will normally find more memory available than in a DOS Plus system. This, rather than hardware compatibility, explains why some programs run in a 512k MS-DOS machine but not in the 512. If you have one of these applications and it's already borderline, it clearly is not a suitable candidate for use with a memory disc.

Other programs (even DOS programs) need all or most of the available RAM in the 512, especially if the software was originally designed to expect a 640k machine. Comments for these are as above. Some programs run in the 512, but require more space as they load than when finally installed. If you have applications like these you can be fairly certain that they will also fail if a memory disc is installed.

Unfortunately there are no easy guidelines so you must experiment with your own applications. A size that works with one application may possibly be unsuited to another. The smallest size of memory disc that is permitted is 16k, but even this might be useful, for example, to contain two or three of the smaller transients.

'MEMDISK' itself is, of course, a program, so in addition to the size of memory disc that you allocate you should add 90k. This overhead does not vary and is always 'lost' to the system when 'MEMDISK' is used, in addition to the size of RAM disc requested.

If you reboot the system you can enter the following sequence of commands to demonstrate this for yourself.

memdisk 40

As you'll see from the difference between the figures produced by the two 'BACKG' commands, the memory reduction for a 40k memory disc is about 130k. As noted above, the amount of lost' memory does not vary with the allocated size of the memory disc, so even a 20k memory disc needs 110k. Bear this in mind when you decide on the suitability of a memory disk for your particular job. If you have a PC Plus from Solidisk the above limitations are unlikely to be relevant.

One other case where the apparent memory limitations are not so severe is if your application is capable of 'self configuration' to fit the memory constraints of the system. Again, some experimentation and the type of application may show that a reasonable size of RAM disc is still viable.

For example PC-Write by Sagesoft is a popular wordprocessor which runs well on the 512, provided that it is initially configured for a two colour display with a mono monitor. However, it is written to be capable of working on very small PC systems, many of which were commonly less than 512k a few years ago. In consequence, this software runs completely normally on the 512 with a 100k memory disk installed, while at the same time holding a 60k document in memory, about six times the length of this chapter. If the memory disk allocation is increased (after re-booting) to 128k, PC Write self-adjusts by reducing the maximum document size, in this case to about 42k (roughly 7,000 words), which is still adequate for many purposes.

The Benefits

Used within its limitations and with the right application a memory disc can greatly increase both the speed and the operational convenience of your 512. This will be most obvious when commands call for the repeated loading of files, for example, when transient commands are used. With a RAM disc there is no noise and virtually an instant response when commands are issued.

If you decide to use a memory disc you can include its setup commands in your startup batch file. Include the command to create the memory disc and the commands to copy to it the most frequently used utility software and the batch files needed for your application. The installation of your memory disc can, therefore, both be customised to your application and automated at the same time. When utilities are needed you will no longer have to swap discs, nor will you need a copy of the utility on virtually every data or applications disc, often the only alternative to disc swapping.

The next chapter discusses batch files and examples of their use, including the way in which a memory disc can be used with these to speed up and simplify operation.

Removing the Memory Disc

Once a RAM disc has been installed it cannot be removed from DOS Plus simply by issuing a command. If you wish to free the memory allocated by DOS Plus to the RAM disc then it is necessary to re-boot DOS Plus itself.

< Previous  |  Contents  |  Next >

About the Master 512 | Bibliography