PAGEFLOP
FORWARD
SELECTOR
SELAGAIN
WRONGSEL
YOUR SELECTION IS NOT IN THE 0 - #SELIMIT RANGE Please try again
AANVANG
Copyright CourseWare Technologies Inc., 1985-88
CTI UNIX Tutorial - 863
Lesson - 1
ADDING DEVICES
MENU
Adding Devices|Topics to Learn|1-0|15,55
# Topic
--- -------
1 - Introduction
2 - Serial vs. Parallel Devices
3 - How to Add a Terminal
4 - Connecting Hardware
5 - Modifying Terminal Initialization Files
6 - Setting the Terminal Type
7 - Activating the Terminal
8 - How to Add a Printer
8 - How to Add a Serial Printer
9 - Managing Printers
10 - Adding Parallel Devices
11 - Lesson Review
0 - Return to the Main Menu
MANUAL
Adding Devices|Introduction|1-1.1|14,59
Most UNIX systems are multi-user, i.e., they can
handle more than one user at a time. Naturally then,
more than one terminal must be active on the system.
Because the process of activating a terminal is
slightly more complicated than merely connecting the
terminal to the serial port on the computer and turning
on the power, this lesson will describe this process in
detail.
Adding other terminal-compatible devices like printers,
modems, or plotters is similar to adding a terminal.
P2
Adding Devices|Serial vs. Parallel Devices|1-2.1|8,50
A serial device is terminal-compatible, that
is, it runs off of a normal terminal line with an
RS232, 25-pin connector. The data is sent on this
line 1 bit at a time in a serial fashion. For
example, a character (which is 1 byte or 8 bits of
information) is transferred on a serial line as 8
separate units, like it is on a terminal.
P3
Adding Devices|Serial vs. Parallel Devices|1-2.2|5,51
Terminal-compatible devices include terminals,
modems, plotters and some printers. The connection
port for these devices is called a serial port.
Serial ports are relatively slow, that is, they
transmit 300-19200 bytes per second.
P4
Adding Devices|Serial vs. Parallel Devices|1-2.3|8,55
A parallel line or parallel port sends several
bits of data at a time, in parallel. Therefore,
parallel ports are significantly faster than serial
ports. They can transmit up to 50 kilobytes of
information per second. There are different parallel
standards with different connectors. Devices that
must be connected to parallel ports are called
parallel devices.
P5
Adding Devices|Serial vs. Parallel Devices|1-2.4|6,55
Disk drives, tape drives, and high-resolution
graphic devices are usually parallel devices. They
transfer data at a rate much higher than is possible
with serial devices. These devices require a proper
interface program or device driver to properly
communicate with the system.
P6
Adding Devices|Serial vs. Parallel Devices|1-2.5|12,58
The type of device you wish to connect may determine
whether you need a serial or parallel port to connect
to or vice-versa. For example, if you have only 2 serial
ports on your computer, both of which are being used
for terminals, and you want to connect a printer, then
you'll have to find a printer that runs off of a parallel
port.
Serial and parallel ports usually have either 25-
pin or 9-pin connectors. They may or may not be labeled
on the back of your computer.
P7
Adding Devices|How to Add a Terminal|1-3.1|14,58
To add a new terminal to your UNIX system:
1. Connect the terminal to a free serial port.
2. Modify the terminal initialization file /etc/ttys.
This file tells the init program to create a login
process for the serial port with the new terminal.
3. Modify the /etc/ttytype file to note the default
terminal type to be used by the screen addressing
programs when the terminal type is not explicitly
set by the user.
4. Enable (activate) the terminal.
Adding Devices|How to Add a Terminal|1-3.1|17,58
To add a new terminal to your UNIX system:
1. Connect the terminal to a free serial port.
2. Modify the terminal initialization file /etc/ttys.
This file tells the init program to create a login
process for the serial port with the new terminal.
3. Modify the /etc/ttytype file to note the default
terminal type to be used by the screen addressing
programs when the terminal type is not explicitly
set by the user.
4. Modify the /etc/gettydefs file to note the terminal
configuration.
5. Enable (activate) the terminal.
Adding Devices|How to Add a Terminal|1-3.1|17,58
To add a new terminal to your UNIX system:
1. Connect the terminal to a free serial port.
2. Modify the terminal initialization file /etc/inittab.
This file tells the init program to create a login
process for the serial port with the new terminal.
3. Modify the file /etc/ttydefs to note the default
terminal type to be used by the screen addressing
programs when the terminal type is not explicitly
set by the user.
4. Modify the /etc/gettydefs file to note the terminal
configuration.
5. Enable (activate) the terminal.
P8
Adding Devices|Connecting Hardware|1-4.1|14,54
Most printers have a parallel connection.
However, most new printers provide both a parallel
and a serial connection. The ports may or may not
be labeled on the back of your computer.
The cable that comes with your printer will
usually have an RS232, 25-pin connector on the end
that joins the port on your system. (Some printers
may have a 9-pin connector.) Usually the cable will
only fit into one port on your system. A 9-pin
connector will only fit into a serial port. See the
documentation that comes with your printer if you
have trouble connecting it.
P9
Adding Devices|Modifying Terminal Initialization Files|1-5.1|12,56
Once the physical connection to the new terminal
is established, the file /etc/ttys needs to be modified
to reflect the addition of the new terminal. The
/etc/ttys file format is:
mode baud rate logical device name
is established, the file /etc/inittab needs to be modified
to reflect the addition of the new terminal. The
/etc/inittab file format is:
process
For example, the entry 12ttya says that the terminal
/dev/ttya has login enabled at 2 baud which corresponds
to the speed of 9600 as defined in /etc/gettytab.
On the following screen you can see further details.
For example, the entry 1mtty01 says that the terminal
/dev/tty01 has login enabled at m baud which corresponds
to the speed of 9600 as defined in /etc/gettydefs.
On the following screen you can see further details.
/etc/getty -t60 tty11 9600
says that the terminal /dev/tty11 has login enabled at
9600 baud.
On the following screen you can see further details.
P10
Adding Devices|Setting the Terminal Type|1-6.1|9,52
Your terminal normally has several capabilities
ranging from cursor addressing to various graphics
capabilities.
Even the least expensive terminals on the market
today have reasonable intelligence. To use your
terminal's capabilities to the greatest extent you
need to set the terminal type correctly.
P11
Adding Devices|Setting the Terminal Type|1-6.2|5,52
Whenever your terminal type is set, the system
looks into the /etc/termcap file, which is the
database of control codes for various capabilities
for all the terminals supported by your UNIX system.
looks into the /usr/lib/terminfo directory, which
contains the database with control codes for various
capabilities for all the terminals supported by your
UNIX system.
P12
Adding Devices|Setting the Terminal Type|1-6.3|8,52
The terminal type should be set just after or
as a part of the login process.
The command syntax for setting the terminal
type under the Bourne Shell is:
TERM=termtype; export TERM
P13
Adding Devices|Setting the Terminal Type|1-6.4|8,50
The command syntax for setting the terminal
type under the C Shell is:
setenv TERM termtype
Note: termtype must be one of the terminal
names defined in the /etc/termcap file.
names defined in the /usr/lib/terminfo directory.
P14
Adding Devices|Setting the Terminal Type|1-6.5|3,50
If the terminal type is not explicitly set,
the system checks the /etc/ttytype file for the
the system checks the /etc/inittab file for the
default terminal type first.
P15
Adding Devices|Setting the Terminal Type|1-6.6|9,60
terminal-type tty-name
For example,
vt100 tty03
indicates that the terminal attached to tty03 is treated
by the system as a vt100.
P16
Adding Devices|Setting the Terminal Type|1-6.7|16,50
The command that lets you display terminal
configuration settings for all terminals is:
getty -c /etc/gettydefs.
The command that lets you verify and set the
operating characteristics of a terminal is:
stty (for set tty)
For example, if a user wanted to use a 2400
baud modem to call a bulletin board service, you
would need to change the baud rate for his or her
or her terminal to 2400. The command would be:
stty 2400 < /dev/tty12
Adding Devices|Setting the Terminal Type|1-6.7|12,50
The command that lets you verify and set the
operating characteristics of a terminal is:
stty (for set tty)
For example, if a user wanted to use a 2400
baud modem to call a bulletin board service, you
would need to change the baud rate for his or her
terminal to 2400. The command would be:
stty 2400 > /dev/ttyp3
P17
Adding Devices|Setting the Terminal Type|1-6.8|7,56
Another command that displays your terminal type is
the printenv command. It prints out the values of all
of the variables in your environment. If you don't want
to print them all, the syntax is:
printenv [variable]
P18
Adding Devices|Activating the Terminal|1-7.1|11,59
The program that activates a terminal is /etc/getty.
It is invoked by init. Several terminal capabilities need
to be set, like the backspace character, echoing mode,
kill character, new line handling, etc.
The file that contains this information is
/etc/gettydefs
The following terminal display contains the details.
Adding Devices|Activating the Terminal|1-7.1|9,59
The program that activates a terminal is /etc/getty.
It is invoked by init. Several terminal capabilities need
to be set, like the backspace character, echoing mode,
kill character, new line handling, etc.
The file that contains this information is
/etc/gettytab
P19
Adding Devices|Activating the Terminal|1-7.2|10,55
Once the login to the new terminal port is
enabled, the system reads the /etc/ttys, /etc/ttytype
and /etc/termcap files, and based on that information,
sets up the operating characteristics of the serial
line.
If the set software values do not match the
hardware characteristics of your terminal, they
need to be changed.
Adding Devices|Activating the Terminal|1-7.2|9,55
Once the login to the new terminal port is enabled,
the system reads the /etc/ttydefs, /etc/ttytype and
/usr/lib/terminfo/termname files, and based on that
information sets up the operating characteristics of
the serial line.
If the set software values do not match the
hardware characteristics of your terminal, they
need to be changed.
P20
Adding Devices|Activating the Terminal|1-7.3|11,55
One method for activating or deactivating terminals,
to reflect changes in the /etc/ttys file is to issue a
HANGUP signal by using the kill command. For example,
kill -2 1
The kill command with the hangup signal (-2) and
the process id 1 will cause the initial process 1 to
reread the file /etc/ttys and create the login responders
as needed!
Adding Devices|Activating the Terminal|1-7.3|10,55
One method for activating or deactivating terminals,
to reflect changes in the /etc/ttys file is to issue a
HANGUP signal by using the kill command. For example,
kill -HUP 1 or kill -1 1
The kill command with the hangup signal (-HUP or -1) and
the process id 1 will cause the initial process 1 to
reread the file /etc/ttys and create the login responders
as needed!
Adding Devices|Activating the Terminal|1-7.3|11,55
Another method for activating or deactivating
terminals, to reflect the changes in the /etc/inittab
file is to issue a HANGUP signal by using the
kill command. For example,
kill -1 1
The kill command with the hangup signal (-1) and
the process id 1 will cause the initial process 1 to
reread the file /etc/inittab, create file /etc/ttys,
and create the login responders as needed.
P21
Adding Devices|Activating the Terminal|1-7.4|9,55
Another way to activate a physically connected
terminal is to use the enable command. The syntax is:
enable special file
The command syntax for deactivating a terminal is:
disable special file