The replicon Euphoria program

Replicon is a DOS32 Euphoria program which can read and write images of 1.44 megabyte floppy disks and small primary master IDE/EIDE hard disks.

Replicon has some limitations and dangers (these are documented later) but, if used with caution, can come in rather handy.

References

Replicon uses low level BIOS calls to perform floppy disk and IDE disk operations. Details of the BIOS calls were found in Ralph Brown's famous interrupt list. I use the indexed HTML version of Ralph's work provided by Marc Perkel at:

    http://www.ctyme.com/rbrown.htm
    Ralf Brown's Interrupt List

Marc is a cool dude - just don't mention the word "lawyers"!

Quick start example

Here is a simple example of using replicon for those who want to get started quickly. Typing the following:

    ex replicon.ex snapshot a floppy.img

will create a file called "floppy.img" which will contain an image of the floppy disk in drive A.

Command line parameters in detail

Replicon takes either three or four parameters. They are:

    (1) Required: replicon command
    (2) Required: drive letter to act on
    (3) Required: image file name
    (4) Optional: cylinder count

The following sections discuss each of the command line parameters.

replicon command

The replicon command can be one of:

    snapshot
    restore

The replicon command can be in upper, lower or mixed case.

The replicon command "snapshot" instructs replicon to read data from the specified drive and write it to the image file.

The replicon command "restore" does the reverse by reading data from the specified image file and writing it to the drive.

drive letter to act on

Currently only two drive letters are supported which are:

    a
    c

The drive letter can be in upper or lower case.

Drive "a" means the first/only floppy disk.

Drive "c" means the primary master IDE/EIDE hard disk.

image file name

The image file name refers to a file which will either be written to (replicon command "snapshot") of read from (replicon command "restore"). The image file name must comply to the DOS 8.3 format (i.e. file name part no longer than 8 characters and optional extension no longer than 3 characters).

cylinder count

The optional cylinder count is a positive decimal integer. It can be specified to limit the number of cyclinders to read or write. It's optional use is discussed more fully later on.

Taking a snapshot of a floppy disk

Typing:

    ex replicon.ex snapshot a floppy.img

will read the data contained on the 1.44 megabyte floppy disk in drive A and write it to the file called "floppy.img".

Restoring a snapshot of a floppy disk

Typing:

    ex replicon.ex restore a floppy.img

will read the data contained in file "floppy.img" and write it to the 1.44 megabyte floppy disk in drive A.

Note that the floppy disk must at some point prior to this have been formatted. The floppy does not, however, need to be blank (empty) as any current content on the floppy will be completely overwritten.

Taking a snapshot of the primary master IDE/EIDE hard disk

Typing:

    ex replicon.ex snapshot c harddisk.img

will read the data contained on the primary master IDE/EIDE hard disk and write it to the file called "harddisk.img".

Note that if the system was booted from from the primary master IDE/EIDE and is running an operating system other than DOS then this method of taking a snapshot image of the primary master IDE/EIDE hard disk may not work. Operating systems such as Windows NT 4.0 do not take kindly to applications attempting direct access to the low level hardware. For this reason it is recommended that the system is booted from a floppy disk and that replicon be run from this environment.

Restoring a snapshot of a primary master IDE/EIDE hard disk

Typing:

    ex replicon.ex restore a harddisk.img

will read the data contained in file "harddisk.img" and write it to the primary master IDE/EIDE hard disk.

Note that the system should not have been booted from the primary master IDE/EIDE hard disk. It is not advisable to overwrite the currently running operating system! Boot the system from a floppy disk and then run replicon.

Using the optional cylinder count command line parameter

Replicon will operate on all the cylinders of the floppy disk or primary master IDE/EIDE hard disk. It is possible to have replicon operate on only the first X number of cylinders. For example:

    ex replcion.ex snapshot a halfdisk.img 40

will only copy the first 40 cylinders.

This facility is only really useful when working with the primary master IDE/EIDE hard disk. For example if the hard disk has 600 cylinders it could be paritioned into two areas. The first partition could be 130 cylinders and the second partition 470 cylinders. The first 130 cylinders could be formatted as the logical C drive and the remaining 470 cylinders as the logical D drive. Now, after booting from a suitable floppy which contains replicon, you could run replicon as follows:

    ex replicon.ex snapshot c d:\imageone.img 130

Next you could install a different operating system into the logical C drive and take a second snapshot:

    ex replicon.ex snapshot c d:\imagetwo.img 130

Now you could select which image to restore with either:

    ex replicon.ex restore c d:\imageone.img 130

or:

    ex replicon.ex restore c d:\imagetwo.img 130

This is a handy way to experiment with two different operating systems. Infact the sizing in this example would allow for a third image as follows:

    ex replicon.ex snapshot c d:\image3.img 130

Use network resources

For more flexible use it is advisable to have a bootable floppy disk that maps at least one logical drive letter to a network share. Let's say the logical drive letter 'I' is mapped to a network share which has plenty of space. Now it is easy to run:

    ex replicon.ex snapshot c I:\nwimage.img

to create a snapshot or type:

    ex replicon.ex restore c I:\nwimage.img

to restore. If you have a network share available that has plenty of space then it is possible to create many different snapshots. It's a great way to experiment with a range of different operating systems. Infact it was this requirement which motivated the author of replicon to code it in the first place!

The following Microsoft FTP site/directory:

    ftp://ftp.microsoft.com/bussys/clients/msclient/

contains two setup diskettes:

    dsk3-1.exe
    dsk3-2.exe

which provide the networking capability to connect to Windows type shares on a network. With appropriate network drivers, a bootable DOS 6.20 floppy disk and a ram drive utility it is possible to make a boot disk that can access such network shares. However the exact details are beyond the scope of this document

Limitations

Replicon only works with floppy disks and the primary master IDE/EIDE hard disk. Also the primary master hard disk must be smaller than around 1024 megabytes (one gig) which is, currently, quite a limitation.

SCSI hard disks are not supported at all.

Dangers

Any program that uses low level disk sector writes has the potential for fatal corruption of data on the floppy disk or (more seriously) the primary master IDE/EIDE hard disk. Only run replicon if the concepts behind it are understood. Start using replicon with just floppy disks first and then progress to using replicon on the primary master IDE/EIDE drive.

Bugs?

Please report bugs to the author via email.

Comments on replicon are also welcome :-]

Contacting the author

Try one of the following email addresses:

    freecode@zensearch.net

    freeplay@mailandnews.com

You could also try posting a message to the Euphoria mailing list which is currently hosted at:

    http://www.topica.com/lists/EUforum/
    Euphoria Programming Language

Just mention "replicon" and "freeplay" :-]

Other stuff

As with all "free" software I supply it comes "as is". Use at your own risk. Infact be really really careful because one wrong move could have your entire hard disk wiped.

If you find replicon useful then please pass a copy of it (and the documentation) to a friend.

FINALLY!!!

Please remember...

    ALWAYS BACKUP YOUR DATA *BEFORE*
    USING REPLICON OR ANY OTHER
    UTILITY THAT ACCESSES FLOPPY DISKS
    OR HARD DRIVES DIRECTLY !!!!!!!!!!

Basically, be careful!


Last updated 23 November 2001