termios+PTY=real-time killer? (was Re: Interrupt Latency on PPC)

Eric Norum eric.norum at usask.ca
Mon Nov 19 14:13:58 UTC 2001


"Fernando RUIZ CASAS (E-mail)" wrote:
> 
> My own implementation (a very particular) ot PTY is a way to
> give to shell() a tcp/ip solution but with a standard conection telnet
> client.
> 
> I couldn't think in this kind of problems when the implementation.
> 
> What is a PTY server?
> 
> Maybe is the real PTY (unix like) implementation with several layers
> and several task envolved?
> 
> My goal was only build a remote console. The real pty implementation is
> too complicated for my goal. But if this is a common goal I can think it.
> 
> >  + Does this mean that the PTY  is doing socket IO inside
> >    an interrupt?  If so, I suspect this is very dangerous.
> >    Eric Norum should comment.
> 
> The PTY don't make use of interrupts to work.
> It's only a termios driver callbacks in POLL (not interrupt) mode.
> It's the socket implementation who does the wait (getchar()) and more.

Unfortunately the device.write() routine is called with interrupts
disabled so the PTY driver ends up calling socket I/O routines with
interrupts disabled (!!!).  I agree that this should be fixed. 
Interrupts should be disabled in the termios code only if
interrupt-driven mode is used.  I don't have time to make this fix, but
it shouldn't  be too hard (i.e. ``left as an exercise for the reader'').

I'd like to implement the full termios code from the BSD distribution. 
I need some incentive$ and a place to publish the results, though.  This
would be a pretty major change (5.0 perhaps??) and might be best handled
by providing two I/O and networking source bases for RTEMS: 
1) a lightweight one based on the existing termios code (maybe even
stripped down to remove flow control....) and the LWIP network stack 
2) a heavyweight one based on the full BSD network stack and termios
code.  This would finally give a working select() on both TTY and socket
file descriptors.


-- 
Eric Norum                                 eric.norum at usask.ca
Department of Electrical Engineering       Phone: (306) 966-5394
University of Saskatchewan                 FAX:   (306) 966-5407
Saskatoon, Canada.



More information about the users mailing list