/* pdp18b_g2tty.c: PDP-7/9 Bell Labs "GRAPHIC-2" subsystem as a TTY via TELNET from 13-Sep-15 version of pdp18b_tt1.c Copyright (c) 1993-2015, Robert M Supnik Copyright (c) 2016, Philip L Budne Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Robert M Supnik shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Robert M Supnik. Doug McIlroy had this to say about the Bell Labs PDP-7 Ken Thompson created UNIX on: The pdp7 was cast off by the visual and acoustics research department. Bill Ninke et al. built graphic II on it -- a graphics attachment as big as the pdp7 itself. The disk was an amazing thing about 2' in diameter, mounted on a horizontal axis. Mystery crashes bedeviled it until somebody realized that the axis was perpendicular to the loading dock 4 floors below. A 90-degree turn solved the problem. GRAPHICS-2 was a command list based graphics display system, and included a light pen, a "button box" and status bits for a "dataphone" interface to speak to a GECOS system. The UNIX-7 system driver only uses text display, and reserves 269 words (holding two characters each; the buffer is 273 words, but three contain display "setup" commands, and the final word in the buffer must be a display "TRAP" instruction that ends the display list). The UNIX system code triggers a refresh every 10 60Hz "ticks" of the real time clock. This driver attempts to do detect new text and send it to a user who has TELNETed in. Thoughts on implementing a web interface: 538 characters redisplaying at 6Hz (every 10 "ticks") gives a bandwith requirement of only 26Kbit, and most refreshes won't change the screen and could be suppressed. So it seems like it would be reasonable to create a web interface. Make a SIMH TCP server port which implements a tiny HTTP server. The base URL serves up a skeletal page with (lighted) buttons, and a "display window". And either: 1) Use "AJAX": an (invisible)