Usage of the program "Drive image", ST & ZX file transfer


This program is intended for diverse data transfer and storage operations with media (drives, disks). The main option is the creation of image files, and its reverse operation - copying from image to media. Such image files are useful as backups or as images suitable for various emulators. The program works with the 'hard drive' category of media - to these belong: IDE, SCSI hard disks, PEN drives, diverse FLASH storage cards as well as Compact Flash & SD cards - they usually attach via some USB card reader to PC. 
File transfer may happen directly from/to attached disk/media or from/to an image file.

dr126.pngSelection of drive: single click on its line in the left list window. Then the program attempts to detect the filesystem which is used on that medium.
· 'DOS mbr' means usually that it is a hard disk in the PC - so better don't write to it!
· GemDos is used by Atari ST and compatibles.
· PLUSIDEDOS is used by Spectrum +3e and some other clones.
· 'Charea DoS' is my own system, in which 36 areas begin with the characters A-Z and 0-9.
The Refresh button (the two green circular arrows) forces re-detection of all drives - in case you connected or disconnected something. Underneath you may set the offset for the start of disks and count of sectors if want to read/write only a segment of a drive.

Since it is not possible to detect correct CHS parameters via USB readers, there is the possibility to enter them manually.

The Program usually offers usable values for Compact Flash cards. With click on 'Size CHS' you may change the detected drive's size, if needed. That size remains until the next drive selection. 'LBA' is required only for disk Init (ZX), see below.

With a click on 'Open image file' you may select an image file instead of a drive. You may then even perform conversion RAW-HDF or HDF-RAW. Just click after selecting an image file on 'Read from sel'd', and the program will convert.

If 'Swap L/H' is checked, the program will swap the Low/High bytes by reading from drive to the image file or by writing from the image file to the drive. This is for Atari ST disks used with IDE interface, where MSB/LSB order is reversed in comparison to PC. When such a drive is selected 'GemDos SW' will appear as filesystem in the 'Info' block. Converting an image file to reversed L/H ordered is easy: open the image file, check 'Swap L/H' and click 'Read from sel'd' . Type a filename and save it...

The program gets CHS parameters from hdf files, but for RAW this is not possible (except when Charea DoS FS is on, see below - Guess geo.), so enter them manually if needed - in case of (older) image files for usage with CHS ROMs.

The program will ask for extra confirmation in case of attempting to write to a drive over 2 GB - to prevent accidental writing to PC hard disks, which would result in destroying partition records and data on these.


Limitations: works only in Windows XP and newer versions. Admin rights are required to read/write on drives.

Speed: Since version 1.32 speed is significantly improved.
It depends much on the used media and connection. I get over 10MB/sec with SanDisk Ultra II 2GB CF card for reading, but only when connected to the IDE controller of MB (via CF-IDE adapter). With a cheap USB card reader the speed is about 2.5MB/sec for the same card. Writing to FLASH cards is usually 2-3 times slower than reading.


Atari ST GemDos, DOS16 & BigDOS file transfer & partition extract

When a GemDos or DOS MBR (partition table) with FAT16, BigDOS partitions (or just a single partition without MBR) is detected, the following dialog will open after clicking on 'File transfer' :

gemdfb.pngIt works with GemDos AHDI 3.0 spec. partitioned hard disks, and media or image files of those (img, raw).

It also works with DOS FAT16 and BigDos(x) partitions - primary and in Extended and EXTNDx partitions.

Limitation:  works correct only up to 2GB locations on disks or image files. So, use it with max. 2GB disks, or image files.

Select a partition in the right box, and the program will list its root directory in the left box.

You may select multiple files or directories at once. 'Extract' copies the selection (with subdirectories and their content) to the current destination-directory on the PC, which can be chosen with the 'Dest Dir' button.

The buttons 'Dir Up' and 'Open Dir' are for navigation in GemDos partition's directories.
A subdirectory can be opened with a double-click on its name too.

