next_inactive up previous
Up: W9CF Home

Notes on running TRlog under Linux

Kevin Schmidt, W9CF, 6510 S. Roosevelt St., Tempe, Arizona 85283

1 Introduction

These notes describe how I run TRlog using DOSEMU under linux. I have borrowed freely from various people who have posted suggestsions on the TRlog mailing list. In particular posts by Tor, N4OGW, have been very helpful. All mistakes are, of course, my own.

2 Disclaimer

I have done only limited testing, and I don't understand how DOSEMU or TRLog really work. If your computer crashes, your hair falls out, or anything else bad happens to you after following these directions, don't blame me! If, however, you win the lottery, I am willing to share.

3 DOSEMU and Freedos

You need to have DOSEMU with Freedos installed. These are available from

3.1 Installing

Download the stable release and install it. I use the binary version of Freedos (currently beta 0.9 rc5) and compile the source for DOSEMU (currently dosemu-1.2.2.tgz). Follow the directions in the file INSTALL.

If you want to use your sound card as a voice keyer, please see section 6.2 below on SBDVP where I describe how to set up a version of DOSEMU available from cvs which works better. I recommend that, in any case, you first get the stable version running before dealing with a development version.

3.2 Configuration

After installation edit the global configuration file (/etc/dosemu/dosemu.conf by default). I added the following lines:

$_rdtsc = (on)
$_com3 = "/dev/ptyq1"
$_com4 = "/dev/ptyq2"
$_ports = " device /dev/lp0 fast range 0x378 0x37f"
$_ports = $_ports, " device /dev/null fast range 0x3f8 0x3ff"
$_ports = $_ports, " device /dev/null fast range 0x2f8 0x2ff"
The first line uses the pentium timer. I don't know if this is necessary, but Tor, N4OGW, recommended it, and I never turned it off. The second two lines tell DOSEMU to use the linux pseudottys /dev/ptyq1 and /dev/ptyq2 as the com3 and com4 serial ports rather than hardware serial ports. This will allow us to connect these fake serial ports to linux applications like telnet or secure shell for packet or networking. Note that no other application should be using the pseudottys specified. The newer way to do this is to use system calls to open the unix98 device /dev/ptmx to get a unique pseudotty. However, since DOSEMU doesn't do this, the older method must be used. Here I just pick some BSD legacy pseudottys and hope that no other application will use them (however, since most applications will use the /dev/ptmx method a collision is unlikely). Note that these legacy pseudo ttys may not be turned on by default with some distributed 2.6 kernels. If that is your case, you will need to recompile the kernel with legacy (BSD) PTY support to be able to connect TRlog to other applications. If you just want to use the hardware serial and parallel ports as in DOS you do not need to use the pseudottys.

The last three lines gives DOSEMU permission to use the port range range needed for direct hardware serial and parallel port access so TRlog can key through the serial or parallel port. Notice that it associates the parallel port with the linux device /dev/lp0, so if something else in linux is using /dev/lp0, these ports will not be available.

My shack computer has two serial and one parallel port. I can tell TRlog to use serial 1 or 2 or parallel 1 for keying, etc. Packet and networking between computers running TR is done using the fake serial ports 3 or 4.

I have not found it necessary, but adding the line

$_hogthreshold = (0)
will give DOSEMU more cpu power if there are timing issues.

3.3 Running as root

For TRlog to have permission to have direct access to the parallel or serial ports, unfortunately, DOSEMU must be run as root. I do this with sudo. First use visudo to edit the sudo configuration file. My shack computer is called boltzmann, so to allow user w1aw to run DOSEMU on boltzmann as root without typing a password, I add the lines
w1aw boltzmann=(root) NOPASSWD: /usr/local/bin/dosemu.bin
w1aw boltzmann=(root) NOPASSWD: /usr/local/bin/xdosemu
be sure to change w1aw, boltzmann, and the location of dosemu.bin and xdosemu to the appropriate values for your set up.

I start DOSEMU under X windows with the command

sudo xdosemu

4 Packet with telnet

