jcgraybill wrote: Tue Jan 13, 2026 3:19 am
Out of curiosity - purely for my own education - how did you identify the block size of this iso?
Notice that the disk image size is a multiple of 2352:
Code: Select all
bc <<< "scale=10;$(stat -f '%z' "$theiso") / 2352"
Look at the first handful of blocks.
Notice that there's a 16 byte header at offset 0 which begins with a 12 byte Sync "00ff ffff ffff ffff ffff ff00" followed by a 4 byte Header.
Code: Select all
00000000: 00ff ffff ffff ffff ffff ff00 0002 0001 ................
0x10 to 0x80F is 2048 bytes of data (a single block of a CD's data) consisting of four 512 byte standard sized blocks.
At 0x010 is the 'ER' signature signifying an Apple Partition Map formatted disk. This is usually at offset 0 in a disk image that doesn't include the extra CD header and trailer stuff per block.
Code: Select all
00000010: 4552 0200 0006 b96e 0000 0000 0000 0000 ER.....n........
At 0x210 is a Apple Partition Map partition header (signature: 'PM', type:'Apple_partition_map')
Code: Select all
00000210: 504d 0000 0000 0002 0000 0001 0000 0002 PM..............
00000220: 4d52 4b53 0000 0000 0000 0000 0000 0000 MRKS............
00000230: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000240: 4170 706c 655f 7061 7274 6974 696f 6e5f Apple_partition_
00000250: 6d61 7000 0000 0000 0000 0000 0000 0000 map.............
At 0x410 is the first and only partition (signature: 'PM', type:'Apple_HFS')
Code: Select all
00000410: 504d 0000 0000 0002 0000 0009 0006 b965 PM.............e
00000420: 544f 4153 5420 322e 3520 5061 7274 6974 TOAST 2.5 Partit
00000430: 696f 6e00 0000 0000 0000 0000 0000 0000 ion.............
00000440: 4170 706c 655f 4846 5300 0000 0000 0000 Apple_HFS.......
The 512 bytes at 0x610 is empty because this disk only has one partition after the partition map.
0x810 to 0x92F is a 288 byte CD block trailer which begins with 32 bits of something.
Code: Select all
00000810: 1570 6377 0000 0000 0000 0000 76b5 00fa .pcw........v...
00000820: 8ded f72c 0015 ffe7 9b59 749a e21f 48f0 ...,.....Yt...H.
00000830: 1ff0 8584 7a6b b86b b8a9 2000 0000 0000 ....zk.k.. .....
00000840: 0000 0000 0000 0000 7475 752f 9232 d232 ........tuu/.2.2
00000850: 415c 136d 8a3c 333c 3385 475c 1c6d 1300 A\.m.<3<3.G\.m..
00000860: 0000 0000 0000 3f90 a599 0000 0011 9d7b ......?........{
00000870: 0000 26eb 00f9 c8ac f527 0015 ffed cf16 ..&......'......
00000880: 35cb fb6d 318d 2ad0 d5e5 081f d11f d1c6 5..m1.*.........
00000890: 4e00 0000 0000 0000 0000 0000 0000 3505 N.............5.
000008a0: 0543 b61d ea18 7703 630c f848 5a48 5aea .C....w.c..HZHZ.
000008b0: 2903 710c 6300 0000 0000 0000 2ae0 c6ee ).q.c.......*...
000008c0: 0000 0017 7453 0000 4c59 e9c8 6196 6ffe ....tS..LY..a.o.
000008d0: 4a89 369d 4418 060d 5180 256d 09b8 b07a J.6.D...Q.%m...z
000008e0: a3a9 9cc1 a0a6 680c 5561 76b9 c97c fa5b ......h.Uav..|.[
000008f0: 68f8 eeaf 8c4e 44ad 3e2e cf70 2b64 14c5 h....ND.>..p+d..
00000900: 4cef 01a3 6cdd 07bc 2545 cf06 10f6 981f L...l...%E......
00000910: 8b53 bab5 eb34 a071 250c 7a40 c783 ea4e .S...4.q%.z@...N
00000920: 1883 fcfa 8d86 c92e 74bb f9e8 0b5b 55dd ........t....[U.
At 0x930 is another 16 byte header which begins the next 2352 CD block.
Here's a command to view the first ten 16 byte headers.
Code: Select all
dd if="$theiso" bs=2352 count=10 status=none | xxd -p -c 2352 | perl -pe 's/^(.{32})((?:.{128}){32})(.*)/$1/'
Code: Select all
00ffffffffffffffffffff0000020001
00ffffffffffffffffffff0000020101
00ffffffffffffffffffff0000020201
00ffffffffffffffffffff0000020301
00ffffffffffffffffffff0000020401
00ffffffffffffffffffff0000020501
00ffffffffffffffffffff0000020601
00ffffffffffffffffffff0000020701
00ffffffffffffffffffff0000020801
00ffffffffffffffffffff0000020901
The kind of data you can put in the 2352bytes of a CD block depends on the format:
Code: Select all
* Sector Areas, Sector Types
*
* Bytes Per Type CDDA Mode1 Mode2 Mode2Form1 Mode2Form2
* Per Area +----------+----------+----------+----------+----------+
* Sync | 0 | 12 | 12 | 12 | 12 |
* Header | 0 | 4 | 4 | 4 | 4 |
* SubHeader | 0 | 0 | 0 | 8 | 8 |
* User | 2352 | 2048 | 2336 | 2048 | 2328 |
* Auxiliary | 0 | 288 | 0 | 280 | 0 |
* ErrorFlags | 294 | 294 | 294 | 294 | 294 |
* SubChannel | 96 | 96 | 96 | 96 | 96 |
* +----------+----------+----------+----------+----------+
This disk is Mode1 without ErrorFlags or SubChannel data. DingusPPC supports disk images of this format, or disk images that contain only the User data. We need to add .cue support (or support for .isoinfo - if it is documented somewhere) to handle CDs with audio or other formats.
In Mac OS X, you can create the 2352 byte block image from a CD by imaging the "CD_partition_scheme" device.
Image the "Apple_partition_scheme" device if you only want the User data - this should result in a disk image that is mountable by normal disk image mounting tools.