ADFS: An Introduction

By Gus Donnachaidh

Originally published in EUG #19


In response to numerous requests from readers finding Electron manuals confusing, this is my umpteenth draft of a guide to using ADFS. I keep drifting into analogy and end up taking a page to explain anything but I hope I am clearer than those actually involved in designing and programming of computers who seem to think manuals should be deliberately written to persecute their readers. Lateral, totally logical and infuriating.

They think that way. Here I go...

SAVE, LOAD, *SAVE, *LOAD, CHAIN, *SPOOL, *EXEC, *RUN, etc. These all work as normal and are outlined in the Acorn Electron User Guide.

At switch on or on CTRL-BREAK, *CAT (RETURN) will initialise a disk in drive 0. To initialise a disk in drive 1 (if you have a second drive), type *MOUNT 1 (RETURN). Equally, if you put another disk into drive 0 it too must be initialised, type *MOUNT 0 (RETURN).

You can abbreviate *CAT to *. ["*.", not "*"]

When a file is saved to disk, it is put in the next available space after those files already present. Its filename is put onto a list or catalogue called a directory. If you use the same filename as a file already in that directory, the new file will overwrite the old one and the old file will be lost.


Now, think of a family tree. There is the couple at the top who might have some children. Each of those children has some kids and each of them might produce offspring. With each succeeding generation, the family grows.

When you initially put an ADFS disk into the drive you can see a list of what is on the disk or more precisely what is in the "Root" directory. Now some of the entries may have the letters DLR after them. These are sub-directories. In some of these sub-directories, there may be more sub-directories with the letters DLR after their names. These sub-directories may themselves have sub-directories and so on.

                            (Root Directory)
                          1a                1b
                     |---------|       |---------|
                     2a       2b       2c       2d
                   |----|   |----|   |----|   |----|
                   3a  3b   3c  3d   3e  3f   3g  3h

Diagram showing the directory tree structure. The tree is rarely this elaborate though and directory names or titles are usually a bit more descriptive.

The point of this is twofold. Firstly, a directory can only hold 47 files. On my wordprocessor, when a directory has 46 files, I simply create a new directory and start saving within it. Secondly, different directories can be used to hold different types of files. I have directories for personal letters, business letters, household letters one for those that I don't talk about.

Suppose I'm in the root directory and I want to save a file in directory 3f. I could move to 3f by using the command *DIR 1b.2c.3f (RETURN) then SAVE or I could type SAVE "1b.2c.3f.file" (RETURN). After this latter one, I will still be in the root directory and my file will be safely saved in 3f. I can of course check this by typing *.1b.2c.3f (RETURN).

Notice the sequence of directory names. This is called a path. It might be a little difficult to remember what each path is on each disk but the way to write a path is simple: first directory name, full stop, second directory name, full stop, third and final directory name, full stop, filename.

Using the path structure you can also see the catalogue of another directory. For example, type *.1a.2b.3c (RETURN).

That concludes the basic outline. I now move onto the ADFS commands.

ADFS Commands

To see a list of all the commands held in the ADFS ROM, type:


In the following documentation, the terms List Spec, Ob Spec and *Ob Spec* simply mean the filenames and were developed by the boffins to confuse people.


ACCESS <List Spce> (L) (W) (R) (E). In the directory catalogue filenames are followed by two or three capital letters. L means that a file is locked. This file cannot be overwritten or deleted. W means writeable. This is near enough the opposite of L because you can save another file with the same name as this one so overwriting (and losing) this one. R means readable. I've never had much use for it myself. E is for protecting machine code programs. Don't use it.

The ACCESS command changes what you can do with a file. Initially, most files will be followed by WR but these can be changed by typing, for example: *ACCESS filename LR (RETURN)


BACK. You want to work on some files in directory 1a and also some in directory 2b. Go to directory 1a then to directory 2b. Now whenever you want to jump from one directory to the other type *BACK (RETURN). You will be toggled back and forth between the two directories.


BYE. Useless command unless you happen to have a hard disk and even then...


CDIR <Ob Spec>. This command is used to create a new directory. Essential. Type *CDIR name (RETURN).