With the configuration I use, com3 under dos is connected to pseudotty q1. With the shack computer connected to the internet (I have a dsl line at home with a wireless network, so the shack computer is connected whenever it is on.) After starting TRlog in the xdosemu window, with TRlog's logcfg.dat having the lines:
I open a shell and type:
stty icrnl erase '^h'  < /dev/ttyq1
telnet < /dev/ttyq1 > /dev/ttyq1
The first line tells the pseudotty to use control-h as the backspace key and to add carriage-returns to the newlines. The second line connects the pseudotty to N7US's telnet cluster in Mesa, Arizona. You should use a cluster close to you. At this point I can use ctrl-b in TRlog to log in to the packet cluster and receive spots.

5 Connecting TRlog using linux networking

With the configuration I use, com4 under dos is connected to pseudotty q2. Turning on the networking in TRlog with
I then open a shell on each computer and type
ssh receivecomputer "cat < /dev/ttyq2" > /dev/ttyq2
where receivecomputer is the name of the computer I want to send my data to around the networking loop. Do the same on the other computers to complete the loop. I have assumed that they all are using pseudotty q2. If not adjust the devices accordingly when performing the ssh command. Notice that this uses whatever hardware you have set up for networking under linux. It will work with ethernet, wireless, parallel or serial port ip, ppp, ieee1394, or whatever else you have. My set up uses ethernet and wireless.

6 Voice Keyers

External voice keyers should work as under DOS if the corresponding ports are set up correctly.

SBDVP, which is available at, can integrate a sound card with TRlog. However, it only partially works under DOSEMU 1.2.2 without changes. DOSEMU emulates to some extent a soundblaster. Run SBDVP as under DOS.

6.1 SBDVP problems

There are two main problems with DOSEMU 1.2.2. First, SBDVP will not record under DOSEMU 1.2.2. You can work around this by recording your files under linux before loading them with SBDVP. Second, under DOSEMU 1.2.2, the last half second or so of audio is not played. You can work around this by adding a little dead air at the end of the messages. In addition, occasionally, small amount of audio is skipped.

Most linux distribution come with the sox package which contains frontends rec and play. For example, to record cqf2.dvp in an SBDVP compatible format, use

rec -r12048 -c1 -fu -b -t raw cqf2.dvp
You can play the file under linux as
play -r12048 -c1 -fu -b -t raw cqf2.dvp
to see how it sounds. The flags on these commands say to use a rate of 12048 Hz, one channel, i.e. not stereo, use unsigned, data is in bytes, write raw data to file cqf2.dvp.

6.2 SBDVP solutions

If working around the problems described above is too annoying, you can make SBDVP work properly by getting the source for the developer version of DOSEMU from CVS. Since the current CVS version is the bleeding edge, and changes often, it sometimes has bugs. A version that works well for me is from December 1, 2004 19:00 GMT. You can obtain this by typing
cvs login
cvs -z3 \
checkout -D "December 1, 2004 19:00 GMT" dosemu
just hit return when prompted for the login password. You can leave out the backslash at the end of the line if you type the second cvs command as one long line. Follow the CVS Tree link at for more information. This CVS version can record within TR at 8000Hz and does not have the play back problem. Compile and install as before.

With this version of DOSEMU, SBDVP will record and will play. However since recording currently only works at 8000Hz, SBDVP should be started with its rate set to 8000Hz,

sbdvp -r8000
If you test with the file cqf10.dvp distributed with SBDVP, Hal's voice will be rather low pitched and slow since it was recorded at the 12048 rate. Files recorded within SBDVP will use the 8000 Hz rate.

Note: In my limited testing, occasionally a bit of audio is still skipped.

If you want to prepare or listen to files under linux, use 8000 instead of 12048 in the play and record commands shown above.

7 Window Managers

Many window managers use various control and alt function key combinations for ``hot keys'' to move, resize etc. windows. If you run under X as I do, these may not allow those combinations to get to TRlog. The simplest solution is to turn off these hot keys when using DOSEMU and TRlog. All window managers have some method of customizing these hot keys. Check your window manager documentation.

next_inactive up previous
Up: W9CF Home