IMG DISK

Copyright (C) 2012 Stephen Harris

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

===================================================================
Full GPL

This program is designed for TurboMMC and Solidisk DDFS but should work with any of the MMC boards and any DFS.

Basically it reads a floppy 2 tracks at a time and writes out the results as a small file onto MMC drive 1 and 3 (parts 1->19 are on drive 1, parts 20->39 on drive 3). In that way all 80 tracks of a disk are copied. Then on the PC these files can be extracted and combined to create the real disk image. Of course this is unlikely to fit onto an SSD so the results would need to be extracted and new disk images built. This process is designed to merely get the raw image in the first place.

Track read errors are noted and the bad sectors are filled with "E5" (as if the disk had been newly formatted). This makes it easy to spot errors.

e.g to extract and combine to form an image using my perl utils:

rm -rf part1 part2
beeb dgetfile 1 part1
beeb dgetfile 3 part2
cat part1/PART?? > disk_img.ssdd
rm -rf part1 part2
Now you can do things like "beeb info disk_img.ssdd" to read the new image.

Here we can spot a bad track (which was reported as track 11)

beeb dump disk_img.ssdd | grep '^B0' | head
B000 E5 E5 E5 E5 E5 E5 E5 E5  ........
B008 E5 E5 E5 E5 E5 E5 E5 E5  ........
B010 E5 E5 E5 E5 E5 E5 E5 E5  ........
B018 E5 E5 E5 E5 E5 E5 E5 E5  ........
B020 E5 E5 E5 E5 E5 E5 E5 E5  ........
B028 E5 E5 E5 E5 E5 E5 E5 E5  ........
B030 E5 E5 E5 E5 E5 E5 E5 E5  ........
B038 E5 E5 E5 E5 E5 E5 E5 E5  ........
B040 E5 E5 E5 E5 E5 E5 E5 E5  ........
B048 E5 E5 E5 E5 E5 E5 E5 E5  ........
In order to switch between DFS and CARD formats we also swap around memory between &D00 and PAGE; in that way DFS usage won't corrupt CARD usage and vice-versa. We also swap a few zero-page memory locations to be safe. We temporarily disable the CARD ROM when in DFS mode to prevent it from stealing the OSWORD &7F calls. Some DFSs (eg Solidisk) cause a BRK if there is a read error which makes coding harder; we use "ON ERROR" to catch this and this also means we can't just use FOR/NEXT loops; the loops break when an error occurs!

The BASIC listing of the program to copy disks to SSD.


Last modified: Thursday, 29-Mar-2012 12:28:19 EDT