Serial devices


TTY ports (serial input lines) are handled uniquely. Since the data is fairly volatile, it needs to be handled quickly. However, since it may involve some extensive work, especially when dealing with STREAMS, it can't all be done at a high-priority level. This results in a two-phased scheme.

Every incoming character for the standard serial ports (the ZS devices, which stands for Zilog Serial ” the chip that handles them) results in an interrupt request. The hardware has a very small, two-character "silo," which it uses to store the character until the software function can get to it. If the CPU doesn't get there in time, the data will be overwritten, resulting in a "silo overflow" condition and an error message to that effect on the console. This situation means data was lost, although normally it's associated with the mouse and is not catastrophic. The interrupt service routine doesn't want to spend much time worrying about character processing, so it just grabs the character(s) from the silo and stuffs the data into a small circular "ring buffer," which normally holds about 256 characters . Very high speed input on the serial lines may result in the ring buffer being filled before the STREAMS code can get to it; this may result in a "ring buffer overflow" message. The interrupt service routine now sets a flag noting that data is available, and one of the housekeeping functions done at clock-tick time will take the incoming data and parcel it out to the correct Stream. The STREAMS code, also run periodically based on clock ticks , does whatever processing is necessary, such as recognition of special characters like Control-C, echoing back to the originator, or sending full lines of text to the user programs.

If the system is locked up at a priority level higher than 1, this may result in the L1-A (or Stop-A) key sequence apparently being ignored. It's not really ignored, but the system won't get around to processing it until the STREAMS code (at level 1) is allowed to run. This may never happen: the system looks (and is) hung. A "break" on an ASCII terminal used as a console (or unplugging the normal keyboard and plugging it back in again) may have better results, because this is actually a line condition rather than an incoming character and, as such, can be recognized and handled by the higher-priority ZS interrupt service routine.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net