IBM 5251 terminal USB conversion (but not what you think)
Posted: 09 May 2020, 00:46
This is a continuation of this post where I describe an IBM 5251 terminal I recently found. It is about a USB conversion, but not what you think...
This terminal is in good shape and doesn’t need a restoration at all, it doesn’t even need a deep cleaning, so an obvious question was what was I going to make with it to have some fun.
One possibility was the usual direct USB keyboard conversion (commonsense, xwhatsit) to use it in a modern machine, but I already have a converted Beamspring and I would have no use for another one. I also didn’t want to throw the keyboardless terminal away once the keyboard was converted.
Another possibility was plugging the terminal itself to something to use it, but I would need a System 36/38 or an appropriate AS/400, that I don’t have space for or desire to get. There is no way (or at least I haven’t discovered it) to plug this thing to a modern system, for several reasons:
It is somehow like a “Frankenstein” of different parts: A physical interface based on a couple of SN7511X line drivers and a LM361 analog comparator, the wire protocol converter is implemented using a Teensy 4 (very powerful and easy to program indeed, I’ve fallen in love with it), and the terminal conversion is implemented with a Python script in the PC side (for Linux only).
And this is the final result, a bash shell on the 5251 that is now fully, or at least 99% VT52 compatible.
Positive aspects from the project:
Closeup of the adapter.
The adapter wired to the computer, to the terminal and to an external power supply.
A couple of screenshots.
Quick video showing the command line and a couple of apps, including browsing deskthority.net!
Note the insanity of the way IBM implemented the audible alert (BEL character) using the keyboard solenoid rattling like a machine gun. The first time I hear it I almost fell off the chair.
And this is the real killer app for this terminal, cmatrix!
As I said the technical details will follow in later updates, but I suppose that people that could be interested in replicating this can be counted off the fingers of one hand…
This terminal is in good shape and doesn’t need a restoration at all, it doesn’t even need a deep cleaning, so an obvious question was what was I going to make with it to have some fun.
One possibility was the usual direct USB keyboard conversion (commonsense, xwhatsit) to use it in a modern machine, but I already have a converted Beamspring and I would have no use for another one. I also didn’t want to throw the keyboardless terminal away once the keyboard was converted.
Another possibility was plugging the terminal itself to something to use it, but I would need a System 36/38 or an appropriate AS/400, that I don’t have space for or desire to get. There is no way (or at least I haven’t discovered it) to plug this thing to a modern system, for several reasons:
- The physical interface is Twinax cable, that is a weird dual core shielded cable similar to coaxial that is nowadays very obsolete. There are twinax ISA cards out there (I have one for an IBM 5160), but there is another problem with them.
- The second problem is that the 5250 protocol is master-slave and the host acts always as a master, so even if you plug two terminals together or a terminal and a PC with an ISA card there is no way the terminals and the PC can talk to each other. The PC software available is terminal emulation software, not host emulation. The only hosts available are “real” hosts and as I said I don’t have one.
- The third problem is that the 5250 terminals use EBCDIC character encoding, essentially proprietary IBM shit that was very different from the standard ASCII.
- Build a physical interface to convert from Twinax to USB.
- Build a protocol converter to read and write 5250 frames from/to a PC.
- Program a terminal converter to adapt a Linux-friendly terminal to the available 5250 commands and EBCDIC charset.
- Post an entry in desthority,net from the terminal (!).
- Entertain me during the pandemic.
- Do not burn too much money in the process.
It is somehow like a “Frankenstein” of different parts: A physical interface based on a couple of SN7511X line drivers and a LM361 analog comparator, the wire protocol converter is implemented using a Teensy 4 (very powerful and easy to program indeed, I’ve fallen in love with it), and the terminal conversion is implemented with a Python script in the PC side (for Linux only).
And this is the final result, a bash shell on the 5251 that is now fully, or at least 99% VT52 compatible.
Positive aspects from the project:
- The 5251 is back to life.
- Best keyboard ever in its original package.
- Loud as hell.
- No need to modify the terminal, just plug to the standard Twinax connector.
- Can be used 152 meters away from the computer, if you have enough money to waste in such a cable.
- Learnt a lot of stuff in the process.
- It is still a heavy beast, I hardly can put it over the table.
- The converter needs external power.
- It is not the fastest terminal ever, specially for scrolling text, but it is perfectly usable
- Lacks some important characters on screen. For example, in my spanish version there are no dollar ($), pad (#), or exclamation (!) characters (c’mon IBM…).
- The original 5251 keyboard controller only supports three break keys (as those who use an external converter know well) so you have just one SHIFT, one CTRL and one ALT, and they have to end up in weird positions, so it’s not ideal for daily usage.
- Probably the most expensive and troublesome way to get a simple Linux bash shell nowadays.
Closeup of the adapter.
The adapter wired to the computer, to the terminal and to an external power supply.
A couple of screenshots.
Quick video showing the command line and a couple of apps, including browsing deskthority.net!
Note the insanity of the way IBM implemented the audible alert (BEL character) using the keyboard solenoid rattling like a machine gun. The first time I hear it I almost fell off the chair.
And this is the real killer app for this terminal, cmatrix!
As I said the technical details will follow in later updates, but I suppose that people that could be interested in replicating this can be counted off the fingers of one hand…