Short: Mount any disk image file as a DOS device
Author: Thore Böckelmann <firstname.lastname@example.org>
Uploader: Thore Böckelmann <tboeckel gmx de>
Architecture: m68k-amigaos >= 2.0.4
Thore Böckelmann <tboeckel at gmx dot de>
Any Amiga® (compatible) computer with at least OS2.04 and 68020+ cpu.
A long time ago I found a device called "fmsdisk.device" on Aminet. It
allowed you to mount a file on your harddisk as a regular floppy disk. You
could then use this new drive exactly like DF0:. Unforturnately FMS often
crashed on my machine upon mounting the image, and, even worse, FMS didn't
allow you to swap these virtual floppies, nor did it support compressed
images. Especially compressed images are very popular since the Amiga
emulator UAE existed. The only way to swap a disk with FMS was to prepare
another disk image and transfer it to FMS with tools like TransADF or
similar. From my point of view that is neither very convenient, nor very
DiskImage goes a slightly different way. Instead of mounting a static file
you just mount the drive, eg. DI0:, and then you "insert" the disk image of
your desire with a special tool. This image can be ejected at any time and
replaced by another image in a way that is completely transparent to AmigaOS.
DiskImage supports nearly all trackdisk commands and disk change interrupts.
And even more important: it supports gzip compressed disk images via Achim
Stegemann's free zlib.library. Additionally you are not limited to images
from floppy disks, but you can use image files from any device you can
imagine. It is even possible to dump your whole harddisk to a file and then
mount this file as a mirror of your harddisk. The only limitation is
AmigaDOS's limit on the size of a file, which is 2GB minus 2 bytes
(= 2,147,483,646 bytes). One big advantage is the ability to mount CD-ROM ISO
image files. That means if your CD writer is not able to write to CD-RW disks
(ok, all recent writers are able to do that) or you don't have a CD-RW disk
at hand, then you simply create an ISO image with MakeCD and mount this image
diskimage.device supports up to 10 different units each of which can have its
own device layout, that is FileSystem, number of cylinders, etc. All this is
determined by standard Amiga mount files.
You must use DiskImageCtrl to swap the images in the different unit. Its
shell template is:
DRIVE=DEVICE/K: either "diskimage.device" or a DOS device like "DI0:" to
obtain the unit number from
UNIT/K/N: unit of diskimage.device you want to be affected. If no unit number
is given then unit 0 is assumed.
EJECT/S: this switch will eject the inserted disk image
READONLY/S: mount the image in read-only mode, every write attempt will be
rejected with a "write protected" error
GUI/S: use the MUI interface instead of the shell interface
IMAGE=INSERT: name of a new disk image file that you wish to insert. This can
either be a normal uncompressed file or a file compressed with
the GNU gzip command
CX_POPUP/K: open the MUI interface (YES, TRUE, 1), or simply install as a
commodity (NO, FALSE, 0)
Without any arguments DiskImageCtrl will show a list of which image file is
inserted in which unit of diskimage.device.
After insertion you can use the mounted image like any other drive in your
system. You can read, write, create and delete files, copy the whole disk via
DiskCopy, repair the disk with Dave Haynie's DiskSalv, start programs, format
the disk. To make it short: you can do anything with the image that you can
imagine for any other device.
For gzip compressed images there is one important thing to mention:
gzip compressed images are decompressed on-the-fly when you insert the image
file and any access will take place on the decompressed image, not on the
compressed image itself. But that means, that any change done to the disk
will be dead and gone as soon as you eject the image from diskimage.device.
The disk will be in the same state upon reinsertion as it was the first time
when you inserted it. That means you can change anything on the image, but
all these changes are non-permanent!! If you wish them to be permanent, then
you have to decompress the image by hand (via gunzip <file>.gz) and then
insert the decompressed image. On the other hand you can modify anything on
such an image without any loss of data, because the original compressed image
is not touched in any way!
Due to the size of uncompressed images compared to compressed ones there is a
way to tell diskimage.device where to store the temporary images. The default
is "T:". To override this path you will have to set the environment variable
"DiskImageTempPath" via the setenv command. This path will be used furtheron
for temporary disk images. Make sure that you have enough space left on the
device that path belongs to!!
To insert the disk image "simpleimage.adf" into unit 0 of diskimage.device:
DiskImageCtrl unit 0 insert work:images/simpleimage.adf
To insert the gzip compressed disk image "cooldemo.adz" into drive DI2:,
which has been mounted on diskimage.device unit 2. The file will be un-
compressed on-the-fly the the path given by the environment variable
DiskImageCtrl drive di2: insert work:images/cooldemo.adz
To eject an inserted image from unit 3:
DiskImageCtrl unit 3 eject
How to use CreateImage:
CreateImage is a simple tool to create empty image files matching an already
existing DOS device. CreateImage's template looks as follows:
DRIVE=DEVICE/K/A: name of an already mounted device, such as DF0:, DH0:, etc.
This name may be specified with or without trailing colon.
DIUNIT/K/N/A: unit number of the new diskimage.device
IMAGE/A: filename of the new and empty image file. The corresponding mount
file will be named "<image>.mountlist".
Please note that CreateImage just creates files of a certain size, but with
random contents. That means that you can insert this newly created image, but
any filesystem will hardly recognize it as a valid disk. Thus you still have
to format that image or transfer valid disk data to that image via a suitable
Copy diskimage.device to DEVS: and DiskImageCtrl and CreateImage to any place
you want to. C: would be a very good place. The mount files belong to
SYS:Storage/DOSDrivers, to be mounted on demand. If you wish to mount a
certain drive on every boot, then move these files to DEVS:DOSDrivers.
- none known yet
- diskimage.device now gives exact drive geometry data for known disk
formats, that is AmigaDOS FFS DD and HD disk, MS-DOS DD and HD disks, ISO
CD images. Hence my other program AutoMounter is able to mount such
images automatically without the need to create a suitable mount file.
That makes usage of diskimage.device much easier.
- Seek()s within the image file now are done relative to the current
position instead of to the beginning of the file. This should speed up
seeks on slow base filesystems (FFS, OFS).
COPYRIGHT AND DISCLAIMER
DiskImage is copyrighted 2001-2003 by Thore Böckelmann.
All rights reserved. This program is freeware, so no financial donations
required. Redistribution allowed if the package is left unchanged. The author
is not responsible for any damage caused by the use or misuse of this
documentation and/or the program(s) it describes.
DiskImageCtrl uses the SmartReadArgs package by Thomas Aglassinger, the
zlib.library by Achim Stegemann, the XAD decompression system by Dirk Stöcker
(and various other developers) and the XPK decompression system by Urban D.
Müller, Dirk Stöcker and various other developers.