What is the sector ordering / skew for Apple ][ Pascal disks and CP/M disks? #37
-
|
Writing my own code for fun I've got DOS 3 and ProDOS sector ordering working. But I started looking at .dsk image files of Pascal and CP/M disks, and Googling about their sector ordering and/or skew and I'm not finding much. I downloaded a random set of each and I've played with CP/M images for other systems a little bit but not never looked at Apple II Pascal disk images before. It seems like all the CP/M ones have their sectors in the same order and all the Pascal ones have theirs in the same order. All the file extensions are The Pascal images all have the directory/catalog starting at offset The CP/M images all have the directory/catalog starting at offset But the second sector of the directory is not the next sector of the disk image in either case. The second sector of the dir in the Pascal images is at 'physical sector' 10 of track 0. The second sector of the dir in the CP/M images is at 'physical sector 3 of track 3'. In 'disk image order' the second sector of the Pascal dir is at So I feel I must be missing something that's difficult to Google that's different than DOS 3 and ProDOS disk images. Either instead of or in addition to the old do/po sector ordering. Is this sector skew? How do I get my head around it? And do these also come in .po/ProDOS ordering too? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
.DSK images don't have a defined sector ordering. Some are DOS 3.3 order, some are ProDOS order. The actual OS format doesn't matter and I've seen Pascal and CP/M .DSKs both ways. Yes, that's terrible, but it's an almost 30 year precedent now. |
Beta Was this translation helpful? Give feedback.
-
|
The ".do" or ".po" is a reflection of the operating system in use by the tool that created the disk image. DOS tools like DDD create DOS-ordered images, while ProDOS tools like ShrinkIt create ProDOS-ordered images. Emulator tools do one or the other. This is independent of the sector skew. UCSD Pascal disks - which can be found for other systems (e.g. https://retrocomputing.stackexchange.com/a/28487/56) - use ProDOS sector skewing. Technically, Pascal came first, so it might be more accurate to say that ProDOS disks use Pascal skewing. Apple II CP/M disks have their own sector skewing... but the first few tracks are usually in ProDOS order. Sector skewing for DOS, Pascal, and CP/M was first(?) documented in Beneath Apple DOS: https://archive.org/details/Beneath_Apple_DOS_alt/page/n17/mode/1up . The skew translation tables are in code form here. https://ciderpress2.com/doc-index.html has pages for Pascal and CP/M filesystems. Pascal uses 512-byte blocks, same as ProDOS, while CP/M on 5.25" disks uses 1024-byte blocks. CP/M data disks can actually wrap around at the end. https://github.com/fadden/CiderPress2/tree/main/DiskArc/FS has the CP2 implementations. There's a function called FWIW, the sector editor in CiderPress II allows you to change the sector skew currently in use: |
Beta Was this translation helpful? Give feedback.

The ".do" or ".po" is a reflection of the operating system in use by the tool that created the disk image. DOS tools like DDD create DOS-ordered images, while ProDOS tools like ShrinkIt create ProDOS-ordered images. Emulator tools do one or the other. This is independent of the sector skew.
UCSD Pascal disks - which can be found for other systems (e.g. https://retrocomputing.stackexchange.com/a/28487/56) - use ProDOS sector skewing. Technically, Pascal came first, so it might be more accurate to say that ProDOS disks use Pascal skewing.
Apple II CP/M disks have their own sector skewing... but the first few tracks are usually in ProDOS order.
Sector skewing for DOS, Pascal, and CP/M was fi…