Short: Mount any disk image file as a DOS device Author: tboeckel@uni-paderborn.de (Thore Boeckelmann) Uploader: tboeckel@uni-paderborn.de (Thore Boeckelmann) Type: disk/misc Replaces: DiskImage.lha TITLE DiskImage VERSION 37.6 AUTHOR Thore Böckelmann REQUIREMENTS Any Amiga® (compatible) computer with at least OS2.04 and 68020+ cpu. DESCRIPTION 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 intuitive. 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 via diskimage.device. USAGE 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,UNIT/K/N,EJECT/S,READONLY=RO/S,GUI/S,IMAGE=INSERT,CX_POPUP/K 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 .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!! Usage examples: 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 uncompressed on-the-fly the the path given by the environment variable "DiskImageTempPath": 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,DIUNIT/K/N/A,IMAGE/A 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 ".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 tool. INSTALLATION 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. KNOWN BUGS - none known yet HISTORY 37.1 (13.3.2002): - inital Aminet release 37.2 (4.4.2002): - DiskImageCtrl now has an MUI interface for easy control over all units, which works as a commodity. Hence the new place for DiskImageCtrl should be the SYS:WBStartup drawer - I forgot to include the zlib.library in the initial release 37.3 (16.4.2002): - DiskImageCtrl didn't enable the eject button after a successful insertion of an image. Thanks to Pixel Art for that hint. - images can now be set read-only or read-write on the fly 37.4 (14.5.2002): - DiskImageCtrl now uses a pattern when opening the file requester to avoid selection of non-image files. The pattern is "#?.(adf|adz|gz|iso)", which makes only standard image files visible. - this release contains gzip'ed empty image files of several very common disk formats: + 880K FFS-Intl (std. Amiga DD) + 1760K FFS-Intl (std. Amiga HD) + 720K FAT (std. MS-DOS DD) + 1440K FAT (std. MS-DOS HD) Thus you can easily create new images on the fly. Due to the fact that it is an empty disk the gzip'ed images have a really very small size (2K to 15K). Remember that any modification to an on-the-fly-gunzip'ed image is lost as soon as you eject the image!! So either make a copy of it first, or gunzip the provided empty image before you insert it to make your modifications permanent. - DiskImageCtrl saved complete garbage when changing the temporary image path. Thanks to Boris Ivic . - empty path handling was completely broken when DiskImageCtrl was running in GUI mode - inserting images via Shell now updates the GUI, if running, thus the GUI always shows consistent data. - diskimage.device now prefers xadmaster.library over zlib.library for compressed disk images. This allow a huge bunch of new (maybe more efficient) compression methods, as long as you have a suitable xad client for decompression. - Sorry, but no tool to create empty image files yet. I have been too lazy. Maybe in the next release... 37.5 (6.5.2003): - diskimage.device now supports the extended trackdisk command set (ETD_*), which is used by WHDLoad's DIC program for example. Thanks to Konrad Klar . - DiskImageCtrl now shows which DOS devices have been mounted on each unit of diskimage.device. I think this makes it much easier to know where to insert a certain image file. - CreateImage is finally done!! It takes an existing DOS device as first argument and will create a suitable sized image file for the specified unit of diskimage.device and a suitable mount file. See above for a very simple description how it works. 37.6 (30.7.2003): - diskimage.device can now uncompress DMS images on-the-fly, too. I don't know why I didn't check that before, but now it works. Additionally XPK compressed images are supported, too, if xpkmaster.library and the corresponding slave library are installed. Thanks to Konrad Klar for his suggestions. - DiskImageCtrl always used unit 0, if you tried to access diskimage.device by specifying a drive name (e.g. DI2:). Now it fails with an approriate error message. Thanks to Konrad Klar . - although XPK compressed images are supported now, one feature is still missing. XPK offers one to read directly from compressed files, without temporary decompressed files. Since cannot read and write simultaneously from one file, such images would be read-only. The next release will have an option to enable this "direct XPK" feature. 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 and XAD decompression system by Achim Stegemann and the XPK decompression system by Urban D. Müller, Dirk Stöcker and various other developers. SEE ALSO .