[Simh] Console IO device servicing

Seth Morabito lists+simh at loomcom.com
Fri Jan 2 16:01:33 EST 2015


Hi all,

Work continues apace on my 3B2 emulator, and I've started to write a
UART simulator for the console IO. To keep it simple, I'm really just
using the Altair simulator's 2SIO as a baseline to study how it should
work and fit in with the rest of the simulator.

I'm having some trouble, though, and I don't understand what's going on.
For reference, please see the code here:

https://github.com/sethm/simh/blob/master/3B2/3b2_uart.c
https://github.com/sethm/simh/blob/master/3B2/3b2_cpu.c

The 'uart_svc' routine is getting called by the simulator whenever the
UART needs servicing, I know that part is working correctly. But it
looks like "sim_poll_kbd()" is returning 0 even when I've pressed keys.
I'd expect my debugging output "uart_svc. DATA=%02x" to be printed out
with every key stroke, but it's not.

If I really type a lot of keys, occasionally one or two will make it
through and be printed out. But usually nothing is!

I put the same debugging output in the Altair's 2SIO service routine,
and it captures each and every keystroke perfectly. The code is almost
identical between my UART and the 2SIO, so I'm perplexed.

Does anyone with simulator-writing experience have an idea of what is
going on?

Thanks,

-Seth




More information about the Simh mailing list