[Coco] OS-9 and RS-DOS disk structures

Allen Huffman alsplace at pobox.com
Tue Dec 30 19:46:25 EST 2014


> On Dec 30, 2014, at 4:52 PM, William Astle <lost at l-w.ca> wrote:
> It alternates between sides:
> 
> Side 0, track 0
> Side 1, track 0
> Side 0, track 1
> ...
> 
> Most things that handle multiple sides do the same. This is where the notion of a "cylinder" comes from, referring to all instances of a particular track across all addressable sides. (You stack the tracks up and you get a cylinder.)
> 
> It does run through all 18 sectors on side 0 before going on to the 18 sectors on side 1 though.

Therefore, in a disk image, it would be something like:

REM T=TRACK, S=SECTOR, D=DRIVE
REM D=0 (FRONT SIDE) D=2 (BACK SIDE)

FOR T=0 TO 34
	FOR D=0 TO 1
		FOR S=0 to 18
			DSKI$ D,T,S,S1$,S2$
			WRITE OUTPUT FILE S1$+S2$ '256 bytes
		NEXT S
	NEXT D
NEXT T

Output file would have:

Track 0, Side 0, Sectors 1-18 ...
Track 0, Side 1, Sectors 1-18 ...
Track 1, Side 0, Sectors 1-18 ...
Track 1, Side 1, Sectors 1-18 ...

Did I get it?

		-- Allen






More information about the Coco mailing list