CLOSE. This is used to close some types of data files. If you get an error "File Open", type *CLOSE (RETURN).


COMPACT <List Spec> <Ob Spec>. You save a 5k file, then an 8k file than a 2k file. Then you load the 8k file, add another 1k to it and save it again with the same name. It won't fit in the 8k space it previously occupied so it will have to go after the 2k file. Now there is an 8k space which is effectively blank. Soon the disk becomes full of such spaces. The COMPACT command shuffles each file down filling the empty spaces and creating more free space at the end of the disk.

However, it is very important that you use a VDU command to turn the cursor off - before using this command. So, to use it, enter:

      >VDU23,1,0;0;0;0; (RETURN)

Failure to turn off the cursor will badly corrupt your disk and reduce its contents to gibberish! Providing the cursor is off, you can use the COMPACT command repeatedly until all the free space is available. You will undoubtedly need to.


COPY <List Spec> <Ob Spec>. A very useful command for copying files from one directory to another and one disk drive to another. You have a file xyz in directory 1a in drive 0 and you want to copy it to directory 2c in drive 1. Type:

      >*COPY :1.1b.2c (RETURN)

:1 means drive 1, the . separates each of the following parameters so :1.1b.2c is a sequence or path that must be taken, to drive 1, to directory 1b, to directory 2c. Obviously if you want to copy to a directory in the same drive then the :0. and the :1. can be omitted.

You can also type:

      >*COPY :0.1a.* :1.1b.2c (RETURN)

This copies everything in directory 1a on drive 0 to directory 2c on drive 1.


DELETE <Ob Spec>. To delete a file, type *DELETE filename (RETURN).


DESTROY <List Spec>. To delete a group of files, type, for example:


All files beginning with A will be listed. You must type 'YES' to confirm and they will all be deleted. It works as a sort of block delete.


DIR <Ob Spec>. Used to change from one directory to another. Type:

      >*DIR name (RETURN)
If you are in the root directory and you want to go to 3f, type *DIR 1b.2c.3f (RETURN). If you are in directory 3f and you want to go to 2c, type *DIR ^. The symbol ^ takes you back through the directory path one step. Equally if you want to go to directory 1b, type *DIR ^^ (RETURN). No matter which directory you are in, if you type *DIR (RETURN), you will be put back to the root directory. If you want to delete a directory you no longer need, first make sure it's empty, then change the access with *ACCESS directoryname (RETURN) then type:
      >*DELETE directoryname (RETURN)


DISMOUNT. Another command of limited usefulness.


EX <Ob Spec>. A gem of a command. This will give you all the information you would get by typing *INFO* but saves three keystrokes. If you want information about files in another directory, even on another drive, type :*EX :1.1a.2b (RETURN). Normally, *EX (RETURN) is sufficient.


FREE. Tells you how much free space there is on the disk. Unfortunately it clashes with the *FREE command on Beebugsoft's TOOLKIT ROM.


INFO <List Spec>. A long winded version of *EX basically.


LCAT and LEX. Don't worry about these. They utilise the library facilities of ADFS which I've never used mainly because I've never seen the point of all the bother.


MAP. Gives a list of all the blank spaces. Useful for checking if more COMPACTing is needed.


MOUNT (<DRIVE>). Tells the computer to change drives. *MOUNT 1 (RETURN). Also useful if you load something from a disk and you want to, say, SAVE it onto another disk but cannot press CTRL-BREAK. In this case, type:

      >*MOUNT (RETURN)


REMOVE. Rather pointless alternative to DELETE.


RENAME <Obspec> <Obspec>. Self explanatory. However it will not work on a file that has been locked.


TITLE. If you catalogue the disk, you will note the top lefthand corner in the root directory is a $ symbol. This is the default title and it can be changed thus:

      >*TITLE newtitle (RETURN)

The title of sub-directories will be the name of the sub-directory.

More ADFS Commands

The ADFS Welcome disk has a number of utilities, most of which are, frankly, of limited use. One very important one is EFORM which formats disks. Why on earth this wasn't included on the ROM is anyone's guess! Most ADFS users will have bought the Advanced Disk Toolkit (ADT) from ACP/Pres which, while being a bit expensive, has a formatting function and many more useful utilities besides. Anyway, if you still use the Welcome disk, copy the EFORM utility to as many disks as you can. For goodness' sake, don't lose it!

