<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Mark,<div class=""><br class=""></div><div class="">I’m using the simh PDP-8 code that was distributed by Oscar Vermeulen for the PiDP-8, which is based on 4.0-0 Beta.</div><div class=""><br class=""></div><div class="">The console is set as follows:  set console serial=ser0;110-8n2. (Raspberry Pi hardware serial port)</div><div class=""><br class=""></div><div class="">The problem is that there is buffering going on somewhere between the simh PDP-8 and the serial port. (It's nice to have the PiDP-8 front panel to help troubleshoot problems.) If I do a directory listing or type a long-ish file, I can see the accumulator LEDs blinking for only a few seconds, but the printout takes minutes. This indicates to me that simh/PDP-8 is pushing the bytes out as fast as it can into a buffer somewhere. The data trickles out of the buffer at a leisurely 110 baud. By the time I see that I don’t want to finish printing what I started, a Control-C won’t do anything. I was able to at least put a bandaid on things by setting the tto_unit (pdp8_tt.c) wait value to where it slows down the data being pushed into the buffer to a rate approximating 10 characters per second. The accumulator LEDs now blink synchronized with the data, which is what I was looking for.</div><div class=""><br class=""></div><div class="">To me, the simulator should be able to simulate this, but where is the buffering and how can we eliminate it? Or do we want to? You would never even notice that this is a “problem” unless you have a front panel. If we are working towards having front panels of one kind or another (PiDP-8, blinkenbones, etc), I would think the emulator should output the data at the correct baud rate, not relying on buffers somewhere to take up the slack.</div><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Bill</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 5, 2016, at 6:18 PM, Mark Pizzolato <<a href="mailto:Mark@infocomm.com" class="">Mark@infocomm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Hi William.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Are you using the simh PDP8 code from<span class="Apple-converted-space"> </span><a href="https://github.com/simh/simh" style="color: rgb(149, 79, 114); text-decoration: underline;" class="">https://github.com/simh/simh</a>?<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">What does you configuration file look like?<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">With the latest code you should be able to connect the serial port the ASR33 is wired to to the simulator at its natural 110 baud rate.   Given that, doesn’t your problem go away?<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span></div><div style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: 'Times New Roman', serif; text-indent: -0.25in;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><span class="">-<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';" class="">         <span class="Apple-converted-space"> </span></span></span></span><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Mark<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a name="_MailEndCompose" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""> </span></a></div><div style="border-style: none none none solid; border-left-color: blue; border-left-width: 1.5pt; padding: 0in 0in 0in 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-color: rgb(225, 225, 225); border-top-width: 1pt; padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span>Simh [<a href="mailto:simh-bounces@trailing-edge.com" class="">mailto:simh-bounces@trailing-edge.com</a>]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>William Wuttke<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Sunday, June 5, 2016 5:54 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:simh@trailing-edge.com" class="">simh@trailing-edge.com</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[Simh] PDP-8 KL8E XON/XOFF<o:p class=""></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><u class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34); background-color: white; background-position: initial initial; background-repeat: initial initial;" class="">Problem:</span></u><o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34); background-color: white; background-position: initial initial; background-repeat: initial initial;" class="">When using a teletype on a serial port, XOFF will stop a directory listing (and others), but once that happens, the PDP-8/simh will no longer respond to keyboard input. I’m using a Model 33 ASR on a PiDP-8 (raspberry pi) hardware serial port.</span><o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><u class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34); background-color: white; background-position: initial initial; background-repeat: initial initial;" class="">Investigation:</span></u><o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34); background-color: white; background-position: initial initial; background-repeat: initial initial;" class="">All documentation says XON and XOFF should work from the console. Well, it does and it doesn't.</span><o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">If using "screen", it works, but apparently the XON/XOFF functionality lies somewhere other than in the KL8E handler. The typing stops when XOFF is sent. Then when XON is sent, you can see some buffered text appear on the screen fast, then the typing slows down to normal speed. (I set the tto unit wait value to 20000 to closely approximate real 110 baud serial output. Otherwise, a directory listing gets buffered up an about 3 seconds, but takes 2-3 minutes or longer to print out on the teletype. This also allows me to Control-C to quit the listing.) It looks like "screen" is buffering the text.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">If using the teletype, XOFF stops the typing, but XON does nothing - the machine is locked up in a loop at this point with 7623 in the accumulator (it works as coded). Looking at the KL8E handler, the tty check routine uses KRS to read a character, never resetting the keyboard flag. Apparently, since the KL8E had no buffering, if an incoming character is not read, it would be overwritten by the next incoming character, clearing the keyboard flag during the time that the character was not valid, then setting it after the character was assembled into the keyboard buffer. It looks like the KL8E handler was written depending on this behavior. However, it looks like the simh tti is acting like a modern UART, buffering up the input, and moving through the buffer as characters are read. The KRS instruction is for all purposes a "peek" at the next character in the buffer, which is exactly what the tti is doing. It keeps "peeking" at XOFF (7623 - 7600), which never really gets removed from the buffer. However, it really needs a "read", to advance to the next character. At least, that is what it looks like.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><u class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">Fixes?</span></u><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">I'm going to attempt to mod the KL8E handler to fix this, but might not have much luck since it already pretty much fills up its allotted two pages. It is filled with all sorts of assembly language trickery to fit into two pages. In my way of thinking, the simh KL8E is really “modified” hardware, and OS/8 can be easily adapted to new hardware. I think I have a fix, using KRB instead of KRS - I don’t think that using KRS was a good idea anyway, but on a real PDP-8 it would catch the XON as soon as it happened.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">Or, could a mod to simh do the trick? Could the KRS be modified to act like a KRB, but just OR’ing the keyboard buffer with the accumulator instead of clearing the accumulator it first? How would this affect other PDP-8 software that relies on KRS without subsequently clearing the keyboard flag? How common is the use of KRS in this way? I guess in this day and age, trying to eliminate all the buffering going on would probably be a real pain. And, the buffering on the input actually eliminates the need use the teletype Reader Control with simh.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">Does anyone have any ideas?<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">Regards,<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class=""> </span></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(34, 34, 34);" class="">Bill Wuttke</span></div></div></div></div></div></blockquote></div><br class=""></div></body></html>