'Add files' is of course for copying files from PC to attached disk/media or to an image file. Multiple files may be added at once, but not subdirectories with their content. Below is selectable whether the timestamp of added files will be the current time or the original file's timestamp.

'New folder' : creates a subDir (with a name typed in the 'Folder name' box below) in the current ST dir. Use capital letters.

Sunken button 'Partitions' is for extracting an image file of only the selected partition. From drive or image file. In case of swapped L/H it will be saved in normal order, so you may access the partition with common tools. It also sets 'Sectors from start' and 'Sector count' to the position of the selected partition in the main window (just close the file selector without save). So advanced users may insert a partiton with new content in a disk or an image file. It is a dangerous operation, so do it only if know what are you doing.

Drive image works now with AHDI (GemDos) spec. disks (or image files) with reversed (swapped) (IDE interface) byte order too. The program will autodetect the byte order ('GemDos SW' will appear for reversed ones), and will do all necessary swappings.


New option at ver. 1.28: Seeking partitions. If for some reason the partition table is damaged, the program can seek FAT16 partitions. The list of partitions is empty then, or some partitions missing. Click on 'Seek P' button, and the list of partitions will appear to the left, instantly - in case that they are not damaged/overwritten.

partseek.pngThe first value is the sector offset from start, then size in MB and 'Ext' if it is an extended partition. Clicking on 'Write PT' (Write Partition Table) writes this partition table to the image in GemDOS format.
Before this the program will save the current partition table (MBR sector) - give the file some memorable name.

'PT from file' will write the partition table in the image or drive from the selected file. Thus you may restore the original or make some experiments.

Seeking partitions combined with partition extract offers some new possibilities - as making a custom order from selected partitions. You can extract partitions and then just make one combined file of them using the copy command. For now only 4 primary partitions may be combined this way. Thereafter seeking will create a new partition table...



ZX file transfer:


Before clicking on the 'File transfer' button make sure that the Image format is set correctly. The program usually sets it automatically, but sometimes you may need to set it manually. For 8-bit simple IF drives or images must set HDF 256.

ZX > PC:

You can extract ZX files from drives or image files (raw or hdf format). After selecting a drive from the list or file with 'Open image file' click on 'File transfer' - it is designed for the Charea DoS system, used by hard disk and CF ROMs (zxcflba.rom, zx8bide.rom & zxide.rom) on this site. If you get a mess instead of lists probably CHS is incorrect. For LBA it is 'standard' 32 Sector/track and 8 Heads. Clicking on 'Guess geo.' may detect and set correct drive geometry.

drchabr.png

On the left select Charea, then clicking on files in the middle box selects them for transfer - they appear in the right box. With 'Save sel.' they will be transferred to PC.

The resulting file may be TAP file, Z80 snapshot. If the length ( last column at Cat: ) is 49152 it will be Z80. It is possible to save ZX files directly, without header - just check 'Save bin.', and all will be saved so, with the extension bin. You may select max. 32 files at once. However, it is not wise to select a lot of files for TAP at once - because all will go into a single TAP file. The best way is as shown on picture above - first select BASIC loader and thereafter CODE. Most of programs are recorded this way.

'Erase sel.' is for erasing ZX files. It works a bit unusual - it may erase only the last file in charea. But you can select again multiple files, just select them in the order from last to up - you may select from different chareas at once.

With click on 'Chareas' the program will set the segment for just currently selected charea - to make easy save/write of individual chareas of drives.

PC > ZX:

Click on the 'PC > Cha.' button, and you may select multiple files with the Windows fileselector:
chabr2

Supported filetypes are:

SCR - ZX screen, exactly 6912 bytes long.
SNA - old snapshot files.
Z80 snapshot - V 1.45, V 2.01 & V 3.0, only for 48K, for now.
Plus TAP files and BINary files - bin ones will be copied directly as CODE files, with start address 25000, max len. 48KB.
Transfer mode depends on the file extension.

