Serial Devices1-1 Serial Devices Serial Standards m RS-232 RS-232 cables consist of up to 25 wires, each with a specific function and each intended to carry a different signal. –Two for data transmission –The rest are for various kinds of control signals All 25 pins are rarely used –Only 9 pins commonly –DB25-to-9 pin adapters are readily available
Serial Devices1-2 Serial Devices m RS-232 standard defines two types of equipment Data Terminal Equipment (DTE) –Computers are DTE Data Communication Equipment (DCT) –Modems, printers are DCE DTE uses pin2 to transmit data and pin 3 to receive data; DCE does the reverse –To connect a computer to a modem, you want to make the connection straight through. –To connect a computer to a computer (DTE DTE), you need a able with receive/transmit lines crossed. »Called a null-modem or modem-eliminator cable
Serial Devices1-3 Serial Devices connectors m DB-25 m Mini DIN-8 Found on Macs, laptops and workstations. m DB-9 variant Commonly found on PCs m RJ-45 variant An eight-wire modular telephone connector –Used as intermediate connectors when routing serial lines through patch panels. –Terminal servers
Serial Devices1-4 Configuration of hardwired terminals Terminal configuration involves main tasks m Making sure a process is attached to a terminal to accept logins m Making sure that information about the terminal is available once a user has logged in. The login process m Usually, Init daemon spawn a process (getty) on each terminal port that is turned on in /etc/inittab m Getty set the port’s initial characteristics and print a login prompt
Serial Devices1-5 Configuration of hardwired terminals m The sequence of events in a complete login A user enters a login name at getty’s prompt Getty executes the login program with the specified name Login request a password and validate it again /etc/passwd Login print the message of the day from /etc/motd Login sets up the TERM env and runs a shell The shell executes the appropriate startup files The shell prints a prompt and waits for input. m When user logout, control returns to init, which wakes up and spawn a new getty on the terminal port.
Serial Devices1-6 Configuration of hardwired terminals Possible related files m BSD: The /etc/ttys and /etc/ttytab files Format –Device program termtype {on|off} [secure] m /etc/ttytype m /etc/getttytab m Solaris/HP-UX: /etc/inittab m /etc/gettydefs Starting the terminal line m Force the program init to reread the terminal line initialization information Init becomes aware the device that has been added Init takes the appropriate action (getty) Example –#telinit q
Serial Devices1-7 Terminal-Related Special Files Special files for serial lines m Vary between systems m often the form /dev/ttyn where n is a number corresponding the line number Pseudo terminal devices - Indirect login session via a network or windowing system m The master or control pseudo terminal, /dev/pty[p-s]n m The slave pseudo terminal ( virtual terminal) /dev/ttp[p- s]n The special file /dev/console always refers to the system console device.
Serial Devices1-8 Terminals Commands tty m Display what special file is being used for any login session. m Example: ~]$ tty /dev/pts/3 Specifying Terminal Characteristics m Unix programs are generally written to be terminal independent m They call standard screen manipulation library which is responsible for interfacing to actual terminals. m The library serve to map terminal characteristics and functions to the specific character sequences required to perform them on any specific terminal.
Serial Devices1-9 Terminals m Terminal definitions are stored in database m User set what kind of terminal they are using by setting the TERM environment Terminal definition database m Under BSD scheme, /etc/termcap A text file consisting series entries that describes how different terminals function –Such as How many columns, how many lines, auto wrapping, characters sequence when a special key is pressed m Under System V, /usr/share/lib/terminfo A series of binary files describing terminal capabilities –Each entry is a separate file in the subdirectory of /usr/share/lib/terminfo/{firstletter}/file
Serial Devices1-10 Terminals Terminfo files are compiled from source code –Command to manipulating terminfo entries »Compile terminfo source: tic »List source for a compiled terminfo entry: infocmp »Translate from terminfo to termcap: infocmp –C »Translate from termcap to terminfo source: captoinfo For example: To use a old terminal for AIX system where system does no have terminfo entry for it. –found a BSD termcap –copy it to the system –run captoinfo –compile it using tic
Serial Devices1-11 STTY: set terminal options Specify generic terminal and terminal line characteristics m Syntax: stty option [value] … See next page for commonly used options m Display the current terminal settings $stty –a m Stty controls device driver and allow user to explicitly change the default setting
Serial Devices1-12 OptionsMeaningExample nBaud rate 9600 rows nLines on the screen rows 36 columnsColumns on the screen columns 80 echoEcho typed characters on the screen -echo erase CSet the delete previous character to C erase ^H kill CSet the erase command character to C kill ^U intr CSet the interrupt character to C intr ^C eof CSet the end of file character to c eof ^D susp cSet the suspend job character to c susp ^Z saneReset many options to reasonable settings sane Commonly used stty options
Serial Devices1-13 Modems Modem m converts digital signal from computer to analog signal for transmission on a standard phone line. m Internal and external modem External:RS-232 interface on the digital side and RJ- 11 jack on the analog side Internal:pluginto an ISA, PCI or PCMCIA slot and have a RJ-11 jack m Upto 56Kb/s throughput
Serial Devices1-14 Modems Dial-out configuration m Command tip and cu Use /etc/phones and /etc/remote Bi-directional modems m Need special treatment Since getty normally take full control of serial ports and other processes that want to use the modem are shut out Under HP-UX/Redhat, use a special getty called uugetty on biferectinal ports. –Uugetty shares lock file with cu, tip and uucico to avoid conflicts.
Serial Devices1-15 Other common I/O ports Parallel ports m Transfer 8bits of data at once m Parallel interfaces are most commonly found on Printer Zip, tape drives and viedo cameras in Windows world m Two modes EPP (Enhanced Parallel port) ECP (Extended Capability Port) –Support DMA m Connectors and Cables Computer usually provide a female DB-25 connector Peripherals tend to have a female 36-pin Centronics connector Most parallel cables are male DB-25 to male Centronics –Limited to 10 meters
Serial Devices1-16 Other common I/O ports USB: The Universal Serial Bus Features: m Makes adding peripheral devices so easy. Standardized connectors Hot swapping – devices can be connected and disconnected without powering down Up to 127 devices can be connected Legacy serial and parallel devices can be connected with adaptors.
Serial Devices1-17 Maximum Transfer Rates for various Connections 1. serial port: 115kbits/s (.115Mbits/s) 2. standard parallel port: 115kBYTES/s (.115MBYTES/s) 3. Original USB: 12Mbits/s (1.5MBYTES/s) 4. ECP/EPP parallel port: 3MBYTES/s 5. IDE: MBYTES/s 6. SCSI-1: 5MBYTES/s 7. SCSI-2 (Fast SCSI, Fast Narrow SCSI): 10MBYTES/s 8. Fast Wide SCSI (Wide SCSI): 20MBYTES/s 9. Ultra SCSI (SCSI-3, Fast-20, Ultra Narrow): 20MBYTES/s 10. UltraIDE: 33MBYTES/s 11. Wide Ultra SCSI (Fast Wide 20): 40MBYTES/s 12. Ultra2 SCSI: 40MBYTES/s 13. IEEE-1394: Mbits/s ( MBYTES/s) 14. Hi-Speed USB: 480Mbits/s 15. Wide Ultra2 SCSI: 80MBYTES/s 16. Ultra3 SCSI: 80MBYTES/s 17. Wide Ultra3 SCSI: 160MBYTES/s 18. FC-AL Fiber Channel: MBYTES/s
Serial Devices1-18 Exercise Connect to the switch console using a straight through cable Connect to the other Sun Blade 100’s serial console using a non modem cable