bc43132795bf1d218a362451068a2abb.ppt
- Количество слайдов: 18
Serial Devices q 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 – DB 25 -to-9 pin adapters are readily available Serial Devices 1
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 pin 2 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 Devices 2
Serial Devices q 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 Devices 3
Configuration of hardwired terminals q 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. q 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 Devices 4
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 Devices 5
Configuration of hardwired terminals q Possible related files m BSD: The /etc/ttys and /etc/ttytab files • Format – Device program termtype {on|off} [secure] m m /etc/ttytype /etc/getttytab Solaris/HP-UX: /etc/inittab /etc/gettydefs q 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 Devices 6
Terminal-Related Special Files q Special files for serial lines m Vary between systems m often the form /dev/ttyn where n is a number corresponding the line number q Pseudo terminal devices - Indirect login session via a network or windowing system m m The master or control pseudo terminal, /dev/pty[p-s]n The slave pseudo terminal ( virtual terminal) /dev/ttp[ps]n q The special file /dev/console always refers to the system console device. Serial Devices 7
Terminals q Commands tty m Display what special file is being used for any login session. m Example: [ruihong@dafinn ~]$ tty /dev/pts/3 q 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 Devices 8
Terminals m m Terminal definitions are stored in database User set what kind of terminal they are using by setting the TERM environment q 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 Devices 9
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 Devices 10
STTY: set terminal options q 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 Devices 11
Commonly used stty options Options Meaning Example n Baud rate 9600 rows n Lines on the screen rows 36 columns Columns on the screen columns 80 echo Echo typed characters on the screen -echo erase C Set the delete previous character to C erase ^H kill C Set the erase command character to C kill ^U intr C Set the interrupt character to C intr ^C eof C Set the end of file character to c eof ^D susp c Set the suspend job character to c susp ^Z sane Reset many options to reasonable settings sane Serial Devices 12
Modems q 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 56 Kb/s throughput Serial Devices 13
Modems q Dial-out configuration m Command tip and cu • Use /etc/phones and /etc/remote q 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 Devices 14
Other common I/O ports q Parallel ports m Transfer 8 bits 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 Devices 15
Other common I/O ports q USB: The Universal Serial Bus q 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 Devices 16
Maximum Transfer Rates for various Connections 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. serial port: 115 kbits/s (. 115 Mbits/s) standard parallel port: 115 k. BYTES/s (. 115 MBYTES/s) Original USB: 12 Mbits/s (1. 5 MBYTES/s) ECP/EPP parallel port: 3 MBYTES/s IDE: 3. 3 -16. 7 MBYTES/s SCSI-1: 5 MBYTES/s SCSI-2 (Fast SCSI, Fast Narrow SCSI): 10 MBYTES/s Fast Wide SCSI (Wide SCSI): 20 MBYTES/s Ultra SCSI (SCSI-3, Fast-20, Ultra Narrow): 20 MBYTES/s Ultra. IDE: 33 MBYTES/s Wide Ultra SCSI (Fast Wide 20): 40 MBYTES/s Ultra 2 SCSI: 40 MBYTES/s IEEE-1394: 100 -800 Mbits/s (12. 5 --100 MBYTES/s) Hi-Speed USB: 480 Mbits/s Wide Ultra 2 SCSI: 80 MBYTES/s Ultra 3 SCSI: 80 MBYTES/s Wide Ultra 3 SCSI: 160 MBYTES/s FC-AL Fiber Channel: 100 -400 MBYTES/s Serial Devices 17
Exercise q Connect to the switch console using a straight through cable q Connect to the other Sun Blade 100’s serial console using a non modem cable Serial Devices 18