6

As far as I understand:

  • a .do or .dsk file extension indicates that the sectors in a disk image are in AppleDOS order (i.e. the physical sectors are in order 0, 13, 11, 9 etc).
  • a .po file extension indicates that the sectors in a disk image are in ProDOS order (i.e. 0, 2, 4, 6 etc).

How do I specify that the sectors in a disk image are in physical order, i.e. 0, 1, 2, 3 etc?

11
  • 3
    This depends very much on the emulator, so at least edit your question and specify which emulator you are using...
    – dirkt
    Commented Apr 9, 2023 at 21:01
  • 2
    Isn't this supposed to be standard? Like, any emulator which doesn't do the logical to physical sector mapping properly is going to fail horribly to boot... Commented Apr 9, 2023 at 21:32
  • 2
    @dirkt This sounds like a question of "What standard disk format has property X?" where, in this case, property X is "the sectors are stored in physical order rather than either AppleDOS or ProDOS logical order"... the specific emulator shouldn't matter if the format being sought is a standard.
    – ssokolow
    Commented Apr 10, 2023 at 1:54
  • 1
    The meta question is whether physical sector order is a recognized disk format within the Apple community. Commented Apr 10, 2023 at 1:55
  • 2
    For what reason do you want this? For the sake of making potential other suggestions, mostly around extraction or temporary rendering.
    – Tommy
    Commented Apr 10, 2023 at 11:26

3 Answers 3

12

All nibble images are in physical order, by definition. It sounds like you want a sector image (a series of 256-byte sectors) in physical order. Note this only applies to 5.25" disks.

On the Apple II, you can create these with Copy ][+ v7.x. Use the disk copy feature to copy a 5.25" disk to a larger ProDOS volume. This will create a ".img" file in physical order. (Older and newer versions of Copy ][+ just report an error because the volumes are different sizes.)

Files ending with ".img" are assumed by CiderPress to be in physical order, though it does its own format detection to confirm. Few if any emulators support this; physically-ordered sector images are almost unheard-of.

Sector images are generally stored in "DOS" or "ProDOS" order, because that's what OS the user was running when they created the disks. DOS-based imaging software assumes the disk is in DOS order, and ProDOS-based imagers assume it's in ProDOS order. There are no "CP/M order" disks because nobody uses CP/M to create Apple II disk images. The emulated operating system doesn't need to know about this; the emulator maps the sectors back to physical, and the emulated DOS/ProDOS/whatever does its remapping and gets what was originally there.

This is more complicated than it needs to be because the early disk imaging software was simpler than it should have been. Storing disks with sectors in physical order would have made life easier. That didn't happen, and once you have a standard everybody follows it, so we have to auto-detect formats and undo the mapping.

Regarding some of the comments: there are only three soft-sectored interleaves that matter: DOS, ProDOS/Pascal, and CP/M. Each one can be expressed in two ways, as the conversion to physical and the conversion from physical. That's why CP/M is both 0/3/6/9 and 0/11/6/1. See also this answer and this answer.

Update: you can create a physical-order disk image with CiderPress II:

$ cp2 cdi disk.img 140k dos
Creating disk image: Unadorned Sector, order=physical, size=140KB, DOS 3.x

As noted earlier, they're not usable in most emulators.

5
  • 2
    +2 Good answer.
    – Raffzahn
    Commented Apr 10, 2023 at 15:39
  • 1
    It seems curious that there's no common format that either numbers sectors according to the sector labels, nor augments the 560x256 bytes of sector data with 560 bytes to specify the sector ordering., since choice of sector ordering when writing a disk may greatly affect performance, and since generating disk images directly with the CC65 toolset would be much more convenient if it disk order could be specified.
    – supercat
    Commented Apr 10, 2023 at 15:51
  • 1
    2MG specifies the sector order, but only as either DOS or ProDOS for floppy images. And outside of the IIgs it isn’t much used.
    – Tommy
    Commented Apr 10, 2023 at 16:32
  • @Tommy: the Copy ][+ v7 ".img" files are unadorned sector images, like .do/.po; no relation to 2IMG (which is ".2mg" or ".2img").
    – fadden
    Commented Apr 10, 2023 at 16:49
  • @fadden agreed; was responding to supercat’s observation about common formats. There’s possibly an acceptable answer to the original query if it’s permissible to create a hard-disk image though?
    – Tommy
    Commented Apr 10, 2023 at 17:13
4

As far as I know, every format in widespread use stores decoded sectors in DOS order, decoded blocks in ProDOS order, or raw track data (nibblized sectors).

If the sectors are numbered 0, 1, 2, ... in that order in the raw track, which they normally are but don't have to be, then the nibblized formats are in the order you want. But they have disadvantages: you can't easily see the contents of the sectors in a hex editor, and they're around 60% larger and don't compress as well.

.nib and .woz files store raw tracks, and .2mg seemingly also supports it, although the spec is vague on the details.

1

How do I specify that the sectors in a disk image are in physical order, i.e. 0, 1, 2, 3 etc?

Err, sure you're asking for physical order, not logical?

All (real) Disk II formats I know do use a sector skew of some sort, i.e. physically ordering the sectors different than logical - as you already describe for .do/.po.

A format storing sectors in monotone increasing order would be not according to physical layout but logical - also, .po are already in logical order, ad Prodos does not use 256 byte sectors but 512 byte blocks, which the file contains in sequential ascending order (Block 0, Block 1, Block 2, ...).

The only other format with consecutive blocks I can think of is

  • Sim //e's .HDV
1
  • 1
    Yes, I do want physical order. Commented Apr 10, 2023 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .