Format:Apple II disk images (DSK, PO, 2IMG)
| Platforms | Platform:Apple II |
|---|---|
| Magic | 32 49 4D 47 ("2IMG") for 2IMG |
| Extensions | .dsk .do .po .2mg .2img |
| On this wiki | Facts · Code · Notes · Topics |
Sector-level images of Apple II 5.25-inch (143360-byte, 35 tracks x 16 x 256) disks: .dsk/.do in DOS 3.3 sector order, .po in ProDOS order, and .2mg/.2img files that wrap either (or raw nibbles) in a 64-byte header starting "2IMG".
DSK, DO, PO
Headerless: 35 tracks x 16 sectors x 256 bytes = 143360 bytes. The extension tells the sector order of the 16 sectors in each track: MAME registers "dsk,do" as DOS-order and "dsk,po" as ProDOS-order images, so a file named .dsk is ambiguous and must be tested (a DOS 3.3 VTOC is at track 17 sector 0; a ProDOS volume directory key block is block 2). Unverified: the standard file system tests are the VTOC/volume header bytes, not the extension.
2IMG header (64 bytes, little endian)
From the 2IMG documentation (not a source file): 0x00 magic "2IMG"; 0x04 creator id (4 ASCII chars, e.g. "XGS!"); 0x08 u16 header size (0x40); 0x0A u16 version (1); 0x0C u32 image format (0 DOS 3.3 order, 1 ProDOS order, 2 nibblized data); 0x10 u32 flags (bit 31 locked, bit 8 DOS volume number valid, bits 0-7 volume number); 0x14 u32 number of 512-byte ProDOS blocks (0 unless format 1); 0x18 u32 data offset (0x40); 0x1C u32 data length (143360 for 5.25 inch); 0x20 u32 comment offset and 0x24 length; 0x28 u32 creator data offset and 0x2C length; 0x30 16 reserved zero bytes. Disk data follows the header, then the optional comment, then creator data.
Protected disks
Sector images cannot carry nonstandard track layouts or half tracks; use Format:WOZ disk image or flux (Format:SCP flux image).
Sources
MAME src/lib/formats/ap2_dsk.cpp lines 477-501 (extension lists), commit 1d7a454ed79e97d35d2a9f127ac029ead94711d6; gswv.apple2.org.za/a2zine/Docs/DiskImage_2MG_Info.txt (2IMG documentation).