Keyboard Queue and a Video

While testing the performance of floating point operations, I wanted to see the effect of background processes on the textmandel process as it ran in the foreground. This turned out to be problematic to set up. Spawning a couple of blink processes before running textmandel caused console input to appear to block, where pressing return several times resulted in no more commands being executed.

Queuing problems

At first, I thought there might have been a problem with process scheduling, but input from the UART was still being processed, meaning that processes should still be scheduled. By chance, I discovered that pressing Ctrl-D to end the input caused things to move again, though this could still be unreliable.

I traced what was going on in tiny/sh.dis and os/port/devcons.c and found that there was probably something going wrong with the keyboard queue, kbdq, though this was after a detour where I tried the regular sh.dis and found that it didn't appear to suffer from this problem.

The cause of the problem is where I check for carriage returns in the bytes read from the UART and insert line feeds after each one, using two calls to kbdputc. The solution, or workaround, is to use qproduce to insert the two-byte sequence. I don't know why this problem arose, but I'll apply the same fix to all the other related ports.

Video from IWP9

Since information about next year's International Workshop on Plan 9 have been published, I thought I should revisit the video I recorded for my presentation last year. The live stream was recorded and published in pieces for the event, so my talk is already available online, but it seemed a shame to have recorded something that is never going to be seen, so I uploaded it to YouTube.

  Hell Freezes Over: Freezing Limbo modules to reduce Inferno's memory footprint

David Boddie
18 November 2023