Sunday, June 21, 2020

Experimenting with my 3178 terminal using Andrew Kay's 3174 control unit replacement

RUNNING HIS SEVERAL TEST SCRIPTS

Andrew provides a set of scripts that accomplish functions such as polling, writing data to the screen, moving the cursor location, and all the others that are available to send between an IBM control unit and a 3270 class terminal 

One of them wrote Hello world! three times across the first line of the terminal. The second one polled the terminal for responses as well as writing Be sure to drink your ovaltine on the screen. The character mapping that I had found on bitsavers wasn't helpful but Andrew took pictures of the result of all possible hex data values. 

MODIFYING THE SCRIPT A BIT

I updated the 'ovaltine' script slightly just to experiment with the keyboard and to try out the special control characters that are displayed on the lowest (status) line of the terminal. At the end I looped doing polls of the terminal, printing out the scan code of any returned keypresses. 

Scan codes for 'hello world!' keypresses

WHAT I LEARNED THAT SURPRISED ME

IBM documentation on the 3270 terminals described the process of an operator entering data into fields and then hitting Enter as a local activity. It implied that you use the arrow keys to move the cursor around, then when the cursor is in an unprotected field, keys you press show up on screen and are marked as a modified field. The Enter is the only action sent on, with the mainframe program then reading modified fields to extract the newly typed data. 

It suggested that you could change it several times but only the final is seen when you hit Enter. I presumed, incorrectly, that the local process described above was done totally in the terminal and didn't involve the 3174 control unit except for when the Enter key was pressed. 

As I began to experiment, I realized that the keyboard and the display side are independent. They share a coax interface to the 3174 but nothing done on the keyboard directly affects the display on monitor.

Instead, the 3174 continuously polls the terminal and receives responses to every keypress! The 3174 is then responsible for sending an echo of the character back over coax to the display buffer. 

This explains why there is no configuration switch on the terminal to indicate which of the many keyboard types are attached. The system programmer will configure the 3174 to tell it which keyboard, such as typewriter or data entry style, so that the control unit can decide that a given scan code for a keypress is a given screen character. 

Some keyboards have the numbers across the top, others have them shifted above letters, as a consequence the 3174 has to decode the keyboard and convert that to a given 3270 character. 

A request for Terminal ID returns information about which keyboard is attached, what the size of the screen display is, and the protocol spoken. 

Much of what I thought was handled in the terminal is purely processed in the 3174. The screen has attributes at the front of each field which set the intensity, hide the data and determine if the field can be typed into. Since the KB and display buffer are independent, protecting a field is solely done in the 3174 not the terminal.

Even tabbing to get to the next field is done totally in the 3174, which maintains a shadow buffer to match the one in the terminal driving the CRT. 

No comments:

Post a Comment