Background

All operating systems have the ability to create a disk or drive in RAM such that the resulting disk can be accessed either as a hard-drive or a floppy and be manipulated by the operating system just like a physical drive. All Amiga versions create a RAM drive on the Workbench that is precisely that: a drive that can be read and written to just like any other volume. A RAM drive is inherently volatile such that after a reboot, the RAM drive is cleaned and all contents deleted - except when creating a drive out of non-volatile RAM such as the one backed by a battery.

The habit of creating RAM drives has disappeared from operating systems and modern operating systems do not include drives in RAM into their workflow probably due to planned obsolescence given the relative low costs of disk drives. However, a RAM drive is still mightily beneficial because all read and write operations take place in RAM such that hardware disk drives are spared all the usage cycles.

Imagine working on your computer and having to download files off the Internet - files that will be used once (for instance, ZIP files) but can be tossed away on the next reboot. In fact, Safari on OSX, and, more generally, OSX tends to pollute the ~/Downloads folder with a bunch of files downloaded off the Internet that, unless explicitly deleted, will end up taking up loads of disk space even though they have no more use.

Although OSX does not implement a RAM drive for folders such as ~/Downloads for temporary storage, the Amiga includes working with a volatile RAM drive in the daily workflow. On the Amiga, it is taken for granted: all the work takes place in RAM (if there is enough space) and then moved to a hardware disk drive for long term storage.

Persistent RAM Drive (RAD)

The Amiga supports the creation of a (semi-)non-volatile RAM drive called RAD that, compared to the Amiga RAM drive, will not flush its contents on a system reboot. Furthermore, the very cool feature of a RAD drive is that the Amiga can be made to boot from a RAD drive - effectively booting a hard-drive or a floppy directly from RAM.

Behind the scenes, the Amiga kickstart (the equivalent of a BIOS) includes a driver called ramdrive that makes a persistent RAM drive (RAD) possible. When the Amiga boots, the kickstart is loaded such that the Amiga can be made to boot directly from the RAD drive.

Unfortunately the persistence is "semi-" because if the Amiga is turned off, then the RAD drive contents do disappear (this is due to the RAD drive using either chip or fast RAM - neither of which are memory-backed).

Patching Kickstart RAM Drive

The RAD drive is included in the kickstart as a module called ramdrive - there are no updates to ramdrive since Amiga OS3.1. The problem with ramdrive is that the created RAD drive uses chip memory by default and chip memory on the Amiga has a fixed quantity that cannot be upgraded. Fortunately, an old patch called FastRAD created by Torbjörn Andersson that works on kickstart 3.0 and over will patch ramdrive in the kickstart to make ramdrive use fast RAM instead of chip RAM.

To use the patch, download:

and copy the FastRAD executable to C:. Then, edit S:startup-sequence and append the line C:FastRAD RAD: immediately after C:SetPatch such that the top of the startup-sequence will look like:

C:SetPatch QUIET
C:FastRAD RAD:

The FastRAD tool intercepts any device mounted with the device name RAD: and will force the RAD: device to use fast RAM instead of chip RAM.

Creating the RAD Device

As the RAD device is built into the kickstart, there is no need to install additional software. However, a file should be created at SYS:Devs/DOSDrivers/RAD with the following contents:

/* $VER: RAD 40.1 (31.8.93)
 *
 * Recoverable RAM disk mount entry
 *
 * You can create different simultaneous recoverable RAM disks by creating
 * versions of this file with different Unit values.
 *
 * The size of a recoverable RAM disk is controlled by the value of the
 * HighCyl line. Increasing this value by 1 consumes an additional 11K of
 * RAM. So the default value of 79 consumes around 880K of memory.
 */

Device      = ramdrive.device
Unit        = 0
Flags       = 0
Surfaces    = 2
SectorsPerTrack = 11
SectorSize      = 512
Reserved    = 2
Interleave  = 0
Buffers     = 5
BufMemType  = 5
Priority    = 5
BootPri     = -127 /* For booting from RAD, use BootPri = 5 */
Mount       = 1