Because authors of software, and especially 'authors' of TAP files had pretty limited naming imagination, and to prevent seeing too often a message like: chabr3 I implemented some autonaming system.
In case of duplicate names in TAP file, the program will rename it to re.xxx.PCfilename.
're' may be changed in editbox 'Rename:'.
xxx is auto-counter in range 1 to 255.
If the first character is illegal (not A-Z, 0-9) it will be changed to 9.
Codes above 127 and below 32 in filenames will be changed to '?'- to make editing easier.

After getting such renamed files it is good to correct the BASIC loader and to save the data with some meaningful names:
Corrections will be necessary for commands like:
LOAD "" - it is not allowed by disk systems, so enter in the brackets the filename.
My ROM also doesn't accept LOAD "pic" SCREEN$ - change it to LOAD "pic" CODE [16384].
Luckily, the ZX filesystem is case sensitive, so you may play with RePTON, rEpToN etc... .

In some cases a transferred snapshot will not work - this is because of limited hardware. Stack may be overloaded. In such a case it helps to make another snapshot file on the PC (or to look for another one on WEB).
Rule is: make the snapshot when the game is paused.
In case of 'Name already exists' by snapshots just simply rename the PC file...

Some TAP files have headerless (and nameless) parts - such blocks will be transferred to files with names: hl.1.PCfilename, hl.2.PCfilename etc.
Of course, here it's also possible to change the prefix 'hl' to something different in the editbox 'H'less:'.
You must then find a way how to load those files later normally - some machine code knowledge is necessary.
For experts: If I reg points to ROM, it must be #39 for IM 2 mode, because ROM is full with code.


Image creation:
In the main window, at the top right is the button 'Create img'.
It will create an empty image file, using the format according to the entries in the 'Image format' box, and the geometry according to the entries in the 'CHS setting' box.
Recomended is the usage of HDF format - it holds all necessary parameters. For 8-bit simple IF HDF 256 format is required.


Initialization of a ZX disk or image file:


drinit.png Before usage the disk (media) must be initialized, i.e., a filesystem must be created. It is something like partitioning on PC.

Select drive or Open image file.
Set the geometry as needed (it can't be autodetected in some cases).
For zxcflba.rom (CF interface) click the 'LBA' button - this will set the correct parameters for init (32 sec/tr & 8 heads).
Check that the Image format is correct (for 8-bit simple IF it must be HDF 256). Then click on 'Init' at the top right.

The program divides the space by criteria how much begin letter is common. So, much more space for S than for Q.

In the listbox is the begin letter, then the total capacity of its charea and the number of CAT slots - this many files can be stored there. By clicking on a charea in the listbox its parameters will appear in the setboxes to the right. There you may adjust the size and slot count. Below you will see total size of all chareas. Most important is to watch the 'Free:' indicator. If it turns negative, you must decrease the size of some charea(s). Otherwise the last charea(s) will be outside of the disk's capacity.
The small setbox 'Data at:' is for setting the start cylinder of the first charea. The standard is 1, but in some cases it may be bigger, up to 9. It can't be 0 (at start is Master CAT). After typing in the value, click on 'Data at:' to enter it. And you may need to decrease some sizes thereafter...

The old filesystem has some limitations:
Max. size of charea is 32MB by CF and 16-bit IF, and 16MB by 8-bit simple IF.
Count of CAT slots is limited to 4064/2032.
Still, there is a lot of space: in 16MB can fit over 330 snapshots.
Max. size of drive/media which can be fully used is about 1.1 GB.

The new filesystem with big sectors has max. charea sizes of 64MB for all types of interfaces.
Check 'Big Sectors' for such ROMs before 'Init'.
It makes sense only for larger drives/media - over 500MB.
Fillable media size is then 2.2 GB (4.4 GB for 8-bit IF).

When you click on the button with the long text, after confirmation, the disk/image will be initalized and ready for usage.
You may imediately check it by entering 'File transfer' .





July 2006 - July 2007, P. Putnik