Terminals
Each line in /etc/inittab that refers to a terminal
device points to an entry in the /etc/gettydefs file. The entry for the COM1
port (/dev/ttyS1) might look like this:
S1:234:respawn:/etc/getty ttyS1 M19200
From our discussion of the /etc/inittab file in the section on starting and
stopping the system, you see that this entry starts the /etc/getty command. Two arguments are passed to getty: the terminal on which it
should run (ttyS1) and the gettydefs entry that should be used (m). The
/etc/gettydefs file defines such characteristics as the default speed,
parity, and the number of data bits. For example, the m
entry, to which the previous inittab entry points, might look like this:
M19200 # B19200 CS8 CLOCAL # B19200 SANE -ISTRIP CLOCAL #@S login: # M19200
The fields are
label # initial_flags # final_flags #login_prompt # next_label
The label entry is what is being pointed to in the inittab file. The initial_
flags are the default serial line characteristics that are set, unless a
terminal type is passed to getty. Normally, the only
characteristic that needs to be passed is the speed. However, we also set HUPCL
(hang up on last close).
The final_flags are set just before getty executes login.
Here again, set the speed and HUPCL. However, we also set the
terminal to SANE, which is actually several
characteristics. (Look at the gettydefs man-page for
more details.) We also set TAB3, which turns tabs into space; ECHOE, which
echoes the erase character as a backspace-space-backspace combination; and
IXANY, which enables any character to restart output if it is stopped by the
XOFF character.
|