Disk Droppings

See all articles from Sinc-Link v4 n3
Author(s): Greg Lloyd
Publication: Sinc-Link
Pub Details: Sinc-Link v4 n3 (Volume 4, Issue 3)
Date: May/June 1986
Pages: 12

In the previous column, I looked at the bits of hardware needed for the disk interface. This time we’ll look at the whys and hows.

First to answer the Whys. Why not! Are you fed up with the slow error-prone cassette system Sir Clive bequeathed to his serfs? It doesn’t matter how careful you are, everyone has lost a program or a file due to a tape glitch. I’m not saying you won’t lose any programs on disk, but you will know in a few seconds if you have a problem, rather than a few minutes on tape.

Since most of the software written for the 2068 and Spectrum uses memory to the fullest, your Disk Operating System should use little or no RAM. This is the theory, but in practice there are few systems that live up to this principle. You have to use your noodle to develop ways of fitting tape-based software into your disk system. I found that a header reader program is a must for any memory-mapping. If you know where all the pieces should be, you can fit them all together when you save them on disk. A real plus of a disk system is that you no longer have to be concerned with RAM size. You can write programs that use the disk as memory. IBM call this virtual memory because if you have enough disks it can go on forever.

Here’s an example of how it is done. Imagine a filing program that stores all the uses of a dead EPROM chip in r$(1000,20). This could mean that you are limited to 1000 records, holding 20 characters of data. When that is used, POOF! ERROR 4 OUT of memory. But with our clever program that draws it’s information from the disk, you can have as many records as you wish. The other uses of this technique are for downloading those big files from Compuserve (Groliers Encyclopaedia), or using your Word Processor to write the Great White Northern Novel. It is possible to wear out your disk drive and your arm long before you reach the limits of this technique.

My system, from Larken Electronics, has the ability to load and save an array of data or a block of code. This simple fact can be used to implement the virtual memory idea. Other systems allow the use of sequential and random access files. This is one step beyond saving and loading an array or code. It allows the records to be stored and retrieved one after another sequentially (sometimes slowly), or in a partitioned block for easy access randomly (fast). For a small file, sequential is probably best. Larger files dictate the use of random access.

The only limits you have with your Disk System are the ones you place there. If you let your imagination go, your system can do anything you want it to do. Ask someone like Peter McMullin (our resident ZX81 Forever and Ever and Ever Person) if you doubt me. 08/03/86