Dual Booting FreHD on TRS-80 Model III and Model 4

Introduction

FreHD is a solid-state hard disk drive emulator that connects directly to a real TRS-80. It was designed by Frederic Vecoven. It is an open-source design and is being built and distributed by Ian Mavric. The initially available version of FreHD is configured for use with the TRS-80 Model 4 running under LS-DOS 6.3.1.

This page explains how to re-configure your TRS-80 Model 4 FreHD hard drive emulator, so it can be used on the TRS-80 Model III (under LDOS 5.3.1), while retaining compatibility with the TRS-80 Model 4 (under LS-DOS 6.3.1).

The same method will also enable you to use the FreHD on the Model 4 in "Model III Mode", when booting the Model 4 with an LDOS 5.3.1 floppy disk. This provides a method for storing Model III software on the FreHD and running that software on the Model 4, in Model III mode.

Prerequisities

You will need:

  1. FreHD already configured and operating normally using LS-DOS 6.3.1 on your Model 4. It should be using the "hard4-0" image supplied by Ian Mavric.
  2. A bootable LDOS 5.3.1 DOS system floppy disk, with RSHARD5/DCT (from the MISOSYS RSHARD package).

The RSHARD package for the Model III consists of 5 files (HDCHECK5/CMD, RSFORM5/CMD, RSHARD5/DCT, ARCHIVE5/CMD and RESTORE5/CMD). To complete the process described in this webpage, you only need RSHARD5/DCT. The LDOS 5.3.1 disk images that can be downloaded from this page (see below) only have the first 3 of these 5 files. The full package of RSHARD files can be downloaded from Tim Mann's website (please see the Links section below).

Existing FreHD setup

Boot up your Model 4 under LS-DOS 6.3.1. Enter the DEVICE command. You should get the following output:

Note that you can omit the optional parameters from the DEVICE command. If you do so, the output will also include a "byte I/O" portion and an "options status" portion. The text displayed on this webpage assumes the longer form of the command (that is, with the optional paramters) is used.

As we can see from the output of the DEVICE command, the standard configuration of FreHD under LS-DOS 6.3.1 consists of 6 hard drive partitions named HARDA, HARDB, HARDC, HARDD, HARDE and HARDF mapped as logical drives 0 to 5 respectively. Each partition is 140 cylinders wide. When I say "partition", I am just referring to a region of the surface area of the hard drive. The hard drive does not have a "master boot record" or other data structure that records where any particular "partition" starts and finishes. Instead, this partitioning information is specified by the user and stored on the LS-DOS (or LDOS) boot floppy when it is SYSGEN'd. One consequence of this is that two differently configured boot floppies could establish differing partitioning geometries for the same hard drive. There would be no point doing this (indeed, it would likely lead to data being corrupted). I am just emphasising that the partitioning geometry is recorded on the boot floppy, rather than on the hard drive itself.

The overall size of the "hard4-0" hard drive is 840 cylinders by 6 heads.

The Plan

The HARDA partition currently contains the LS-DOS 6.3.1 system files. We won't touch this. It will be visible to our LDOS 5.3.1 system (as logical drive 1), but we won't be making use of it for the Model III.

We will re-purpose the HARDB partition so that it contains the LDOS 5.3.1 system files, and becomes our system drive for the Model III. Once our setup is complete, each time we boot the Model III (or the Model 4, in Model III mode), we must do so using an LDOS 5.3.1 boot floppy disk. LDOS 5.3.1 will then re-configure itself (on each boot) so that the HARDB partition becomes logical drive 0, and is used as the system drive (ie - LDOS will use the HARDB partition whenever it needs an LDOS 5.3.1 system file, rather than looking for it on the floppy drive). After the TRS-80 boot sequence is completed, the LDOS 5.3.1 boot floppy disk can be removed, as the system will no longer need it (until the next time we re-boot the TRS-80).

We will map the other hard drive partitions (HARDC, HARDD, HARDE and HARDF) to logical drives 2 to 5 respectively. Logical drives 6 and 7 will be mapped to be the two internal floppy drives.

Step 1: Configure LDOS 5.3.1 Floppy

Make sure your FreHD is plugged in and turned on. Otherwise, the TRS-80 will hang when LDOS tries to find its partitions.

Boot up using your LDOS 5.3.1 floppy disk. Enter the DEVICE command. You should get the following output:

At this point the partitions on the FreHD are not accessible as logical drives. We're going to fix that now.

First we will disable existing logical drives 1, 2 and 3. We do this so that we can re-allocate those logical drive numbers to some hard drive partitions. We can't disable logical drive 0 yet, because LDOS needs to have a system drive at all times.

If you enter the DEVICE command now, you will see that only one logical drive is now in use (drive 0).

Now we are going to start linking the hard drive partitions to logical drive numbers. LDOS won't allow us to select the partitions by name. Because of the way LDOS works, we must start with the first partition on the hard drive (being the partition that starts at cylinder number 0). The first partition we will encounter is HARDA, as it starts at cylinder 0. Let's link logical drive 1 to that first partition:

