[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Differences between NIB and DSK?



Jeffrey Theusch wrote:
> 
> I am writing a program emulating an Apple II disk drive.  What are the
> differences between NIB and DSK formats, or what data does NIB have
> that DSK doesn't?
> 
> Also, what are the basic routines an emulator uses to move the head,
> spin the disk, etc when emulating a 5.25" AppleII disk drive?
 ....

     A 5.25" DSK disk image has the data contained in each sector (256 bytes
per sector) of the original diskette. There are 16 sectors per track and 35
tracks. The total number of bytes in a 5.25" .dsk file should be ...

35 x (16 x 256)= 143,360 bytes.

     The order of data in this kind of disk image will be according to either
DOS 3.3 sector naming or ProDOS sector naming-- i.e. DOS 3.3 or ProDOS "sector
ordering".

     Sector naming or "ordering" is determined by the translation table a
particular DOS uses to translate real (on-diskette formatted) sector numbers to
sector numbers used by higher level DOS routines.

     For example, with DOS 3.3 ordering, the contents of the sector DOS 3.3
calls "Sector $00" on Track $00 will be the first 256 bytes in the file. Next
will come the contents of the sector DOS 3.3 calls "Sector $01", ..., etc. up
through "Sector $0F". This continues for each track up through Track $22 (34 in
decimal).

     DOS 3.3 ordering is the standard whether or not the image content is DOS
3.3-- i.e. an image which boots ProDOS will usually be in "DOS 3.3 order".  All
.do and most .dsk 5.25" disk image files are in DOS 3.3 order. ADT will
correctly transfer only DOS 3.3 order images.

     ProDOS uses a different translation table. ProDOS order images should have
names ending with ".po".

     Since 5.25" DSK disk image files contain only the data contents of a
diskette, this kind of image does not preserve some potentially important
information embedded in the diskette formatting. Mainly, this format does not
preserve DOS 3.3 volume numbering.

     Naturally, too, the standard 5.25" DSK format does not preserve unusual
formatting information such as might relate to having a copy of most seriously
copy-protected diskettes. The source diskette for a 5.25" DSK disk image must
be copiable via simple sector-copy methods.


     The .nib image was originally developed in order to transfer images of
copy-protected disks. Saltine's Super Transcopy utility can create .nib
images-- I think it uses bit-copy routines from Essential Data Duplicator.

     A .nib image has a standard size of 232,960 bytes. It retains data and
embedded formatting information. This kind of image is often used for non
copy-protected DOS 3.3 disks when it is necessary for the image to have a
special volume number.

     I do not know much about the format of .nib files. Evidently, a .nib has
the nibblized contents of each track, including embedded stuff like sector
address headers, etc.. Probably, file content begins with Track $00 and goes
uniformly up through Track $22.

     A .dsk image can be copied to a .nib image; and, a .nib image which is not
copy-protected can be copied to a .dsk image. There are ways to create new .nib
files on an emulator. There is more about this sort of thing in the FAQs at
http://home.swbell.net/rubywand/Csa2FLUTILS.html .

     I do not know anything about the routines emulators use to access disk
images. Someone else here or on Csea2 or Csa2p is sure to know.



Rubywand