[Simh] Serial Console

Holger Veit holger.veit at iais.fraunhofer.de
Tue Jul 3 07:32:58 EDT 2012


Am 03.07.2012 13:03, schrieb Johnny Billquist:
> On 2012-07-03 11:49, Mark Benson wrote:
>> Simple question: Can SimH's CONSOLE output be directed to a Serial port
>> (i.e. via /dev/ttyS0)?
>>
>> If so how does it handle waiting for a terminal connection?
>>
>> If not, is there a reason why?
>
> I think I looked into this a few years ago, and found that it can't.
> There is no absolute reason why it would not be able to, but exactly how
> you control a physical serial port differs between OSes, so I suspect it
> would be hard to write generic.

C'mon. Who needs it to be generic? It is a matter of a proper SIMH 
abstraction for which then OS specific handling can be programmed.
Surely, it won't work, if the console were programmed with hardcoded
keyboard calls like
for(;;) {while (waitkbd()==NOCHAR) simulate_singlestep(); c=kbdget(); 
do_something(c); }

In a former life, I remember having played with some sim_serial.c to 
support glass terminals attached to terminal multiplexers, but somehow
this got lost, and I didn't find it again in current simh. David, hadn't 
we done something like that in HP2100?

Concerning waiting for a connection: it is not too different as waiting 
for a terminal mux for an incoming TCP/IP connection; usually every OS
has functions to check whether DCD or other serial handshake is 
initiated. The baudrate and word length should have been negotiated 
before, though. Surely, the implementation is again a big #ifdef OS
grave, even for different Unix dialects.

> However, I think that under Unix, if you just log in on a serial port
> and start simh, you'd be more or less there already?

Maybe not. You might want to have the target system I/O on a glass 
terminal and the simh console to issue attach/detach commands and alike
on a second one.

-- 
Holger



More information about the Simh mailing list