Another extremely useful command is *VERIFY which is on both the Welcome disk and ADT.

!BOOT Files

The EUG disks have a !BOOT file. One of these can in fact contain any sequence on instructions which the Elk normally understands. My word processor disk, for instance has:

      >*DIR 1994
      >*KEY0 Yours faithfully|M|M'Gus Donnachaidh.
      >*KEY9 LOAD LOADer

This loads the ROM image of Starword into RAM, initialises it, turns it on, sets the directory, programs some function keys and catalogues the directory. All when SHIFT-BREAK is pressed.

A !BOOT file is most easily written on a word processor and SAVEd with the filename !BOOT. Then you must type *OPT 4 3 (RETURN). This tells the computer to look for a !BOOT file and *EXECute it. At the top of the directory page is an entry Option 03 (Exec).


A very useful feature of the Elk comes into its own on ADFS. This is the wildcard. Bit like one of those card games where the Joker stands for any card. The most useful one and the one I use most is * which stands for any number of letters.

LOAD "A*" (RETURN) will load the first file beginning with A no matter how many letters there are in the filename. This might seem a little pointless but comes into its own when loading a file with a long file name. Take for instance a filename like ABBREVIATE, LOAD "ABB*" (RETURN) will work, provided no other files exist beginning with ABB .

ADFS Configuration

Problems with ADFS are rare. The main problem will be the corruption of the information on a disk. A backup copy should always be kept of every disk and this is where a second drive is most useful. Sometimes when I try to load something from a disk I get a repeated whirr-whirr sound. This is the disk head running up and down the disk because it cannot find a piece of data it is expecting. The cause of this might be a damaged disk or dirty disk head or a damp environment. The disk head needs to be cleaned occasionally. I do it about twice a week, mainly due to all the EUG work I do but in any case, but a head cleaning disk and always keep it handy.

To my mind the two most useful expansions of ADFS are a second drive and ADT. I couldn't manage without either. My second drive is a 5.25" one so that I don't mix my backups. Remember though when buying a 5.25" drive to ask for a BBC B compatible, double-sided, double-density 80 Track one. There are a number of PC 5.25" drives now coming onto the market and while these will work, they start up as soon as you insert the disk. This can be very annoying.

As for a 3.5" drive, try to get a double-sided, double-density one. It is unlikely that you will be offered a high density one cheaply as these are still used frequently on PCs but this will be changing soon as PC owners dutifully obey the latest instructions from the PC Press to ditch what they recently spent hundreds on and buy the lastest gear if they don't want to look naff.

Power supplies for second drives must be used. There are a number of ex-PC switched mode supplies around which will have the connecting plug for 5.25" drives attacked. Make sure though the PSU is cased as high voltages are generated inside. Also you will need to put a load resistor across the output since switched modes don't like sitting around doing nothing. I use a 15 ohm 10 watt one which I bought from Maplin. I didn't solder it in, I pushed the wires into the output plug on the supply across the 12 volt line. Most switched modes have a legend on the side giving the output configuration.

A supply for a 3.5" can be an old PC switched mode but you will need to change the plug or get an adaptor. These do exist but can be tricky to find. Most 3.5" drives don't need very big supplies. 12 volt 1 amp with 5 volt at .5 amp is usually sufficient. Plugs can be bought quite easily but be careful of the configuration. For both the 3.5" and the 5.25" drives, the middle two pins are 0 volts. The 5 volt and 12 volt go on the outside but must not be mixed up.

                        3.5 in           5.25 in
                      .  .  .  .     / .  .  .  . \
                      ----------     |____________|
                      12v 0v 0v 5v     5v 0v 0v 12v

Supply sockets for 3.5" and 5.25" drives looking at the sockets on the drives.

And finally

Well, that's my article on how to use ADFS. If there's anything I left out, or anything that's not clear, then Send It In. I wrote this because members asked for it. If there's some aspect of the Elk causing a problem, ask for help. That's what the Electron User Group is for.

Send it in.

Gus Donnachaidh, EUG #19