Dumping old Olivetti M20 Floppy Disks
The Olivetti L1 M20
Back in the 1980’s my uncle owned a company for photo lithography. Eventually they needed a computer for adminstrative tasks and got a rather exotic Olivetti L1 M20. For the curious, the M20 has the following specs:
- Zilog Z8001 16 Bit CPU
- 128kb to 512kb RAM
- PCOS Operating System
- Built 1982-1984
- 512x256 Graphics, 4 or 8 colors, depending on the available memory board in use. The M20 has no text mode and generates all graphics using pixels.
Years later, when the Olivetti was no longer used and I was asked if I would have “any use” for the machine, I of course said immeadialtely “yes”. Besides a few initial tests with the machine in the 1990’s, I never turned the machine on again (but maybe I will after this deep dive in M20 disk internals).
Alongside with the M20, I received some, now very aged, 5ΒΌ" disks. Since I also have a Kryoflux, let’s try to find out what they reveal.
Workflow
To dump the M20 disks, I use the following workflow:
Floppy Disk to raw disk image
conversion workflow
+----------+ +----------+ +----------+ +----------+
| 5.25" [ | | | 3 |+ | |
| Disk | | kryoflux | | RAW ||+ | RAW |
| O +--------->+ stream +--------->+ images |||-------->+ image |
| | kryoflux | files | kryoflux | ||| dd | |
| | dtc tool | | dtc tool | ||| | |
+----------+ +----------+ +----------+|| +----------+
+---------+||
+----------+
The steps in detail
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
Create a Kryoflux stream file of the disk
To create a Kryoflux stream file, I use:
> dtc.exe -fM20_Assembler/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.
Create the RAW image
We use the dtc
tool to create a raw disk image containing only the sector
data from the stream files:
$ dtc -m1 -fM20_Assembler/dump -i0 \
-fM20_Assembler/M20_Assembler.raw \
-s0 -e34 -os0 -oe34 -z1 -i4 \
-l8
KryoFlux DiskTool Console, v3.00_Linux_x86-64_LU, uiv.1, Feb 24 2022, 17:12:23
(c) 2009-2022 KryoFlux Products & Services Ltd.
Developed by The Software Preservation Society, www.softpres.org
Licensed for private, non-commercial use only.
Stream file: M20_Assembler/dump
00.0 : MFM: <unformatted>
00.1 : MFM: OK*, trk: 000, sec: 16, *H +10
01.0 : MFM: OK*, trk: 001, sec: 16, *H +10
01.1 : MFM: OK*, trk: 001, sec: 16, *H +14
...
Besided track 00.0 everything could be read. Let’s see if the image works …
Read files using m20 floppy tools
The image we just created can now be read with Christian Groesselers
m20 floppy tools
, that’s a first success:
$ m20 M20_Assembler/M20_Assembler.raw lsl
Volume name: ASSEMBLER
# of files: 15 free blocks: 8
NAME SIZE BLOCKS ALLBL EXTENTS
-------------- ---- ------ ----- -------
PCOS.SAV 41634 163 303 1
asm.abs 52436 205 206 1
asm.bin 7996 32 33 1
asm.cmd 999 4 5 1
edit.cmd 28074 110 111 1
fkill.cmd 1263 5 6 1
flist.cmd 1702 7 8 1
hexdump.cmd 786 4 5 1
link.cmd 49939 196 197 1
mlib.cmd 12273 48 49 1
pdebug.cmd 10055 40 41 1
tdump.cmd 18413 72 73 1
textdump.cmd 6080 24 25 1
vlist.cmd 3142 13 14 1
_tlocs 2 1 4 1
Test the image with MAME
The famous “Multiple Arcade Machine Emulator” (MAME) has also an Olivetti L1 M20 emulation. Let’s try to see if our freshly created disk image can be booted there:
$ mame m20 -rompath . -bios 2 -flop0 M20_Assembler.raw
That did not work. The disk does not boot and is not readable in the emulator. So we have to dig a little bit deeper …
Anatomy of a M20 disk
Reading
howto’s,
reverse engineering existing images, and poking around with the Kryoflux dtc
tool, I realized that the disk format is a rather unusual FM/MFM mixture of
tracks: track 0, head 0 is FM formatted with 16 sectors * 128
bytes (=2048 Bytes/track) while the rest of the disk is MFM formatted with 16
Sectors * 256 bytes (=4096 bytes/track):
<Track>.<Side> | Format |
---|---|
00.0 | FM, 16 Sectors * 128 Bytes |
00.1 | MFM, 16 Sectors * 256 Bytes |
(rest) | MFM, 16 Sectors * 256 Bytes |
In a raw disk image file for the MAME M20 emulator however, all sectors are assumed to be 16 * 256 bytes = 4096 bytes sized.
Create the RAW image, 2nd try
My new strategy is to convert the raw stream using different settings for track
00.0 and the rest of the disk. Unfortunately I could not figured out how to
write the raw image with a single invocation of dtc
. So I converted the
stream in 3 chunks: Track 00.0 (2048 bytes), Track 00.1 (4096 bytes) and the
remaining 34 tracks (34 * 2 * 4096 bytes). Next these 3 chunks are assembled to
the final image with dd
, but right padding the first chunk (track 00.0) with
2048 bytes of 0. In total, we now have an image of 35 * 2 * 16 * 512 bytes =
286720 bytes.
For convenience, I have provided a script here.
Final test with MAME
Let’s try to boot the disk we just created with MAME:
This time, it looks good, MAME successfully booted PCOS. The vlist
command
shows all files on the disk and programs can be started.
Summarizing, making bootable images of M20 floppy disks was a bit harder then what I experienced when i dumped floppy disks of the Sharp MZ-800, due to the mixed FM/MFM format. But equipped with this knowledge and some scripting, bootable images could be finally built.
References
- Olivetti M20
- Christian Groesselers m20 floppy tools (Mirror)
- Emulating the M20 with MAME
- My M20 disk conversion script
- Not used here, but useful: floptool - Generic floppy image manipulation tool for use with MAME