[Coco] Automatic identification of Coco OS-9 disks vs Disc Basic disks

Robert Gault robert.gault at worldnet.att.net
Sun Jun 10 09:51:11 EDT 2007


Not too long ago there was a question about how to distinguish OS-9 
disks from Disk Basic disks. Strictly speaking, the only sure fire way 
to do that is to attempt to read the directory tracks but that requires 
human interaction. However, because of the limited types of Coco disks, 
there is another method that can be automatic and still have a high 
degree of reliability.

  The Coco almost exclusively creates a limited number of types of 
floppies. There are single sided 35 or 40 track disks, double sided 35 
or 40 track disk, and some hybrids where the back side of the disk acts 
as another single sided disk. Since all of these disks use 18 sectors 
per track, the only differences between types are the total number of 
tracks.
  OS-9 places in LSN0 of each disk system data. The first four bytes 
consists of DD.TOT (3 bytes) Number of sectors per disk and DD.TKS (1 
byte) track size in sectors. For essentially all OS-9 disks these bytes 
will have the two values, $00,$02,$76,$12 or $00,$02,$D0,$12. One common 
exception to the above is the NitrOS-9 80 track disk image which would 
have $00,$05,$A0,$12.
  The chances of a Disk Basic disk having these same values in T0S0, 
even with ml programs on the disk, is nil.

  So, a simple program running in Basic just needs to DSKI$ track0 
sector1 and look at the first four bytes. The values can be compared to 
three choices. If there is a match, the disk/side is OS-9. No match and 
the disk is Disk Basic or at least Disk Basic data.



More information about the Coco mailing list