Saturday, May 18, 2019

How to enter Ubuntu terminal with an (old) DOS computer and a nullmodem

It is possible to use a DOS computer and enter the Ubuntu terminal via a (serial) nullmodem cable.
Even without any network installed on the DOS computer I can read my mail, browse the web or service the Ubuntu server using my old DOS laptop.

I have been using a Tulip lt 286 and it comes with an external Floppy disk port, a VGA connector that can be used for an external VGA monitor, 1 external serial COM1 port, a 2400 baud modem on COM2, 1 PS/2 port for an external keyboard, 1 external printer LPT1 port, 1 internal ISA bus port used for the IDE hard disk and 3.5 inch floppy drive and an external ISA bus port originally intended for connection to an external box containing 2 ISA BUS connectors.
I could use the external ISA bus port for a network card but I do not have the ISA expansion cable needed for this.

Getting the Ubuntu server ready

As server I used a Ubuntu 18.04.2 LTS computer that has an external COM port. There are 2 ways to add a tty to it.

1: I added "console=ttyS0" to the file /etc/default/grub in the line that now says: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash console=ttyS0" 
Save the file. You might need to have admin rights to do that, if so, open the file with "sudo".After saving the file type "sudo update-grub" in terminal to enable the new boot options. Reboot the server to apply the changes.

Or:

2: Apply a Systemd service using Execstart=/sbin/getty -L 38400 ttyS0 

Its that easy, nothing to install.

Getting the DOS computer ready.

Getting software on the old laptop is a pain because most of my floppy disks are 20+ years old and they keep failing.

I installed DOS 6.22 on the laptop and installed Norton Commander 5.5 to copy files between several computers with a (serial) nullmodem cable.

I also installed IBM-PC MS-DOS Kermit v3.16 Beta 7 patch level 0 and (eventually) found it very helpful. But if you use this program for the first time you can be a little lost as it has a steep learning curve. Here is some excellent reading material on DOS/Kermit http://kermitproject.org/onlinebooks/usingmsdoskermit2e.pdf .

With the nullmodem connected to my Ubuntu servers COM port I can now connect to an Ubuntu terminal session.
Connected to an Ubuntu terminal session via COM1
After startup of Kermit on the DOS computer type "set speed 38400" to set the speed of the serial connection. Then type "c" to open the terminal and connect to the Ubuntu server. Al other default settings of Kermit are fine.

The (modern) Ubuntu server has a far higher serial port speed compared to the DOS laptop so you will have to press the ENTER button a few times to make a successful connection. Some random characters may appear on your screen. The Ubuntu server will start with a baud rate of 115200 but will try lower speeds and eventually a connection at a lower baudrate will succeed.

The first time I logged in there was in intriguing message on the screen.
"You have new mail."
What to do? I never had this message when I logged into the server using the server itself. I never knew the server handled any mail.

I typed "mail" and saw a long list of mails the kernel send me about failures etc.
Then "r" to read, "d" to delete, "n" for next message, and so on.
It turned out I had more that 2600 mails waiting for me and the standard mail application wanted me to read them all one by one.

Therefore I installed Alpine by typing "sudo apt install alpine" into the terminal on the DOS computer. To handle the mail instead of typing "mail" I type "alpine". Without configuring anything alpine takes over and handles all mails and shows them to you in an ordered and easy text interface.

To get double the rows (lines) and columns add the following line in your autoexec.bat.

MODE CON: cols=80 lines=50

Now all seems well until Midnight commander, Alpine or any other Ubuntu terminal program is opened. Only the upper half of the screen is used. There is no way Ubuntu can find out the dimensions of your terminal so it assumes you have a VT102 terminal that like most terminal types has only 24 lines of text. Type "sudo resize" to maximise the screen space the program is using to all full 80 x 49 characters instead of only 80 x 24. (sudo apt install xterm may be needed)

I can log into my Ubuntu server from my DOS laptop which is great and completely useless.
Next thing to try is running a graphical browser on my DOS laptop. Arachne runs fine but I still need that DOS TCP/IP driver.  

No comments:

Post a Comment