[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DSK format specification
In comp.sys.apple2 Bill Garber <willy46pa@comcast.net> wrote:
> You all are making DSK too complicated. All they are is this.
> Track 1, sector 1, byte 1 is byte 1 of the file, and so on each byte
> from the disk is sequential in the file. Nothing more.
Track 0, sector 0, byte 0 starts at byte 0 of the file. This is because,
for all possible sector skews, sector 0 is always in the same place.
Track 0, sector 1, byte 0 could be in one of three different places.
That's the difference between .PO, .DO, and Copy ][+ .IMG. If there
were a CP/M disk-image utility you'd have four possibilities.
A DOS utility will read sector 0 through sector 15 and write them out
in that order. A ProDOS utility will read block 0 through block 7 and
write them out as 512-byte blocks. Unfortunately, block 0 is track 0
sector 0 combined with track 0 sector 2, *not* track 0 sector 1. This
means that disk images created with DOS RWTS-based utilities are
different from images created with ProDOS utilities like ShrinkIt.
CiderPress looks for DOS, ProDOS, Pascal, CP/M, and RDOS filesystems in
"DOS", "ProDOS", and "physical" sector ordering every time you open a
disk image. If the file has a helpful extension (like ".do"), it knows to
try that first. However, until it successfully identifies a filesystem, it
can't know the sector ordering, which is why for disks with no recognizable
filesystem (like games with custom loaders) it will ask you to choose one.
Because sector 0 is always in the right place, finding a DOS 3.3 VTOC isn't
sufficient... we know it's DOS 3.3, but we don't know what order the
sectors are, so it's necessary to examine the rest of the catalog track.
Which gets even more fun when you deal with 32-sector images on 800K disks.
Some formats, such as 2MG, are kind enough to tell you the order. Others,
like ShrinkIt, are always ProDOS-order. In general, though, you have to
keep poking at it until something looks familiar.
--
Send mail to fadden@fadden.com (Andy McFadden) - http://www.fadden.com/
CD-Recordable FAQ - http://www.cdrfaq.org/
CiderPress Apple II archive utility for Windows - http://www.faddensoft.com/
Fight Internet Spam - http://spam.abuse.net/spam/ & http://spamcop.net/