/* The LowCyl and HighCyl fields are controlled by tooltypes in the RAD icon.
 *
 * LowCyl   = 0
 * HighCyl  = 79
 */

The main highlights of this file is the setting:

BootPri     = -127

that will prevent the Amiga from booting from the RAD drive - otherwise, the RAD drive will be empty upon the next reboot and Workbench will not load (later on, booting from RAD devices will be explained but BootPri should be set to -127).

After that, an icon should be created RAD.info to go along with the file created at SYS:Devs/DOSDrivers/RAD such that SYS:Devs/DOSDrivers/ contains the files:

  • RAD
  • RAD.info

The icon RAD.info should be inspected by selecting it in Workbench, right-clicking and selecting the menu Icons→Information… and then setting the tooltypes.

where:

  • ACTIVATE=1 means to mount the drive on boot (equivalent to Mount = 1 in the SYS:Devs/DOSDrivers/RAD file).
  • LowCyl and HighCyl can be computed to make the drive of any desired size.

When setting LowCyl and HighCyl be aware that tools may refuse to treat the device as a floppy if LowCyl is not set to 0 and HighCyl is not set to 79 (standard Amiga 880KiB floppy). This is particularly important if you wish to write a floppy image to the RAD device and then boot. Some tools such as diskcopy will refuse to work claiming that the source and the destination RAD do not have the same geometry.

The settings from the screenshot:

  • LowCyl=0
  • HighCyl=5957

will create a 64MiB RAD drive - and will thus not be compatible with diskcopy and similar tools. These parameters should be set to:

  • LowCyl=0
  • HighCyl=79

for compatibility.

Testing Persistence

With all settings in-place, the Amiga can be rebooted and a new drive should be created on the Workbench (commonly with the label RAM_0, or RAD, etc…) and will be accessible from the CLI by issuing:

cd RAD:

in case the file you created in the previous section was placed at SYS:Devs/DOSDrivers/RAD.

To check for persistence, copy any file into the new RAD volume and reboot the Amiga. After the Amiga reboots into Workbench, the RAD volume should still contain the file that was copied.

Creating Multiple RAD Volumes

Now that the test succeeded, it may be interesting to set up several (or, say, at least two) RAD volumes for different purposes. For instance, consider the following configuration with two RAD volumes:

  • A 64MiB RAD drive in fast RAM for work as a semi-persistent RAM-based scrap disk.
  • An 880KiB RAD drive, simulating a standard Amiga floppy, that can be used with diskcopy in order to boot into programs that cannot be run (or misbehave) on Workbench (this includes some utilities such as Advanced Amiga Analyzer, and some games).

In order to achieve this configuration, two RAD devices shall be created under SYS:Devs/DOSDrivers/ with their corresponding .info files - the name of the files will become the device name so you can choose whatever name sounds more suitable. The SYS:Devs/DOSDrivers/ directory will thus contain, say:

  • RAD
  • RAD.info
  • ROT
  • ROT.info

Both RAD and ROT files should have the same contents from the previous section with just one difference: the RAD file will have the Unit line reading:

Unit = 0

and the ROT file will have the Unit line reading:

Unit = 1

this is to allow AmigaOS to differentiate between the two devices.

Finally, inspect both .info files using the Workbench menu Icons→Information… and for RAD.info set the tooltypes to:

ACTIVATE=1
LOWCYL=0
HIGHCYL=5957

respectively:

ACTIVATE=1
LOWCYL=0
HIGHCYL=79

for ROT.info.

All changes must be saved and then the Amiga must be turned off and restarted. Upon reboot, Workbench should now display two RAD devices (commonly named, perhaps, RAM_0 and RAM_1). Additionally, the 64MiB RAD will be accessible from CLI via:

cd RAD:

respectively:

cd ROT:

for the 880KiB floppy-like RAD drive.

Finally, edit S:startup-sequence and modify the line:

C:FastRAD RAD:

to read:

C:FastRAD RAD: ROT:

in order to switch both RAD and ROT volumes to use fast RAM.

Writing Floppies to RAD Devices

DiskMasher (abbreviated DMS) is an utility that can create images from floppies; images that can then be stored and restored to other floppies. For restoring a .dms file to a RAD device, a command must be issued along the lines of:

dms WRITE Work:archive.dms TO ROT:

which will write the contents of archive.dms to the 880KiB floppy RAD created in the previous section. After writing, the ROT volume icon should change to the floppy icon from the archive.dms file. The results will be similar when using DiskCopy to copy a floppy to the 880KiB ROT RAD drive.

Note that if DMS ignores the ROT: parameter and asks for a floppy to be inserted into DF0: then most likely the ROT: device created in the previous section does not have the required geometry. Make sure that the icon at SYS:Devs/DOSDrivers/ROT.info has the tooltypes set to:

ACTIVATE=1
LOWCYL=0
HIGHCYL=79

in order to emulate a standard Amiga floppy.

Booting off RAD Devices

Both the 64MiB RAD and 880KiB ROT devices created in the previous sections contain:

BootPri=-127

In the Amiga boot order, the lowest the value, the least likely for the device to be booted and the largest the value, the most likely it is for the Amiga to boot off the device.

Since both files contain BootPri set to -127, the RAD and ROT volumes will be never booted from. Nevertheless, booting off RAD volumes is undesirable because when the Amiga is powered on, the volumes will be empty and since other drives are ignored, the Amiga will just display an Amiga Shell.

To the rescue, comes the good old Amiga bootmenu! After rebooting the Amiga via the Vulcan nerve pinch key-combo Ctrl+Amiga+Amiga, and holding down both left and right mouse button, the Amiga will display a the boot menu.

From there, the Boot menu option will lead to a drive selection. Amongst the drives should be RAD and ROT. Simply click on ROT, press OK and then click the Boot button on the main boot screen.

Congratulations! The Amiga now boots from the 880KiB RAD device!

Enhancements

TLSFMem can be used in conjunction with RAD drives and the latest TLSFMem at version 1.9 by Cosmo will work nicely alongside RAD. To make RAD drives and TLSFMem work together, edit S:startup-sequence and make sure that the lines around SetPatch look similar to:

C:SetPatch QUIET
C:TLSFMemPool
C:FastRAD RAD: ROT:

with the mention that the FastRAD utility should be called after TLSFMemPool.

Considerations

The ramdrive device found in the Amiga kickstart has a very important drawback when creating RAD drives: the entire size of the RAD device created will be fully allocated. That means that by creating a RAD volume will eat up RAM even if the RAD volume is empty! There is no way around this issue and alternatives are suggested in the following section however, given the ability to create a RAD drive in fast RAM and that fast RAM can reach up to 256MiB on Amigas, a sufficiently large RAD will not be too wasteful - additionally, Amiga programs use very little RAM; you can never expect to even fill up 128MiB and if you do, then most likely some program is leaking rather than legitimately using up that much RAM.

Other Solutions (That Do Not Work)

There are about three or so patches on Aminet that achieve almost the same effect as described in this guide but will not work entirely so they are worth mentioning:

  • statram is a RAM drive replacement that has the added benefit of being an expanding drive: the maximum size is set and memory is only allocated when the drive is written to. statram can be set to use fast RAM by setting BufMemType = 5 in the mount file, however, even with the FastRAD patch, all the memory contents will be lost upon reboot.
  • RRamDisk just like statram, RRamDisk claims to survive reboots - it does, but only if chip RAM is used, otherwise all the memory is lost on reboot.
  • AmberRAM is a great RAM drive replacement however, even with the FastRAD patch, AmberRAM will refuse to maintain the contents of the RAD device after reboot.

There are (marginally related) write-to-disk alternatives such as fmsdisk that are great for unpacking DMS files to. However, fmsdisk writes to the hard-drive and in case fmsdisk is set to write to RAM:, the files are lost upon reboot.

Changing Icons for RAD Drives

On OS3.{5,9} using PeterK's icon library, icons can be added for RAD and ROT (assuming that is what they were named as) to SYS:Prefs/Env-Archive/Sys named def_RAD.info, respectively def_ROT.info and then the NoGhost tooltype can be added such that the drives will not appear ghosted.


amiga/rad.txt · Last modified: 2023/09/27 10:36 by office

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.