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

Allen Huffman alsplace at pobox.com
Wed Dec 31 12:43:58 EST 2014


> On Dec 31, 2014, at 9:50 AM, Robert Gault <robert.gault at att.net> wrote:
> 
>> Then if I was making a .DSK image file for OS-9, would I write it out that same way?
> 
> Well you could but why go to the trouble? :) Also it would help if you stated your final objective rather than asking about what you think would be the best method of achieving the non-mentioned goal. That would permit us to respond to the actual goal.

Well, my real goal was to understand how OS-9 disks are laid out, having actually never known how it handled double sided disks, and learning how those sectors live inside a .DSK file. I was trying to find out if a double sided 40 track .DSK file was 40 tracks from side 1 followed by 40 tracks from side 2, or something else.

> So, let's say you just want to copy real double-sided OS-9 disks to second disk. If that is the goal, just use BACKUP from Disk Basic or backup from OS-9.
> Disk Basic with 0=front and 2=back Drive A, 1=front 3=back Drive B
> You would just
> 10 BACKUP0TO1
> 20 BACKUP2TO3

This actually solves my problem. I am doing this on a real CoCo using the CoCoSDC floppy drive emulator. The CoCoSDC emulates the WD1774 floppy controller, and can act like physical DRIVE 0 or DRIVE 1. It redirects all of the WD1774 disk I/O to sectors inside of a .DSK image on the SD card. You can turn off either drive so accesses then go to the real floppy controller.

DRIVE 0,OFF 'use physical drive 0
DRIVE 1,"FLOPPY.DSK",NEW 'create a new disk image

By default, FLOPPY.DSK would be a 35-track image, but if you write more tracks to it, the image expands up to 80 tracks. If DRIVE 0 has a normal 35-track disk, it can be copied like normal:

BACKUP 0 TO 1

If the patches are done for 40 track mode, it will back up all 40 tracks (expanding the disk image along the way).

I had been (incorrectly) thinking that because CoCoSDC only does DRIVE 0 and DRIVE 1, I wouldn't have a way to map in the other side from Disk BASIC. But in reality, CoCoSDC is honoring two drive select lines (0 and 1) plus side select. Thus, the same POKEs that work on a real set of two physical double sided floppy drives should work with CoCoSDC. Per your example:

DRIVE 0,OFF 'Make DRIVE 0 the physical floppy
DRIVE 1,"FLOPPY.DSK" 'Make DRIVE 1 a .DSK image

POKE 55453,1 'Drive 0 accesses top side of physical drive 0
POKE 55454,2 'Drive 1 accesses top side of virtual drive 1
POKE 55455,1+64 'Drive 2 accesses back side of physical drive 0
POKE 55456,2+64 'Drive 2 accesses back side of virtual drive 1

BACKUP 0 TO 1
BACKUP 2 TO 3

I don't have to do anything different! What was throwing me off was misunderstanding CoCoSDC. It acts like two physical double sided drives, not two disk basic drives.

Yay! I think I wrapped my brain around it! Thanks, Robert. If this works, huge kudos do Darren.

		-- Allen



More information about the Coco mailing list