At the end of the above sequence, LDOS will briefly access the FreHD. You will see the green LED flash when this occurs. Note that we have told LDOS that the hard drive has 840 Cylinders and 6 heads. LDOS will use this information when we attempt to link the next partition. We have also told LDOS that this first partition uses the first 140 cylinders (and that the partition uses all 6 heads on those cylinders).

The second partition that we will encounter is HARDB. It starts at cylinder number 140. We are going to link logical drive 6 to this second partition. This might seem odd, but trust me for now. Later, we will do a swap that will move this partion to logical drive 0. So let's get on with it:

Again, at the end of the above procedure, LDOS will briefly access the FreHD. Note that LDOS didn't ask us the STEP RATE, number of TRACKS per surface, or total number of HEADS. It had all this information from when we added the first partition. It also knew that there were 700 cylinders that we haven't yet allocated to a logical drive.

Now we will link partitions HARDC, HARDD, HARDE and HARDF to logical drives 2, 3, 4 and 5 respectively:

We still have one logical drive (drive 7) available. Let's link the second floppy drive to that logical drive:

Let's use the DEVICE command to see the result of our work so far:

Notice that the "Step" setting for Floppy #1 and Floppy #2 are not equal. I am now going to change the step rate for Floppy #1 from 12 msec to 6 msec:

If you repeat the DEVICE command, you should see that both floppy drives (drives 0 and 7) are now set to 6 msec step rates.

The good news is that all 6 partitions on our hard drive are now visible to LDOS. The bad news is that all the work we have done will be lost as soon as we reboot. Let's SYSGEN the floppy disk, so this configuration is automatically used when we reboot:

Usually we would now FORMAT each of the 6 partitions on the hard drive, using the RSFORM5/CMD utility. But we will skip that step, as the paritions in "hard4-0" are already formatted.

Step 2: Move the FreHD utilities from HARDB to HARDE

The HARDB partition currently contains the FreHD utilities. These files are not required for normal use of FreHD, but are very useful for re-configuring the FreHD hardware, importing and exporting files from FreHD, and for re-flashing the program memory on FreHD.

We want to free up the HARDB partition, so we can later copy the LDOS 5.3.1 system files to this partition. So we are going to copy the FreHD utilities from the HARDB partition (logical drive 6) to the HARDE partition (logical drive 4):

Now remove the FreHD utilities from the HARDB partition (logical drive 6):

If you want to, do a "DIR :4" command to verify that logical drive 4 is the HARDE partition, and that it now contains the FreHD utilities. Similarly, you can do a "DIR :6" command to verify that logical drive 6 is the HARDB partition and that it is now empty.

Step 3: Copy the LDOS 5.3.1 system files from floppy to HARDB

Now copy the LDOS 5.3.1 operating system files from floppy disk to the HARDB partition:

Step 4: Set HARDB as the System Drive

We are now ready to "swap" logical drives 0 and 6, so that the HARDB partition now becomes the system drive:

Now run the DEVICE command one more time, to see our final configuration:

Now SYSGEN the boot floppy disk again, so that it does this "swap" of logical drives each time we reboot:

Finally, put a write-protect sticker on the LDOS 5.3.1 boot floppy, so the configuration does not get inadvertently changed.

Bypassing SYSGEN'd Configuration at Boot Time

When you boot the TRS-80 using the SYSGEN'd boot floppy disk, LDOS will read and use the configuration settings that were applied by the SYSGEN operation. This is how we will usually want to bring up the TRS-80, as it will make the hard drive partitions visible, and will use the HARDB partition as the system drive. The TRS-80 will execute LDOS commands much more quickly when run from FreHD, as it does not need to access the flopy drive to do so.

However at times we might not want this to occur. For example, if FreHD is not connected (or has failed for whatever reason), then the TRS-80 will hang when it attempts to access FreHD during the boot phase. Similarly, we may need to run the TRS-80 from a floppy disk (rather than from FreHD itself) when we want to upgrade or reconfigure the FreHD hardware (using the utilities that were provided with FreHD for this purpose).

To stop LDOS from applying the SYSGEN'd configuration at boot time, commence the boot sequence from the SYSGEN'd LDOS 5.3.1 boot floppy as normal. But once you have entered the current time (in response to the "Time?" prompt during the boot process), immediately press and hold down the CLEAR key. You will now be running LDOS 5.3.1 from the floppy disk, instead of from the HARDB partition. If you want to access any of the hard drive partitions, you will need to link them to unused logical drive numbers using the SYSTEM command as described earlier.

If you want to permanently remove the SYSGEN'd configuration from the LDOS 5.3.1 boot disk, type the command:

Note that LDOS 5.3.1 will hang after executing the SYSTEM(SYSGEN=OFF) command. You will need to reboot the TRS-80 for this change to take effect.

Links

Here are some useful links:


By Malcolm Macleod - 4 June 2013
malcolm at avitech.com.au