DiskCopy 4.2 format specification

From 68kMLA Wiki
Revision as of 23:54, 12 October 2010 by Lord Nightmare (talk | contribs) (minor fix)
Jump to: navigation, search
File format for Apple disk copy 4.2 definition, wiki version based on 0.99
by Jonathan Gevaryahu AKA Lord Nightmare
Much information comes from the CiderPress and MiniVmac source codes.
More authoritave information comes from http://www.nulib.com/library/FTN.e00005.htm
This is also used in DiskCopy 4.1. DiskCopy 6.3.3 uses a version with tags omitted.
DART is a variant which adds compression.
DC42 File format Overview
offset type/size contents
0x00 byte Length of image name string ('Pascal name length')
0x01-0x3f 63 bytes Image name, in ascii, padded with NULs
0x40-0x43 BE_UINT32 Data size in bytes (of block starting at 0x54)
0x44-0x47 BE_UINT32 Tag size in bytes (of block starting after end of Data block)
0x48-0x4B BE_UINT32 Data checksum
0x4c-0x4F BE_UINT32 Tag checksum
0x50 byte Disk encoding
0x51 byte Format Byte
0x52-0x53 BE_UINT16 '0x01 0x00' ('Private Word') AKA Magic Number
0x54-... variable Image data
...-EOF variable Tag data

Specifics of each Section:

0x00, Length of image name string

Technically this is part of the 0x01-0x3f area, as pascal strings apparently store their length as their first byte. Effectively the address of the last non-NUL byte of the image name. bytes after the end address are ignored, and sometimes are used to hold extra information, or hold garbage (in the case of the 1.44mb system 6.0.8 startup disk, this is leftovers in memory from the System Additions disk, so the string ends up being System Startupns)

  • Note: A special (bug) case happens when the disk name is "-not a Macintosh disk", which the name is set to when using dc42 on non-mac diskettes. In that case, the length is set one byte too high; this is probably a bug in dc42 that was just never fixed.

0x01-0x3f, Image name

This is the image name string. It is copied from the volume name of the disk or diskette being imaged.

0x40-0x43, Data block size in bytes

This has one of 4 values on most diskettes:

00 06 40 00 (409600 bytes) for 400k GCR disks
00 0c 80 00 (819200 bytes) for 800k GCR disks
00 0b 40 00 (737280 bytes) for 720k MFM disks
00 16 80 00 (1474560 bytes) for 1440k MFM disks