trsdw

Radio Shack TRS-80 Model 1/3/4

DriveWire Driver for LDOS/LS-DOS

Table Of Contents

Update History

Introduction

DriveWire is a popular accessory for the CoCo which can emulate hard disks and other devices. The DriveWire server runs on a PC host and client software runs on the CoCo. Nothing similar exists for the Models 1/3/4 but the Models 1/3/4 can use the same protocol with a server for the CoCo - compatible software is just needed for the Models 1/3/4.

TRSDW is a DriveWire virtual hard disk driver for the TRS-80 Models 1&3 and LDOS (5.3.1) and for the TRS-80 Model 4 and LS-DOS (6.3.1). TRSDW is derived from the XTRSHARD emulated hard disk driver for the xtrs/sdltrs emulators and is closely related to the TRSHARD lotech IDE driver - the TRSHARD disk images and the TRSDW virtual disk files are compatible. If you have used XTRSHARD and/or TRSHARD then using TRSDW will be a familiar experience but there are some differences.

TRSDW may be of particular interest if you don't already have a hard drive solution or are just getting back into the hobby and don't have a hard drive solution yet. See the Transferring The Driver Via RS232 section if all you have are floppy drives and no convenient way to transfer the driver to your machine.

TRSDW may still be of interest even if you already have a hard drive solution for your TRS-80 Model 1/3/4 such as a lotech IDE or FreHD since it's a convenient way to copy files between a real TRS-80 and a PC. So even FreHD users might find this useful.

NOTE: The highest baud a standard TRS-80 Model 1/3/4 can do is 19.2k which is the baud that TRSDW uses. However DriveWire servers don't usually support 19.2k baud so a DriveWire server has to be modified for 19.2k baud. I personally like the simplicity of Boisy Pitre's original DriveWire3 server but it can't be easily modified - I managed to hack the binary to change the baud but it can be a little finicky to get started working but once it does it works well. The DriveWire4 server is more easily modified with an edit to an xml file and has some other advantages so that is the server used in this document.

Installing And Running The DriveWire Server

Download the DriveWire4 server from here - follow the Download link. No installation is required - just unzip the DriveWire4 folder to a convenient location. The DriveWire4 server requires java - you will be prompted to install java if it's not present.

Once unzipped the master.xml file must be modified to add 19.2k baud. Open master.xml with notepad or other editor and add the text in red to line 58:

<SerialRate category="device" list="19200,38400,57600,115200,230400,460800,921600" type="list">115200</SerialRate>

Save and close the file.

Start the server by double-clicking DW4UI.exe. Select Config->SimpleConfigurationEditor..., click Next, select CoCo1, click Next, select you COM port, click Next, select 19200 baud, click Next, select NoThanks for MIDI, click Finish. These settings are saved as the default for when DriveWire4 is restarted so you don't need to do this each time. Apparently there is a builtin web server (I guess what respectable Java program doesn't have a builtin webserver?) - you can close the browser tab and select the Server tab. It should indicate that the COM port was opened. Virtual disks are inserted into the drives by double-clicking on the corresponding line in the Drive list. Otherwise the server is ready. However, for better visibility to if the server is working I suggest that you enable the logging of opcodes - select Config->ConfigurationEditor..., click on the SwowAdvancedItemss bytton to enable, select Logging, click on the line LogOpCode in the CoCo1 instance on your COM port, check the box EnableLogOpCode, and click WriteToServer. You can disable this later after things are working.

Basic Setup

First download the driver here. The same driver is used with LDOS for the Model 1&3 and LS-DOS for the Model 4.

In addition to the server you will need an empty virtual hard disk file. You can create one with the mkdisk utility included with xtrs or via the Hard Disk Management menu in sdltrs - or for convenience one is included with the driver download (header_cyl=202_dir=1.dsk). If you create one with mkdisk or sdltrs just accept the defaults (202 cylinders, directory on track 1) and give it a .dsk extension. For this example name it trsdw.dsk.

