Tandy TRS80 M100 Serial Terminal

IMG_20160902_142116

Since getting my Tandy M100, I’ve always wondered about connecting it to my main Linux machine. Doing so wasn’t beyond the realm of possibility and if successful, it would open up a whole range of things I could do with my tiny computer. Fortunately, there are two tutorials on the subject, but sadly both of them are out of date with the current distro’s of Linux. What follows is my revised version of both tutorials.

I will point out that this setup isn’t perfect, while I had no problem going on IRC chat and browsing directories, I discovered doing other things, such as using text editors was fraught with problems. The text wouldn’t load up on the screen properly or overlapped as the screen scrolled. While this is disappointing, I did find that I could upload text to an open document on my main PC. By running a session of Nano, I could press the UPLOAD button on the M100, select a file stored locally in the M100’s memory and load it in to the empty Nano document. While this isn’t exactly ideal, it does mean I no longer have fiddle around with Minicom. I can quite literally connect the M100 to my main pc and upload the document straight to the Hard Disk.

For any serious use, I would highly recommend using mComm, developed by Kurt McCullum. Availible on Windows and Android, it offers a convenient mass storage media for any TRS80 M100 Micro  computer.

Setting up Linux

First we need to teach Linux the TRS100, so that it knows how to display the console when the Micro connects via serial. With a 40 column display, getting text to fit right is pretty important.
First type

"Sudo nano /etc/trs100"

With the empty document open, paste in the following text.

trs100|Radio Shack Model 100:\
 :am:bs:xt:\
 :co#40:li#8:\
 :al=\EL:bl=^G:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :\
 :cr=^M:dl=\EM:do=^J:ho=\EH:kb=^H:kd=^_:kl=^]:kr=^\:\
 :ku=^^:le=^H:nd=34:se=\Eq:sf=^J:so=\Ep:up=\EA:\
 :ve=\EP:vi=\EQ

Originally part of Terminfo, because of it’s age the configuration profile for the model 100 was relegated to a UFO archive in the mid 90s. Luckily Eric S. Raymond found the file and published the details on his website.

With the text now pasted in place, save the file by pressing Ctrl+O, name it trs100. Before we can do anything with this file, we first need to make sure ‘libncurses5-dev’ and ‘libncursesw5-dev’ are installed on your computer. Type the following command in the terminal:

sudo apt-get install libncurses5-dev libncursesw5-dev

With the above files installed, we can now compile the terminfo file we
created by typing the following command

'tic /etc/trs100'

Providing there weren’t any errors, we can now move on to configuring Linux.
This is where things get a little more involved.

Since the last tutorial was written, Systemd has replaced the init sy which is used to open a console session via the serial port. Without it, it would be unable to communicate with Linux. So we must revise what the original tutorial tells us to do. Let’s begin by opening up a new document in Nano with the following command in the terminal

sudo nano /etc/init/ttyS0.conf

With nano open, copy and paste the following in to the window.

# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[12345]
stop on runlevel [!12345]

respawn
exec /sbin/getty -L 600 ttyS0 trs100

Save and close the document using Ctrl+O to save. While still within the terminal, type the following command.

sudo start ttyS0

By entering that command, you’ve now started a console via the serial port. But before you go trying to plug in your Micro, there’s just one last thing we need to do. If you’re serious about using your Model 100 with your Linux machine, one thing you might like is to have the output of the console visiable as soon at the PC loads up. To achieve this, we will need to alter the Grub configuration file.

While in terminal, type the following command and press enter.

sudo nano /etc/default/grub

Look for the follow entries and alter them to look exactly as they are
listed here.

GRUB_CMDLINE_LINUX="console=ttyS0,600,trs100"

Tip- ttys0 tells Linux which serial port to use, this could be change to ttyS1. 600 sets the communication speed to 600 baud, while this might seem slow, going higher can potentially cause data corruption. Specifying the trs100 profile, allows the console to display properly on the tiny screen of the micro.
# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=600 --unit=0 --word=8 --parity=no
--stop=1"

Tip-By invoking “console serial”, Grub is told to output via the display and serial. –unit=0, you might want to change this to 1, if your using ttys1. Providing all the fields are now updated, let us recompile the Grub configuration file using the following command

Sudo update-grub

Some text will scroll up the screen, similar to what is below.

Generating grub configuration file …
Found linux image: /boot/vmlinuz-3.13.0-55-generic
Found initrd image: /boot/initrd.img-3.13.0-55-generic
Found linux image: /boot/vmlinuz-3.13.0-54-generic
Found initrd image: /boot/initrd.img-3.13.0-54-generic
Found linux image: /boot/vmlinuz-3.13.0-53-generic
Found initrd image: /boot/initrd.img-3.13.0-53-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic

Now connect your null modem cable to your PC and your Model 100. On your Tandy computer, run Telcom and type ‘STAT 48n1e’ followed by ‘Term’. Now place the micro to one side and reboot your Linux machine. As it is rebooting, watch the display on the Model 100, it should begin to display information. If not, you may need to look at what serial port your using, as it might be ttyS1, instead of ttyS0. An easy way to find out is to use Minicom, which allows you to quickly swap between com ports and communicate with your Model 100.

Providing all has gone well, you should see a prompt asking you to enter your username and log in to Linux.

Now go have fun!

 

Thanks goes to

Sean Gallagher, Brian Hicks, wiki.archlinux.org and help.ubuntu.com

Without whom making this tutorial would have been much much harder.