Dumping old Sharp MZ-800 Floppy Disks
After the Atari 600XL, the Sharp MZ-800 was my second computer, back in the 80ies. Since I still had the computer and a box of more 35 year old 5.25" floppy disks, I was curious to see my early works as a teen aged programmer.
Luckily, I also had the original Floppy drive around (Teac FD54B, 40 Track). My plan was to connect the drive to a Kryoflux USB floppy adapter and dump the disks in the Kryotec stream file format and then convert the stream files to disk images in the extended DSK image format which is supported by my favorite MZ-800 emulators.
The advantge of using Kryoflux stream files is that you only need to read the disk physically once. After that, all further conversion and analysis will be performed on the stream file. Since the image is something like the raw bit stream as seen by the floppy disk controller, it’s size is much bigger than the actual disk size (~20-30MB).
During the conversion, I discovered different types of disk formats used on the MZ-800 which made it necessary to use different tools for the conversion:
- Standard MZ-800 Basic disks (40 Tracks, 16 Sectors, 256 Bytes/Sector)
- ORG-F (my favorite assembler back then) (40 Tracks, 10 Sectors, 512 Bytes/Sector)
- CP/M Disks (mixed sector format, see below)
Workflow
The general workflow is as follows:
Sharp MZ-800
Floppy Disk to Extended DSK image
conversion workflow
+----------+ +----------+ +----------+ +----------+
| 5.25" [ | | | | | |
| Disk | | kryoflux | | MFM | | EDSK |
| O +--------->+ stream +--------->+ image +---------->+ image |
| | kryoflux | file | kryoflux | | samdisk | |
| | dtc tool | | dtc tool | | | |
+----------+ +----------+ or +----------+ +----------+
disk-analyzer
Step-by-step
Note that the Teac FD54B drive used here is a 40 Track drive. All dtc
examples are shown for this drive. When using a 80 Track drive, e.g. a Teac
FD55GFR, some of the commands need different parameters.
Calibrate the drive
First we need to calibrate the drive and check if the Kryoflux is working:
TEAC FD54B:
> dtc.exe -c2
CM: maxtrack=41
Looks good. Running the command with a TEAC FD55GFR yields, as expected, CM: maxtrack=83
.
Create a Kryoflux stream file of the floppy disk
To create a raw Kryoflux stream file, I use:
> dtc.exe -fdisk1/dump -p -i0
-f<path>/<file>
- target filename-p
- create paths-i0
- create raw stream
Order of options is important, -ix
must preceeded by other options.
The next steps depend on the kind of disk we have (Basic, ORG-F, CP/M).
MZ-800 basic disk images
The standard disk format of MZ-800 basic disks (320KB) is:
- 2 sides,
- 40 Tracks
- 256 Bytes/Sector
- 16 Sectors
Create a MFM image of MZ Basic Disk Format
We call dtc
to convert the stream file to an MFM image with the above
described format:
> dtc -m1 -fdisk1/dump -i -fdisk1/dump.img -n16 -z1 -e39 -oe39 -i4 -l8
The image is written to the disk1
directory to a file called dump.img
.
Explanation of the options:
-m1
- operate on images-fdisk/dump -i
- input image is in kryoflux stream file format-fdisk/dump.img
- output file-n16
- 16 sectors-z1
- 256 bytes/sector-e39
- end track-oe39
- output image end track-i4
- format:MFM sector image, 40/80+ tracks, SS/DS, DD/HD, 300, MFM
-l8
- limits console output
Example output of the dtc
command:
KryoFlux DiskTool Console, v3.00_Win32, uiv.1, Apr 15 2018, 23:45:03
(c) 2009-2018 KryoFlux Products & Services Ltd.
Developed by The Software Preservation Society, www.softpres.org
Licensed for private, non-commercial use only.
Stream file: dump
00.0 : MFM: OK*, trk: 000, sec: 16, *H +12
00.1 : MFM: OK*, trk: 000, sec: 16, *H +4
01.1 : MFM: OK*, trk: 001, sec: 16, *H +5
...
39.1 : MFM: OK*, trk: 039, sec: 16, *H
40.0 : MFM: <unformatted>
40.1 : MFM: <unformatted>
Enjoy your shiny new disk image!
Please consider helping us to preserve media and continue development:
www.softpres.org/donate
For an 80-Track drive, the dtc
invocation would look like:
> dtc.exe -m1 -fdisk1/dump -i -fdisk1/dump.img -n16 -k2 -z1 -i4 -l8
-k2
- read 40 track disk in 80 track drive
Create the EDSK image for the emulator (Basic format)
The last step converts the MFM image file from the previous step to an Extended DISK (EDSK) image, which can be used in MZ-800 emulators.
This is accomplished by the SAMDisk tool. Important: use Version 4.0 (from github).
> SAMdisk disk1/dump.img disk1/disk1.dsk -k0 -c40 -s16 -z1
-k0
- set inter track skew to 0-c40
- 40 tracks-s16
- 16 sectors-z1
- 256 bytes/sector
The resulting file, disk1/disk1.dsk
can now be mounted in your favorite
MZ-800 emulator and booted.
ORG-F assembler disk images (400kb)
Create an IPF disk image
ORG-F (my favorite assembler back then, but more on this in a later post), uses
a 400KB format: 40 tracks, 10 Sectors, 512Bytes/Sector. I had now luck
creating a MFM disk image with the dtc
command. Luckily there is a project
called Disk-Utilities which provides
a tool called disk-analyze
which does the job. We switch now to Linux, since
the Disk-Utilities are only available there.
We call disk-analyze
to create an IPF
(image preservation
format) image from the stream file:
$ disk-analyze -v --format=ibm_mfm_dd -e0 -e39 disk1/dump disk1/dump.ipf
Found format "ibm_mfm_dd"
PLL Parameters: period_adj=5% phase_adj=60%
T0.0: IBM-MFM DD (10 512-byte sectors, 5120 bytes)
T0.1: IBM-MFM DD (10 sectors, 4864 bytes) <----- different
T1.0-39.1: IBM-MFM DD (10 512-byte sectors, 5120 bytes)
Running disk-analyze
also reveals a different format on track 0 on side 1,
perhaps that’s the reason why dtc
failed with these kind of disks.
Then again we use SAMdisk
to create the actual EDSK image for the
emulators…
Create the EDSK image for the emulator (ORG-F)
$ samdisk orgf.ipf orgf.dsk -c40 -i0 --verbose
Found format "ibm_mfm_dd"
PLL Parameters: period_adj=5% phase_adj=60%
T0.0: IBM-MFM DD (10 512-byte sectors, 5120 bytes)
T0.1: IBM-MFM DD (10 sectors, 4864 bytes)
T1.0-39.1: IBM-MFM DD (10 512-byte sectors, 5120 bytes)
250Kbps MFM, 10 sectors, 512 bytes/sector, h=1, gap3=39:
0.0 11 16 12 17 13 18 14 19 15 20
1.0 11 16 12 17 13 18 14 19 15 20
...
38.1 1 6 2 7 3 8 4 9 5 10
39.1 1 6 2 7 3 8 4 9 5 10
The resulting orgf.dsk
file can be booted in a MZ-800 emulator.
CP/M disk images
Create an IPF disk image
Like the ORG-F disk, we must use the disk-analyze
tool here to create
an IPF
image first:
$ disk-analyze -v --format=ibm_mfm_dd -e0 -e39 dump dump.ipf
Found format "ibm_mfm_dd"
PLL Parameters: period_adj=5% phase_adj=60%
T0.0: IBM-MFM DD (8 512-byte sectors, 4096 bytes)
T0.1: IBM-MFM DD (16 256-byte sectors, 4096 bytes)
T1.0-39.1: IBM-MFM DD (8 512-byte sectors, 4096 bytes)
250Kbps MFM, 8 sectors, 512 bytes/sector, gap3=170:
0.0 1 5 2 6 3 7 4 8
1.0 1 5 2 6 3 7 4 8
...
38.1 1 5 2 6 3 7 4 8
39.1 1 5 2 6 3 7 4 8
Then again we use SAMdisk
to create the actual EDSK image for the
emulators…
Create the EDSK image for the emulator (CP/M)
$ samdisk dump.ipf 064-CMP_4.dsk -c40 --verbose
Conclusion
It took me a time to figure out the different disk formats and tool settings. But once set up, everything ran smoothly. Overall I dumped about 75 disks, from which only 4 failed badly (94% success rate). It was definitely worth the effort, since I found lots of basic and assembler programs I wrote back then when I hacked on the MZ-800 as a teenager. Once I’m through all the disks, I’ll feature some of the programs in a blog post.