The initial error I had was due to two spots in the code that didn't handle wraparound of buffer addresses. Andrew already had a function handling this in most spots, thus it was easily added to the remaining code that incremented the address.
LIGHT PEN ERROR MESSAGE WHILE BRINGING UP MVS
I then fired up the Hercules simulator with the turnkey MVS 3.8J system, using oec and my terminal to connect as the primary system console at x010 and control an IPL that I began from the MVS sysres pack.
Things proceeded decently for a minute or so until I had to reply to a JES2 startup message. I entered a valid reply - R 00,Y - but when I hit ENTER I saw an error message about invalid light pen selections. I had no way to bypass this problem so it had to be fixed.
RESOLUTION OF THE LIGHT PEN ISSUE
I worked with Andrew after enabling the debug logging he had in his code, collecting the results and interpreting them to figure out what was going wrong. Eventually Andrew spotted an issue with addressing mode and suggested a very tiny change.
The 3270 systems can send buffer addresses in three different modes - 12 bit, 14 bit and 16 bit. The oec code was working in 14 bit mode however it appears that the MVS operator console expected 12 bit versions.
Addresses are always transmitted as two bytes. In 12 bit mode, the bottom 6 bits of each byte are combined to form the full address. In 14 bit mode, the first byte uses the bottom 6 bits while all 8 are used from the second byte. Using all bits gives the 16 bit addresses.
Terminals come in various buffer sizes - reflecting various numbers of lines and columns per line. Most of them are easily addressed with 12 bit addresses and that was likely the initial and only mode for 3270 terminals. My terminal needs to address 1,920 locations, well under the limit of 12 bit mode.
SUCCESSFUL STARTUP OF TURNKEY MVS 3.8
With the code changes put in place, I was able to successfully bring up and operate the MVS 3.8 system using my terminal. I created a quick video here to show the results.
Carl, a couple of questions:
ReplyDelete1. I apparently missed the post about how the terminal attaches to the emulated control unit. Did you implement a oax interface?
2. Are you and/or the original author going to open-source the emulation code? Did you say it’s Arduino? Given the number of old terminals floating around, it seems it might be useful.
The attachment is by coax cable to a special shield hooked to an Arduino Mega 2560. This shield/Arduino handles the physical layers talking to the terminal and passes those over a USB serial link to a PC or Mac.
ReplyDeleteThe author, Andrew Kay, has open sourced the entire project including the PCB design files and detailed parts list. Easy to buy the board - about $10 for a set of five boards from a fab. A few of the parts need to be bought from eBay since they are not currently produced, but everything is easily obtained.
No surface mount, very easy soldering as a project.
https://ajk.me/building-an-ibm-3270-terminal-controller describes his project and points you to the pycoax and oec submissions on github. https://github.com/lowobservable
He has it working with 3278 and 3843 terminals, while I added support for my 3178 with the Data Entry Keypunch keyboard. Dave Wade has made it work with some plug compatible 3270 like terminals.