Page 1 of 3

Write a Mac 400/800K sector image using Kryoflux

Posted: Mon Dec 07, 2015 1:37 am
by SomeGuy
After some fuzing, I found a way to write a Macintosh 400/800K sector image from a PC using a Kryoflux.

Mac 400K/800K 3.5" low-density disks are an unusual format because they use GCR like an Apple II, do not require an index pulse, have different numbers of sectors per track, and use variable bit rates depending on the track.

For this I used the PCE Tools located here: ...
and HxC located here: ...

Basically, the PCE Tools (PSI, PRI, PFI) should be able to do the conversion itself, but it currently has some bugs, or I'm doing something wrong that I haven't figured out yet.

First, start with a sector image of an 800K Mac disk in DiskCopy 4.2 format. At the moment, raw images will need to be converted to DiskCopy 4.2. There should be some tools out there that can do this, but I couldn't find any off hand. According the the change logs, the next release of the PCE tools should support a "MAC" raw sector image type in addtion to "DC42", so conversion should not be needed. Just slapping a header on won't work because it checks the file CRC against that recored in the header.

With the DC42 image named "test" do:

Code: Select all

psi test.dc42 disk1.psi 

pri -p encode gcr disk1.psi disk1.pri -f -v

pfi -p encode pri disk1.pri disk1.pfi

pfi disk1.pfi track00.0.raw
This will output a Kryoflux stream file that in THEORY should be writable by the Kryoflux, but it isn't. The recorded RPM and possibly other data is wrong and the Kryoflux will think the file is blank.

So next, open the file in the HxC disk tool and re-save it as a Kryoflux image. Note that the HxC tool does not know how to decode Mac 400K/800k variable bit rate disks, but it will convert the stream file anyway.

THIS stream file can now be written to a floppy disk, although it seems to still have some invalid RPM info.

I tested writing an 800K image to a double density disk and it was readable on a Power Mac. It is possible that the low-level format written has some issues, but it is readable.

More information:

Tracks Sectors RPM Clock/KBps
00-15 12 393.3807 381310
16-31 11 429.1723 349510
32-47 10 472.1435 317700
48-63 9 524.5672 285950
64-79 8 590.1098 254190

The Macintosh implements the variable bit rate by spinning the drive motor at different speeds while writing the same data rate at the head.
The Central Point Deluxe Option board implements the variable bit rate by controlling the rate in its digital hardware.
The Kryoflux implements variable bit rate decoding in software. (does not support encoding sector images).

The PCE tools create the stream file as if it were read in a Mac drive with variable RPM. It does this because the PCE emulator simulates a Macintosh drive at a closely accurate hardware level. This is unlike images of real Mac disks read by the Kryoflux, which will always have 300RPM on all tracks.

Kyroflux must write this to a PC drive at constant RPM by varying the write data bit rate. Additionally PC 720K/1.44mb drives are not really designed for anything other than 250Kbps on low-density disks - but it seems to work well enough.

Also, the Apple Lisa 3.5" disk format use extra sector tags, however Apple II Prodos/GSOS 3.5" disks and Macintosh disks do not. This means Lisa images can not be stored as raw sector images, only Mac DiskCopy 4.2 images.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Mon Dec 07, 2015 9:40 am
by spags
That is a great write-up. Thanks for sharing your research and results. Based only on reading your post, I would concur on your "seems to work well enough" comment; it may work many times but probably not all times.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Thu Mar 17, 2016 7:12 pm
by SomeGuy
There is a new update to PCE and the tools: ...

With this version, you can now use "raw" 400 and 800k sector images instead of just DC42.

For example with an 800k image instead of the first line above, use:

psi test.img disk1.psi -I mac

You still have to run the resulting KF stream file through HxC, but this eliminates the step of converting IMG files to DC42.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Fri Mar 18, 2016 3:51 pm
by IFW
Nice :)

Note: you do not need a drive running at a specific RPM to read/write a disk designed for a different RPM.
When you change the RPM on a drive, you effectively make the flux transitions shorter or longer if such written data was read at a constant RPM rate.
Consequently, instead of changing the RPM (which no commercial duplicator ever did, apart from 600 RPM drives for double speed writing) you want to change the flux reversal times - the result is exactly the same data.

It does not matter for KryoFlux what the source or the target drive RPM is.
The source RPM is being sampled during imaging the disk.
Whatever you do, eventually you end up with a stream of flux transitions that you want to write - those effectively contain an absolute timing you want to achieve at a target RPM.
The target RPM is constantly being monitored during writing and the flux reversal are generated in a way that matches both the target RPM and the RPM being monitored.

One thing however that does matter is the ability of the drive to actually work with longer flux reversals without the AGC kicking in (this is in the drive, and can't be controlled), hence some drives are unable to correctly read Mac disks, others are fine.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Fri Mar 18, 2016 9:36 pm
by spags
So just thinking this through in regards to reading Mac disks, I wonder (under the right circumstances) if it may be possible for a poorly reading drive to give better results by intentionally increasing the RPM of the drive. That is assuming that the Kryoflux can do sufficient sampling to capture the shortest reversals.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Sat Mar 19, 2016 9:36 pm
by IFW
Yes, if you could double the RPM, the AGC tuned for HD flux transitions would see the DD or worse as HD, hence they could actually read the flux reversals correctly :)

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Sat Mar 19, 2016 9:38 pm
by IFW
Although nothing to do with reading disks in drives with HD fine tuned AGC:
Some commercial duplicators used 600 RPM drives for writing -> half the time for a disk.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Sun Mar 20, 2016 3:44 am
by SomeGuy
Yes, the above method is for writing a Mac variable bit-rate disk with just a standard 300RPM 720k/1.44mb drive and a Kryoflux. It does require the use of a low-density (720k) floppy disk, or a 1.44mb disk with the density notch covered. It is good to know the Kryoflux should be able to deal with any other drives that spin at different rates.

I'd be interested to hear if this method works for other people and on other Macs. I've heard that earlier (single sided 400K) Macintosh drives can, in general, be a bit finicky.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Sun Mar 20, 2016 9:42 am
by IFW
About the density notch covered on HD disks "making them DD": don't, or expect poor writes and reliability.
The coercivity required for the HD domain is different from DD and you change that via the HD sensor.

Re: Write a Mac 400/800K sector image using Kryoflux

Posted: Wed Sep 07, 2016 12:39 pm
by Specfreak
Interesting stuff about Mac Disks.
A Work Colleague rocked up with a Mac 1.44 formatted disk. I have no idea if it's good to begin with,
so I've dumped it as Stream and then a few other formats. Not sure what I should be outputting it as or what can access it. I made a 1.5MB IMG file (MFM Sector Image) as the others were too small or skipping tracks.
Anyway, it didn't seem to work in Mini vMac so I wonder if it's just dodgy.
It's cetainly not DOS formatted. So I presume it may be a HFS formatted floppy.
I'll see if we have any old Mac Disks in our Vaults. I think my boss would have threw them away. Never though we'd be dumping them.