I'm thinking about adding DSK format support to a program I wrote. Can anyone direct me to a specification for the most current version of thefile
format?what
I've read the FAQ, but I need to know the internals of the format, e.g.
fields are present, sector ordering, etc.
Hello,
I'm thinking about adding DSK format support to a program I wrote. Can anyone direct me to a specification for the most current version of the file format?
I've read the FAQ, but I need to know the internals of the format, e.g. what fields are present, sector ordering, etc.
Thanks,
- Mike
Omigosh!! ProBlock version 1.0 could do that back in 1990!!
Seriously though, I thought the format would be a bit more complex.
Hello,
I'm thinking about adding DSK format support to a program I wrote. Can anyone direct me to a specification for the most current version of the file format?
I've read the FAQ, but I need to know the internals of the format, e.g. what fields are present, sector ordering, etc.
"Michael Pender" <mpender@hotmail.com> wrote in message news:rLOPa.250$Y%3.201@nwrddc03.gnilink.net...to
The "DSK" image format(images that have the extension ".dsk") doesn't seem
have any written specifications. As mentioned in Andy McFadden's postsome
have different sector orders. What is really confusing is that there aresome
that use a different sector order than the one used by the operatingsystem on
the disk. In other words there are ProDOS DSK images with DOS order andDOS
3.3 DSK images with ProDOS order as well as DSK images where the ordermatches
the OS. ProDOS order means the blocks (512 bytes of unencoded data/block)are
arranged in numerical order. DOS order is the skewed sector (256bytes/sector)
arrangement used by DOS 3.3. Unfortunately, I have run across several DSK images that have headers (I have no idea how these are used). Most "DSK" images are 143,360 bytes in length but again as Andy mentioned there are afew
that have more or less.
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.
"Charlie" <charlied@NOSPAMbboard.com> wrote in message news:beppol026me@enews2.newsguy.com...
"Michael Pender" <mpender@hotmail.com> wrote in message news:rLOPa.250$Y%3.201@nwrddc03.gnilink.net...to
The "DSK" image format(images that have the extension ".dsk") doesn't seem
have any written specifications. As mentioned in Andy McFadden's postsome
have different sector orders. What is really confusing is that there aresome
that use a different sector order than the one used by the operatingsystem on
the disk. In other words there are ProDOS DSK images with DOS order andDOS
3.3 DSK images with ProDOS order as well as DSK images where the ordermatches
the OS. ProDOS order means the blocks (512 bytes of unencoded data/block)are
arranged in numerical order. DOS order is the skewed sector (256bytes/sector)
arrangement used by DOS 3.3. Unfortunately, I have run across several DSK images that have headers (I have no idea how these are used). Most "DSK" images are 143,360 bytes in length but again as Andy mentioned there are afew
that have more or less.
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.
I remember that back-in-the-day (BITD?) there were disk utilities that changed the interleave between DOS disk sectors to speed up file transfer. That is, physical sector 0 and logical sector 0 are always the same, but physical sector 1 and logical sector 1 could be different. Is this a
similar problem?
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.
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.
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.
Then how do you determine the sector interleaving on a blank Apple CP/M
disk images (no files ever written to the disk, no CP/M system on the
system tracks)? Such a disk will have all bytes in each and every
sector set to hex E5. Perhaps in such a case you just assume DOS 3
sector order, since that's what works best with those Apple II emulators which also emulates a Z80 ?
Overall the CP/M code in CiderPress is the weakest of the filesystems,
since nobody ever wrote a "Beneath Apple CP/M". (Oddly enough, there is
the equivalent of a "Beneath SSI RDOS".) There are some bit fields in
the catalog entries that I still don't understand. Fortunately I was
able to find some large text files and compare the output on an Apple II
to the output from CP to verify that all was well.
Andy McFadden <fadden@fadden.com> wrote in message news:OU7Qa.1395$dk4.59598@typhoon.sonic.net...
It's similar. Sectors have a physical order (by default written straight from 0 to 15) and a logical order (skewed around). The mapping between them is fixed for each filesystem, and is different for DOS,Pascal/ProDOS,
and CP/M. (It happens that logical sector 0 is mapped to physical sector
0 in all established formats, which means that you'll see track 0 sector 0 at the start of every disk image regardless of ordering.)
When I wrote the routine in ProBlock to copy a disk to a file, I never proposed the file as a standard type because I thought the file format
should include header information to deal with some of these variations first. I knew about the variations between DOS and ProDOS, but I never even considered CP/M or Pascal.
One thing I did have in mind to add as a feature is a block/sector list to support sparsely populated disks. Often many of the sectors or blocks on a data disk will be unused and copying them into the archive file is just a waste of space. Also, it would be helpful to have information about the physical media format.
For example, ProDOS would automatically recognize the 1 Meg memory area or
my Laser 128 as a slot 5 ram disk (/RAM5 ?). Before I started any heavy programming work with HyperC, I would copy the disk image from my 5.25" or 3.5" drive to the ram disk because the speed of ram access *far* exceeded
the speed of a 5.25" drive or 3.5" drive.
The downside is that a literal block-by-block copy from one disk to another, e.g. the floppy to the ramdisk, would leave the target disk thinking it was only the size of the source disk, vis the ~1024 K actually available. This could be fixed easily enough by copying only the populated blocks from the 5.25" disk or 3.5" disk and setting the used block map of the ram disk.
I think its time for a new DSK format that includes at least these features: - support for 256 byte, 512 byte, and 1024 byte blocks
- a used-block map for supporting sparse disks
- other information such as the date the media was formatted, original name of the volume, etc.
The new format would be a super-set of other formats and the embedded information would help eliminate many of the problems of dealing with archived media from 4+ different operating systems (DOS 3.3, ProDOS, Pascal, CP/M, etc.) However, I haven't spent much time thinking about support for copy-protected disks of the era. I'm not sure there is a good way to deal with those.
Any thoughts? Any recommendations for other features to be added to the new format?
Rather than creating an entirely new "DSK" format, I would suggest thatyou add
your features to the Universal Disk Image (2IMG) format. It is, in myopinion,
the most flexible format. It uses a header. Specific information can befound
at:
http://www.a2central.com/programming/filetypes/ftne00130.html
Charlie
Rather than creating an entirely new "DSK" format, I would suggest thatyou add
your features to the Universal Disk Image (2IMG) format. It is, in myopinion,
the most flexible format. It uses a header. Specific information can befound
at:
http://www.a2central.com/programming/filetypes/ftne00130.html
Charlie
I think its time for a new DSK format that includes at least these features: - support for 256 byte, 512 byte, and 1024 byte blocks
- a used-block map for supporting sparse disks
- other information such as the date the media was formatted, original name of the volume, etc.
The new format would be a super-set of other formats and the embedded information would help eliminate many of the problems of dealing with archived media from 4+ different operating systems (DOS 3.3, ProDOS, Pascal, CP/M, etc.) However, I haven't spent much time thinking about support for copy-protected disks of the era. I'm not sure there is a good way to deal with those.
CPM: i've got all the C++ routines to set/read all these items too,
if you want them, lemme know
In comp.sys.apple2 Michael Pender <mpender@hotmail.com> wrote:
I should probably point out that you get most of that with ShrinkIt.
Empty blocks can be "zapped" with ProDOS 8 ShrinkIt, and then compress
down to nothing. Date and volume name info are stored. It's always ProDOS-ordered, so there's no confusion. There's a widely-tested utility
for creating and unpacking images on the Apple II, and (if I may say so myself) solid support under pretty much every other platform via NuLib2.
The only copy-protected disks worth saving are 5.25", for which we havehttp://www.faddensoft.com/
NIB (though see the recent discussion about things NIB doesn't have). Preserving copy-protected 3.5" disks doesn't seem to be all that important
to people.
Rather than finding an uber-format that handles everything, I think
it's best to reduce as many formats as possible down to a single approach. Resolving the DOS vs. ProDOS ordering ambiguity can either be done like
2MG does it (adding a flag to support both and requiring all programs
to handle them) or by simply defining things to be one way, and letting format conversion programs take the burden of swapping sectors around.
--
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 -
Fight Internet Spam - http://spam.abuse.net/spam/ & http://spamcop.net/
"Andy McFadden" <fadden@fadden.com> wrote in message >news:jfrQa.1595$dk4.78076@typhoon.sonic.net...
In comp.sys.apple2 Michael Pender <mpender@hotmail.com> wrote:
I should probably point out that you get most of that with ShrinkIt.
Empty blocks can be "zapped" with ProDOS 8 ShrinkIt, and then compress
down to nothing. Date and volume name info are stored. It's always
ProDOS-ordered, so there's no confusion. There's a widely-tested utility
for creating and unpacking images on the Apple II, and (if I may say so
myself) solid support under pretty much every other platform via NuLib2.
But even SHK files give us trouble as Andy and I found out earlier
today, or was that yesterday as of now, anyway, apparently people
have uploaded files thru a browser or were not posted to the folder
properly on GROUND and the files ended up with an HTML header.
128 bytes of it. Once removed the file is fine, but does not work without >taking off the header. We must be careful of how we treat all archive
files, or there will be even more problems than we now have.
The structure and contents of the CP/M system tracks are indeed[... lots of stuff removed ...]
completely implementation specific. It doesn't even have to be 3
tracks: om the classic CP/M disk format (8" SSSD) the system tracks
were only 2 tracks; otoh each track on 8" SSSD disks contained more
than each track on an Apple II 5.25" disk.
Above the BIOS level, the file system area (i.e. everything except
the system tracks) on the disk are regarded just as a data area of
some specific size. CP/M doesn't care where a new tracks start; that's
a business only for the BIOS.
(Oddly enough, there is the equivalent of a "Beneath SSI RDOS".)
There are some bit fields in the catalog entries that I still
don't understand.
Consult the CP/M Alteration Guide in the CP/M manual:
http://www.cpm.z80.de/manuals/archive/index.htm http://www.cpm.z80.de/manuals/archive/cpm22htm/index.htm
http://home.tiscali.se/pausch/apple2/CPM.ref.txt http://home.tiscali.se/pausch/apple2/Apple.CPM.ref.txt
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.
-----BEGIN PGP SIGNED MESSAGE-----such
Hash: SHA1
In article <XPmcnegnDrhixo-iXTWJkw@comcast.com>,
Bill Garber <willy46pa@comcast.net> wrote:
"Andy McFadden" <fadden@fadden.com> wrote in message >news:jfrQa.1595$dk4.78076@typhoon.sonic.net...
In comp.sys.apple2 Michael Pender <mpender@hotmail.com> wrote:
That would most likely be a Binary II header, not an "HTML header" (no
thing exists in the context of Apple II archives). Apple II filesresiding
in binary form on non-Apple II systems should have them. ShrinkIt reads right through them. NuLib can read them as well:back
nulib bx foo.bxy
produces FOO.SHK (or FOO.SDK if it's a disk image), which can be passed
into NuLib to decompress.
There are other methods for stripping a Binary II header off a file; for instance, you could use dd under Linux, Cygwin, Mac OS X, etc. to start copying a file from position 128 instead of position 0.
Paul Schlyter <pausch@saaf.se> wrote:
The structure and contents of the CP/M system tracks are indeed[... lots of stuff removed ...]
completely implementation specific. It doesn't even have to be 3
tracks: om the classic CP/M disk format (8" SSSD) the system tracks
were only 2 tracks; otoh each track on 8" SSSD disks contained more
than each track on an Apple II 5.25" disk.
So it sounds like a program that processes disk images needs a set of
DPBs, from which it chooses one based on the physical characteristics of
the drive. For the Apple II world there are separate DPBs for 13-sector
and 16-sector disks.
Above the BIOS level, the file system area (i.e. everything except
the system tracks) on the disk are regarded just as a data area of
some specific size. CP/M doesn't care where a new tracks start; that's
a business only for the BIOS.
CiderPress has to be the BIOS as well as the operating system, which is
part of what makes all this so much fun. :-)
(Oddly enough, there is the equivalent of a "Beneath SSI RDOS".)
There are some bit fields in the catalog entries that I still
don't understand.
Consult the CP/M Alteration Guide in the CP/M manual:
http://www.cpm.z80.de/manuals/archive/index.htm
http://www.cpm.z80.de/manuals/archive/cpm22htm/index.htm
This one I have seen, but I couldn't find details of filesystem structure
or directory layout in it. It has command references, boot loaders, and
what amounts to an RWTS system, but none of that helps much.
http://home.tiscali.se/pausch/apple2/CPM.ref.txt
http://home.tiscali.se/pausch/apple2/Apple.CPM.ref.txt
The DPB info is useful. Now, if somebody has a .NIB of a 13-sector CP/M disk, I can try to make that work...
The part I couldn't figure out is the part you labeled "number of
128-byte records used". The values I'm finding don't quite match up
with what you show.
Sysop: | Gate Keeper |
---|---|
Location: | Shelby, NC |
Users: | 764 |
Nodes: | 20 (0 / 20) |
Uptime: | 41:06:59 |
Calls: | 11,275 |
Calls today: | 1 |
Files: | 5,288 |
D/L today: |
82 files (10,175K bytes) |
Messages: | 521,283 |