[Coco] Booting DS disks and JV emulators

Rodney V Hamilton Rodney_Hamilton at GBRonline.com
Sun Oct 26 06:36:00 EST 2003


I posted the following to bit.listserv.coco On 11 Sept 2003:
  (look for the "COCO3 Emulatior Help" thread on Google)
>In article <3F6125CB.3983B83E at worldnet.att.net>, robert.gault posted...
>>The disks at SourceForge are double sided 40 track images. These can be
>>read by Jeff's emulator under OS-9 but can't be read correctly under
>>Disk Basic. The JVC header information is not being looking at or
>>correctly used by the emulator. As a result, Disk Basic DOS sees the
>>boot track at track 68 sector 1 instead of track 34 sector 1.
>>
>>Double sided disks will not boot with Jeff's emulator but will boot with
>>the MESS emulator if the disk extension is changed from .dsk to .os9
>
>Actually, you *can* boot the DSDD image from sourceforge, but you need
>to patch it first to change the DD.FMT byte in LSN0 (offset $0010) from
>$03 to $02.  This keeps OS9 from triggering the side select logic in the
>emulator, which would look to drive 2 for a backside image.  Os9 has no
>problem reading the DSDD image since it uses LSNs internally.  If you
>wanted to change the geometry fro 40TDS to 80TSS, you could change the
>tracks & sides values at $0045/46 from $28 & $02 to $50 & $01, but it's
>not really needed.
>
>As Robert points out, the boot track in the image is at logical track 68
>so a simple "DOS" fails to see it.  HOWEVER, you can fix this by telling
>DISK BASIC to boot from track 68 instead!  Try this:
>  POKE &HDF1C,68:DOS
>The (patched) image should boot up just fine.  It's a PITA but it works.
>
>If you're using OS9BOOT.MOR, you'll need to change the track number at
>offset $0020 from $22 to $44 to make it autoboot the DSDD image file.
>
>Of course if the DOS command were to automatically try track 68 if
>track 34 didn't have the "OS" tag, hmmm...

I looked at this again last week and wrote a patch to do just that!
If the patched DOS boot fails on track 34, it will retry with track 68
before giving up.  Here are patch bytes for the DISK.ROM image file.
(NOTE: the offset addresses = mem address + 2 - $C8000 because
the ROM image file has a 2-byte starting address at offset 0.)

Comparing files DISK.ROM and DISK.NEW
Offset Old New  Description
001F04: 0F 20   BRA PATCH1
001F05: 03 5C
001F1B: A7 ED   bugfix: STA => STD (test: DIR1:DOS)
001F1D: 86 96   LDA <$04
001F1E: 22 04
001F4B: 7E 20   BRA PATCH2
001F4C: A0 1C
001F4D: E8 12   nop
* PATCH1 ($DF60)
001F62: 05 C6   LDB #34
001F63: 10 22
001F64: 93 4F   CLRA
001F65: D3 DD   STD <$03
001F66: 25 03
001F67: 02 20   BRA $DF05
001F68: DC 9D
* PATCH2 ($DF67)
001F69: D3 C6   LDB #68
001F6A: DD 44
001F6B: C3 D1   CMPB <$04
001F6C: A6 04
001F6D: E4 22   BHI $DF1D
001F6E: 81 F5
001F6F: 04 7E   JMP $A0E8
001F70: 25 A0
001F71: 0A E8


A similar patch works with Jeff Vavasour's OS9BOOT.MOR file.
At offset=$0051, insert these 7 bytes ahead of the $8E byte:

 Value Description
  CC   LDD #$4401
  44      regA=track68
  01      regB=sector1
  A1   CMPB -2,X
  1E      FDC track reg < 68?
  22   BMI $BF20
  CA      trk34 boot failed, try trk68

And then delete 7 of the filler null bytes now at offset $007C to
move the BOOT FAILED message to its original offset.  The patched
OS9BOOT.NEW file size should be 258 bytes, same as the original.

Both of these mods work OK with the JV emulators.  I can set up
and access four separate DSDD .dsk image files at once.




More information about the Coco mailing list