CS452 - Real-Time Programming - Spring 2008
Lecture 21 - Serial Server
Questions & Comment
- 16550 UART
Serial Server
Policy issues
- One or two servers?
- How should screen echo be handled?
- and DELETE/BS, and line-editting, and ...
- How should the buffers in the UART be handled?
- Who will initialize the hardware?
- What traffic do I expect through the server?
- Should the be I/O units above the single character level?
As a general policy we would like to concentrate the hardware
dependence
Hardware
RS232
Three-wire
- transmit
- receive
- ground
Seven-wire
Add
- DSR - terminal to computer, `I'm ready to communicate.'
- DTR - computer to terminal, `I'm ready to communicate.'
- CTS - terminal to computer, `I'm ready to receive a byte.'
- RTS -computer to terminal, 'I'm ready to receive a byte.'
Curiosity,
- RS232 is +13V, -13V
- RS232 has current loop implementation
UART
Four interrupts
- Transmit buffer empty
- Receive buffer not empty
- Line status changed
- Modem status changed
Twelve registers.
- 0 (read) Data to transmit
- 0 (write) Received data
- 0 (dlab set) Divisor latch
- 1 Interrupt enable: R/W
- 1 (dlab set) Divisor latch
- 2 (read) Interrupt identification: R
- 2 (write) FIFO Control: W
- 3 Line control: R/W
- 4 Modem control (DTR, RTS): R/W
- 5 Line status (Enables divisor latches): R
- 6 Modem status (DSR, CTS): R
- 7 Scratch
Accessing the registers
Stubs
int Get( int port );
int Put( int port, int c );
Both are Send
s to a serial server
Software
More than one Notifier
One (or more?) server(s)
What about guards?
- Does it make sense to have more than one reader/writer task per
port?
- If it does how should they be related?
Return to: