[Coco] DriveWire
Tormod Volden
lists.tormod at gmail.com
Fri Feb 19 10:35:58 EST 2016
On Fri, Feb 19, 2016 at 3:45 PM, Mathew Boytim wrote:
> I'm working on a disk driver for the Models 1/3/4 to use DW - just disk at the moment. The DW protocol itself does not seem very robust because the command values are not unique and can appear within data and there is no explicit means to achieve a positive sync with the server. I think there could be some ways such as if an error or timeout occurs you could send 256 1-byte commands to the server which after 256 of them you'd be guaranteed to be in sync.
>
> Currently my driver is working but I don't do any timeouts or error checking or error handling other than report DW errors up to the DOS - but if a character was ever lost then the driver and client would be hopelessly out of sync with no recovery other than to restart both.
>
> So I'm of course wondering what the Coco disk drivers do regarding timeouts and error checking/handling. Can someone point me to some DW driver source as an example of the design intent or maybe just outline the error checking/handling? Or maybe there is none and DW just assumes a fundamentally reliable connection as my driver does currently.
Hi Matt,
There is a timeout specified in the DriveWire protocol and most
clients use it. Aaron's DW4 server doesn't honour it in all cases, so
sometimes (if the client sends rubbish) it gets stuck in the wrong
state and you eventually end up with a "millipede" message in the log
and a restart is needed.
The DriveWire low-level drivers used in HDB-DOS and FUZIX (and pretty
much identical in NitrOS-9) are here:
https://sourceforge.net/p/toolshed/code/ci/default/tree/hdbdos/dwread.asm
https://sourceforge.net/p/toolshed/code/ci/default/tree/hdbdos/dwwrite.asm
Note the Becker routines don't use a timeout by default because many
people use them on overclocked emulators.
In my experience (at 57600 baud and bit-banging) the whole thing works
very reliably. Only when I experiment with buggy client drivers I end
up with the DW4 "millipede" sometimes.
Tormod
More information about the Coco
mailing list