Classic Computer Magazine Archive COMPUTE! ISSUE 71 / APRIL 1986 / PAGE 10

Readers Feedback

The Editors and Readers of COMPUTE!



Moving AmigaDOS Commands To RAM
Regarding your article "Introduction to AmigaDOS" (COMPUTE!, January 1985), I feel that it's inconvenient to have all of the AmigaDOS commands-especially often-used commands like DIR-stored on disk rather than in memory. Is it possible to load all or part of DOS into RAM? If so, how much memory does it take up? Can you write a batch file to make this part of the boot sequence? Will AmigaDOS become RAM-resident in the future?
Barry Silverstein

Every AmigaDOS command is disk-resident, and you're not likely to see any change in the near future. This can be inconvenient at times since, for each separate AmigaDOS command, the computer has to access the same Workbench disk that was present when you booted the system. If you have only one disk drive, this scheme creates delays and requires extra disk-swapping. Fortunately, there's a simple remedy. If you create a RAM disk, you can then COPY any or all of the AmigaDOS commands from floppy disk to RAM disk; the amount of memory consumed depends on how many commands you copy. Once that's done, an ASSIGN command tells the system to use the RAM-resident commands.
    The most convenient way to move AmigaDOS commands into RAM is by editing the startup-sequence file, which is similar to an AUTOEXEC.BAT file in PC/DOS and MS/DOS systems. When you insert a disk in response to the Amiga's Workbench disk prompt, the computer looks in the S subdirectory of the currently mounted disk for a file named startup-sequence. If this file is present, the computer executes the AmigaDOS commands that it contains. Since startup-sequence is an ordinary ASCII text file, it's easy to modify with a word processor or any text editor that handles ASCII files. (Before editing this file, make sure that you have at least one copy of the Workbench disk in addition to the one that came with your computer.) If you edit this file with Textcraft or some other word processor, you must resave it in the form of plain ASCII text, without special formatting characters or control codes.
    AmigaDOS includes two text editors of its own. The easiest one to use is called ED. Type this line at the CLI prompt, then press RETURN:

ed "s/startup-sequence"

    This command activates ED and loads startup-sequence into the editor. An unmodified startup-sequence file looks like this:

ECHO "Workbench disk. Version 1.1"
ECHO " "
ECHO "Use Preferences tool to set date."
ECHO " "
LoadWb
endcli > nil:

    You'll probably recognize the messages that appear on the screen when you boot up with that disk. The LoadWb command loads and activates the Workbench, and endcli terminates the AmigaDOS command sequence, returning you to the Workbench screen. We'll use ED to add some new command lines between LoadWb and endcli. ED is a very simple text editor: Use the cursor keys to move around in the file, and the BACKSPACE key to delete characters. Everything that you type is inserted at the current cursor position (you can use uppercase if you like, but lowercase works just as well and is easier to type).
    While you could copy the entire command directory (named C) into the RAMdisk, that wastes a lot of RAM since some AmigaDOS commands are used only rarely. To save memory, we'll copy only the most commonly used commands. Place the cursor on top of the E in endcli and enter these lines, pressing RETURN at the end of each line:

echo "Copying AmigaDOS commands to
     RAM disk..."
copy c/copy ram:c/copy
assign x: ram:c/copy
assign d: ram:c
cd sys:c
x: assign d:
x: cd d:
x: copy d:
x: delete d:
x: dir d:
x: diskcopy d:
x: echo d:
x: ed d:
x: endcli d:
x: info d:
x: list d:
x: makedir d:
x: newcli d:
x: rename d:
x: run d:
x: type d:
cd sys:
assign c: ram:c
assign d: c:delete

    Remember, this set of commands goes between the LoadWb and endcli lines in the normal startup-sequence file. If you change your mind and don't want to modify the file, press ESC-Q followed by RETURN; ED returns you to the CLI without changing anything. To save the modified file to disk, press ESC-X followed by RETURN. After the file is resaved, ED returns you to the CLI prompt. To test the new startup-sequence file, reboot the computer by pressing CTRL-Left AmigaRight Amiga. It takes about a minute to copy the commands shown above. Once the process is finished, all of the copied commands are instantly available in RAM (if this doesn't work, reload startup-sequence into ED and check for typing mistakes).
    The first command line following ECHO copies the COPY command itself into RAM so the computer can copy subsequent commands without accessing the disk each time. The next three lines simplify your typing job: The first ASSIGN command tells the computer to substitute the characters ram:c/copy wherever it sees the characters x:. The second ASSIGN creates another short alias (d:) which stands for the pathname ram:c. The CD command changes the current directory to SYS:C so you won't need to specify a subdirectory for every file you want to move. These three shortcuts let you abbreviate all of the remaining COPY commands (the command x: endcli d: becomes the equivalent of ram:c/copy sys:c/endcli ram:c, and so on).
    Thus, each line beginning with x: causes the computer to copy a single AmigaDOS command to the RAM disk. Of course, you can delete commands from this list, or add others if desired. The command ASSIGN C: RAM:C tells the computer to use the C directory in the RAM disk as its command directory. From this point on, the Amiga searches the RAM disk when you tell it to execute an AmigaDOS command. The final ASSIGN command isn't really necessary, but shows how to create a shorthand name for an often-used command. In this case, we're creating d: as a synonym for DELETE. Once this is done, you can delete the file TEST by typing either DELETE TEST or D:TEST. This can be done for any command, using whatever shorthand you like. The command sequence shown here is adapted from an example in COMPUTE!'s AmigaDOS Reference Guide, which explains this and many other AmigaDOS topics in detail.