Files
fluxengine/doc/disk-apple2.md

3.5 KiB

Disk: Apple II

Apple II disks are nominally fairly sensible 40-track, single-sided, 256 bytes-per-sector jobs. However, they come in two varieties: DOS 3.3/ProDOS and above, and pre-DOS 3.3. They use different GCR encoding systems, dubbed 6-and-2 and 5-and-3, and are mutually incompatible (although in some rare cases you can mix 6-and-2 and 5-and-3 sectors on the same disk).

The difference is in the drive controller; the 6-and-2 controller is capable of a more efficient encoding, and can fit 16 sectors on a track, storing 140kB on a disk. The 5-and-3 controller can only fit 13, with a mere 114kB.

Both formats use GCR (in different varieties) in a nice, simple grid of sectors, unlike the Macintosh. Like the Macintosh, there's a crazy encoding scheme applied to the data before it goes down on disk to speed up checksumming.

In addition, a lot of the behaviour of the drive was handled in software. This means that Apple II disks can do all kinds of weird things, including having spiral tracks! Copy protection for the Apple II was even madder than on other systems.

FluxEngine can only read well-behaved 6-and-2 disks. It doesn't even try to handle the weird stuff.

Apple DOS also applies logical sector remapping on top of the physical sector numbering on the disk, and this varies depending on what the disk is for. FluxEngine can remap the sectors from physical to logical using modifiers. If you don't specify a remapping modifier, you get the sectors in the order they appear on the disk.

If you don't want an image in physical sector order, specify one of these options:

  • --appledos Selects AppleDOS sector translation
  • --prodos Selects ProDOS sector translation
  • --cpm Selects CP/M SoftCard sector translation1 2

These options also select the appropriate file system; FluxEngine has read-only support for all of these. For example:

fluxengine ls appleii140 --appledos -f image.flux

In addition, some third-party systems use 80-track double sides drives, with the same underlying disk format. These are supported with the appleii640 profile. The complication here is that the AppleDOS filesystem only supports up to 50 tracks, so it needs tweaking to support larger disks. It treats the second side of the disk as a completely different volume. To access these files, use --appledos --side1.

Reading discs

Just do:

fluxengine read appleii140

(or appleii640)

You should end up with an appleii140.img which is 143360 bytes long. It will be in physical sector ordering if you don't specify a file system format as described above.

Writing discs

Just do:

fluxengine write appleii140 -i appleii140.img

The image will be expected to be in physical sector ordering if you don't specify a file system format as described above.

Useful references


  1. CP/M disks use the ProDOS translation for the first three tracks and a different translation for all the tracks thereafter. ↩︎

  2. 80-track CP/M disks are interesting because all the tracks on the second side have on-disk track numbering from 80..159; the Apple II on-disk format doesn't have a side byte, so presumably this is to allow tracks on the two sides to be distinguished from each other. AppleDOS and ProDOS disks don't do this. ↩︎