This is an OSI disk dump utility for OSI C3/Serial systems with 8" disks.
It can also test/transfer the contents of OSI CD-7 (8MB) hard drives.
This program is loaded via the OSI 65A ROM serial monitor.
Transfers can be as ASCII HEX dump or XMODEM/CRC binary dump.
Requires 8K of working RAM 


Basic Operation:
Connect the OSI C3 serial system to a PC via a serial cable.  Ensure
you have the correct baud rate for your system (9600 baud?) and 8bit
no parity, 2 stop bit, no flow control. Yes 8N2 <- important!

Reset the OSI system.  You should see the H/D/M? prompt.  Choose 'M' 
(remember all OSI commands are upper case)

Begin sending the c3dump.65a file using a RAW ASCII send.
The C3dump program ends by loading at $0129 which set the entry point for
the 65A 'G'o command.  When the c3dump.65a file ends it may begin the
dump program automatically.  If not, press 'R' to stop uploading hex data,
then press 'G' to begin execution.

The c3dump.65a starts at $0200 To set the 'go' location in 65A monitor 
and start manually <RESET> the C3 computer, press 'M' then L012E 0200 RG


OSI C3 Serial Disk Dump
-----------------------
1. Dump Floppy
2. Dump CD-7 Hard Drive
3. Select Floppy Drive
4. Scan HD for errors
5. Set Serial Divisor
6. Set Xmodem/Hex xfer
7. Exit

Drv=A/8  Baud@1x Hex
--->

Option 1 sends the contents of the current floppy using the current transfer protocol.

Option 2 does the same except for a CD-7 hard drive
Send <ESC> to abort HEX transfers. Xmodem Abort, or ^X to stop Xmodem.

Option 3 allows you to select floppy A - D

Option 4 reads the contents of a CD-7 hard drive, checking for and displaying any errors 

Option 5 controls the serial divisor which is normally 16.  That is if the serial port
is normally 300bps, setting the serial divisor to '1' (*16) will change the transfer
speed to 300*16 or 4800bps.  When using higher baud rates it is advisable to use XMODEM
file transfers to ensure error free transmission.

Option 6 selects HEX dump, Xmodem or Xmodem/CRC transfers.


Update 3/1/2021
---------------
Fix calculation of CD-7 track header checksum to match OSI and stop reporting as error on later cylinders.
Fix hard drive read retry to prevent hard drive access from timing out.
Add Xmodem checksum protocol support (standard Xmodem), correct handshaking to better sync with other xmodem.

Update 10/01/2019
-----------------
Added CD-7 hard drive dump support 



OS65U CD-7, CD-23, 28 Hard Disk Error Numbers

1 - Drive not ready
2 - Seek timeout
3 - Invalid unit number
4 - Can't find cylinder 0
5 - DMA failed to terminate
6 - No data read
7 - Sector unsafe
8 - Header checksum *
9 - Cylinder mismatch *
10 - Track mismatch *
11 - Sector mismatch *
12 - Data field checksum *
13 - Status error
14 - Unit out of service
15 - Cylinder out of range
77 - ? dev not present?

* these errors are shown when using HD test feature, there may be multiple errors per sector, 
 only one is shown


The 65A ROM monitor uses locations $0129 to $012F to store 6502 register and
jump location information.

OSI 65A Rom Monitor command summary

R - reset (exits load mode)
L - load mode followed by <2 Byte Address in hex><data as hex>, R to exit
P - print mode followed by <2 Byte Address in hex> dump data at address, Any key to exit
G - go with $012D=K, $012A=X, $0129=Y, $012B=A, addr=($012F lo,$012E hi) 
    via RTI Note that unlike RTS, RTI does NOT add one to the destination before placing 
    it in the Program Counter (PC)
0-9,A-F hex digit
