RS-232 terminals (1) 3.5 Terminals Still widely used to connect terminals to Standalone terminals with RS-232 serial mainframe via a modem (airlines, banks, etc)
interfaces for use on mainframes PCs often provide a text-only window which PC displays with GUI (Graphical User emulates an RS-232 terminal, in order to use the Interface) highly reliable legacy software (e.g., vi and emacs,
Network terminals (e.g., X-terminals) using telnet) ¡ Dumb terminal: sends/receives character sequences
¡ Intelligent terminal: understands some control commands (e.g., cursor movement) sent as escape sequences.
6/13/2001 1 6/13/2001 2
RS-232 terminals (2) Universal Asynchronous Receiver Transmitter Input software for keyboard (1)
£ Connected via serial or parallel port
£ CPU is interrupted on every key stroke; keyboard driver extracts the typed character by reading the I/O port ¤ On Pentium machines, keyboard contains microprocessor which communicates through a serial port with controller chip on parent board. ¢ Uses a 9-pin or 25-pin connector (includes pins for xmit, recv, ground)
¢ Sends each character in a frame (start bit, data bits, parity bit, stop bits)
¢ Named /dev/tty1, /dev/tty2, … in Unix, and COM1,COM2, … in Windows
¢ tty stands for “Teletype”, originally a manufacturer’s name.
6/13/2001 3 6/13/2001 4
1
Input software for keyboards (2) Two modes (Posix) and buffering
Keyboard controller delivers a number Raw ¡ Driver converts it to character ¡ Character-oriented: the driver delivers each ¡ CR/NL must be converted to the internal character, as typed
representation of the local OS. Cooked (called canonical in POSIX)
¡ Line-oriented: the driver handles intra-line Exceptions, adaptations needed for different editing, and delivers the corrected line.
languages Buffering in device driver used for line-editing ¡ many OS provide for loadable keymaps or code and type ahead. pages
6/13/2001 5 6/13/2001 6
The UNIX I/O system in BSD Posix special characters and Unix default
6/13/2001 7 6/13/2001 8
2 Terminal output software Posix special chars Screen editors can insert and delete chars and
ERASE and KILL: for editing input lines at arbitrary positions ¡ LNEXT: an escape character (“Literal”) Terminals must support commands for these
STOP: to freeze output to screen (sets a flag) operations ¡ START: to resume it For control operations, terminal drivers accept
escape sequences INTR (often mapped to CTRL-C) and QUIT: to kill a runaway program; discard all accumulated Different terminals use their own E-sequences input chars BSD Unix defined generic actions, e.g., moving
EOF: Deliver the current contents of buffer. the cursor to (x,y). Mapping of generic actions to actual E-sequences is stored in termcap database for each terminal type.
ANSI later standardized E-sequences
6/13/2001 9 6/13/2001 10
The ANSI escape sequences GUI (Graphical User Interface)
WIMP
¡ Window (rectangular screen area)
¡ Icon (clickable symbol)
¡ Menu (list of actions)
¡ Pointing device (mouse, trackball, etc.)
GUI software implementation options
¡ User level: Unix
¡ Kernel level: MS Windows
Will look at hardware, I/O software for personal computer GUIs ESC is ASCII character (0x1B) n,m, and s are optional numeric parameters
6/13/2001 11 6/13/2001 12
3 Display hardware (1) Mouses (or mice) and trackballs
Two or three buttons: depression/release is detected
Movement: two daisy wheels (for X and Y directions) turn as the ball underneath the mouse moves in 2-dimensions, which create light pulses to receptors.
Up to 40 times/sec, (∆X, ∆Y, button_status) is
¢§¦ ¦ ¨§¦£©¥ §¤ sent to the computer, using 3 bytes. ¡£¢¥¤
Memory-mapped displays (character or bitmap mode)
Driver writes directly into display's video RAM
6/13/2001 13 6/13/2001 14
Video RAM in character mode Some numbers
1024x768 color display with 24 bits/pixel requires 2.25MB of RAM to hold a frame. To refresh screen 75 times/sec, the video RAM bandwidth must be 169MB/sec.
To reduce required speed, choose, say, 256 colors out of 224 and put them in a color palette. Only 8 bits (not 24) are needed to select one color out of this palette, cutting the required bandwidth to 1/3 (used by GIF image compression).
Or can use 16 bits (5,5,6) to encode the RGB
components. s are attribute bytes (color, reverse video, blinking, etc.)
The video controller converts each char to a box of, e.g., 9x14 pixels.
6/13/2001 15 6/13/2001 16
4