Connect your TRS-80's RS232 port to a COM port on the PC that will host the drivewire server using a null model connection - only 3 wires are needed - GND, RX, and TX. Note that a 'null modem' connection is needed - that is, connect the PC TX (DB9 pin 3) to the TRS-80 RX (DB25 pin 3) and connect the PC RX (DB9 pin 2) to the TRS-80 TX (DB25 pin 2) and of course connect the grounds (PC DB9 pin 5 to TRS-80 DB25 pin 7).

If not started already then start the DriveWire4 server by following the instructions above. Insert the blank virtual hard disk file trsdw.dsk into DriveWire4's Drive 0 by double-clicking on the Drive0 line and selecting the file.

Copy the driver file TRSDW/DCT to an LDOS/LS-DOS boot floppy.

Boot your TRS-80 using the boot disk which contains the TRSDW/DCT driver. Install the driver by executing the command:

system (drive=6,driver="trsdw")

You can just hit Enter to accept the defaults. Use the defaults for unit number (0), cylinders (202).

Unlike other hard disk drivers TRSDW doesn't check the disk when the driver is installed to see if it is formatted so there is no message regarding the format status of the disk. However the drive does send an initialization command to the sever which the DriveWire4 server will display in the Server window if EnableLogOpCode logging was enabled as suggested above - if so you should see this DoOP_INIT message:

In this case we know the disk isn't formatted so we can simply format it:

format :6 (dir=1)

Give it a name such as 'trsdw' and master password such as 'password'. Reply 'y' to the subsequent prompts. Unlike other hard disk formatters format does not low-level format the disk - it simply initializes the system and directory information so it is very fast (except for the slowness or the RS232).

Do a dir to see the newly created empty drive:

The DriveWire4 server will grow the virtual drive file as needed so after the format the virtual drive file will be 513 sectors (1 for the header, 256 for track 0, and 256 for track 1 the directory track).

Note that the (dir=1) is optional - it just places the directory track on cylinder 1. If omitted then format will place the directory in the middle of the disk at cylinder 101. In this case the virtual drive file will immediately grow to the file to 26113 sectors (1 for the header, 100*256=25600 for the next 100 tracks, and 256 for track 101 the directory track). Note also there is a small bug in the format command - the display of the directory cylinder assumes the number is at most two digits so '101' is displayed as ':1' which looks like 1 but it is not, it is 101. Although the header isn't used by TRSDW, you should make the header to agree with the cylinder where the directory is actually located to avoid potential problems with the XTRSHARD/DCT driver and trstools.

If that all looks good then copy LDOS/LS-DOS to the hard disk with backup, and then you can make the hard disk the system disk:

backup :0 :6 (inv,sys)

system (system=6)

Hopefully that all worked. If you do not see the DoOP_INIT command logged by the server (with opcode logging enabled) or if your TRS-80 locks up during the format then verify your RS232 connections, verify your DriveWire server settings, reset your TRS-80, and try again. During the format command is the first time that the TRS-80 waits for a response from the server so that is the most likely time it will lockup it something isn't right. There are no timeouts or retries in the TRSDW driver so if it gets stuck a reboot is required.

Transferring The Driver Via RS232

There are several articles on the web that address how to 'bootstrap' a system with only floppy drives using the RS232 interface - for example here. However the process can be unreliable especially if not using the RS232 hardware handshake signals. Without hardware handshaking it's not possible to transfer a file directly to disk because reading from the RS232 port stalls while writing to the disk and characters are dropped. A procedure that instead writes to memory must be used. The procedure presented here will be used - but instead of transferring the xmodem program the TRSDW driver is transferred. Those instructions are repeated here.

Note the file is written to the drive specified in this line of the TRSDW.BAS program:

31100 CLEAR 5000:CLS:DEFINT A-Z:H$="0123456789ABCDEF":READ LS$:LS$=LS$+":1"

