The implementation is a standard SystemC module communicating via the Rx buffer and Tx port. It has a SystemC method sensitive to writes to the Rx buffer and a SystemC thread listening to the xterm.
The setup of the pseudo-TTYs and the xterm in a separate process
uses standard operating system functions, not described further
here. The key factor is that the file descriptor for the pseudo-TTY to
the xterm is set up to be asynchronous, with Linux signal
SIGIO
raised when input is available and handled by
the ioHandler()
function.
The terminal module class, TermSC
implementation may be found in
sys-models/simple-soc/TermSC.cpp
in the
distribution.