Edit this line in the TRSDW.BAS file before sending if you want it written to a different disk.

Note you can also use the popular terminal emulator PuTTY instead of TeraTerm and just copy/paste the TRSDW.BAS test into the PuTTY terminal to perform the send file.

Copying Files From PC

Once the above example is working you can try copying some files from your PC which is running the drivewire server to your TRS-80. For just copying files you don't need the LDOS/LS-DOS on the virtual hard disk so just reboot your TRS-80 and reinitialize the virtual hard disk:

system (drive=7,driver="trsdw")

(accept defaults)

format :7 (dir=1)

trsdw

password

Then using trstools open the trsdw.dsk file and copy some files to the the virtual disk. In this example I copy some high resolution utilities and a hires picture (available here).

Do a dir to verify that the files are there:

dir :7

If the files are not there then in DriveWire4 right-click on Drive0 and select ReloadDiskInDrive0... and try again.

If you are lucky enough to have a high resolution card you can view the image:

hrload blast/hr

or (for Model3)

gload blast/hr

gron

Hit any key to return to the text screen (or for Model 3 execute groff).

Working With Multiple Drives

If all you are planning to use TRSDW just to copy files from/to a PC or to backup your other hard disks then a single drive is probably all you need. For backups you can just load the appropriate file into Drive0 of the drivewire server and backup to it.

However the DriveWire4 server supports multiple drives and the TRSDW driver up to 8 and can be used for your virtual hard drive solution if you Don't have a lotech IDE, FreHD, or M1SE/M3SE.

Most other hard disk drivers create multiple drives by partitioning a single disk. TRSDW like XTRSHARD and TRSHARD instead uses a separate disk for each drive as specified by the Unit number durng driver installation. Setting up multiple disks just requires installing the driver for each disk and specifying a different Unit number for each.

Following is an example of a typical setup with two floppy drives and six hard disks. Virtual Drive0 (unit 0) is first installed as drive :6, formatted, then LDOS/LS-DOS copied to it and made the system disk (swapped with drive :0). Then virtual Drive 1 (unit 1) is installed as drive :7, formatted, then swapped with drive :1. Then virtual Drives2-5 (units 2-5) are installed as drives :2-:5, and formatted. Finally the configuration is sysgen'ed to save the configuration to the boot floppy.

First create 6 empty virtual hard disk files (with mkdisk or sdltrs or just make copies of the one provided). Name them lsdos631.dsk (or for the Model1/3 ldos-531.dsk), disk1.dsk, disk2.dsk, ..., disk5.dsk and load them into Drives0-5 in the DriveWire4 server. Then execute the series of cammands below:

system (drive=6,driver="trsdw")

(Unit = 0)

format :6

(Name = lsdos631 or ldos-531)

backup :6 :0 (inv,sys)

system (system=6)

system (drive=7,driver="trsdw")

(Unit = 1)

format :7

(Name = disk1)

system (drive=1,swap=7)

system (drive=2,disable,driver="trsdw")

(Unit = 2)

format :2

(Name = disk2)

system (drive=3,driver="trsdw")

(Unit = 3)

format :3

(Name = disk3)

system (drive=4,driver="trsdw")

(Unit = 4)

format :4

(Name = disk4)

system (drive=5,driver="trsdw")

(Unit = 5)

format :5

(Name = disk5)

sysgen (drive=6)

or (for LDOS)

system (drive=6,sysgen)

You can list the drives with the devices command:

The steps which swaps the drives and makes virtual Drive0 the system drive and the sysgen are not required and depend on how you plan to use your system.

Building From Source

The TRSDW source TRSDW/ASM is included with the driver download. To build from the source just use the Z80 assembler from Matthew Reed. Assemble with the following commands:

z80asm.exe TRSDW.ASM

ren TRSDW.cmd TRSDW.DCT

Then copy the TRSDW.DCT file to a real floppy or emulated floppy/disk for use on your TRS-80.