]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/doc/psd/05.sysman/2.4.t
Merge compiler-rt trunk r300890, and update build glue.
[FreeBSD/FreeBSD.git] / share / doc / psd / 05.sysman / 2.4.t
1 .\" Copyright (c) 1983, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)2.4.t       8.1 (Berkeley) 6/8/93
29 .\"
30 .sh "Terminals and Devices
31 .NH 3
32 Terminals
33 .PP
34 Terminals support \fIread\fP and \fIwrite\fP I/O operations,
35 as well as a collection of terminal specific \fIioctl\fP operations,
36 to control input character interpretation and editing,
37 and output format and delays.
38 .NH 4
39 Terminal input
40 .PP
41 Terminals are handled according to the underlying communication
42 characteristics such as baud rate and required delays,
43 and a set of software parameters.
44 .NH 5
45 Input modes
46 .PP
47 A terminal is in one of three possible modes: \fIraw\fP, \fIcbreak\fP,
48 or \fIcooked\fP.
49 In raw mode all input is passed through to the
50 reading process immediately and without interpretation.
51 In cbreak mode, the handler interprets input only by looking
52 for characters that cause interrupts or output flow control;
53 all other characters are made available as in raw mode.
54 In cooked mode, input
55 is processed to provide standard line-oriented local editing functions,
56 and input is presented on a line-by-line basis.
57 .NH 5
58 Interrupt characters
59 .PP
60 Interrupt characters are interpreted by the terminal handler only in
61 cbreak and cooked modes, and
62 cause a software interrupt to be sent to all processes in the process
63 group associated with the terminal.  Interrupt characters exist
64 to send SIGINT
65 and SIGQUIT signals,
66 and to stop a process group
67 with the SIGTSTP signal either immediately, or when
68 all input up to the stop character has been read.
69 .NH 5
70 Line editing
71 .PP
72 When the terminal is in cooked mode, editing of an input line
73 is performed.  Editing facilities allow deletion of the previous
74 character or word, or deletion of the current input line. 
75 In addition, a special character may be used to reprint the current
76 input line after some number of editing operations have been applied.
77 .PP
78 Certain other characters are interpreted specially when a process is
79 in cooked mode.  The \fIend of line\fP character determines
80 the end of an input record.  The \fIend of file\fP character simulates
81 an end of file occurrence on terminal input.  Flow control is provided
82 by \fIstop output\fP and \fIstart output\fP control characters.  Output
83 may be flushed with the \fIflush output\fP character; and a \fIliteral
84 character\fP may be used to force literal input of the immediately
85 following character in the input line.
86 .PP
87 Input characters may be echoed to the terminal as they are received.
88 Non-graphic ASCII input characters may be echoed as a two-character
89 printable representation, ``^character.''
90 .NH 4
91 Terminal output
92 .PP
93 On output, the terminal handler provides some simple formatting services.
94 These include converting the carriage return character to the
95 two character return-linefeed sequence,
96 inserting delays after certain standard control characters,
97 expanding tabs, and providing translations
98 for upper-case only terminals.
99 .NH 4
100 Terminal control operations
101 .PP
102 When a terminal is first opened it is initialized to a standard
103 state and configured with a set of standard control, editing,
104 and interrupt characters.  A process
105 may alter this configuration with certain
106 control operations, specifying parameters in a standard structure:\(dg
107 .FS
108 \(dg The control interface described here is an internal interface only
109 in 4.3BSD.  Future releases will probably use a modified interface
110 based on currently-proposed standards.
111 .FE
112 .DS
113 ._f
114 struct ttymode {
115         short   tt_ispeed;      /* input speed */
116         int     tt_iflags;      /* input flags */
117         short   tt_ospeed;      /* output speed */
118         int     tt_oflags;      /* output flags */
119 };
120 .DE
121 and ``special characters'' are specified with the 
122 \fIttychars\fP structure,
123 .DS
124 ._f
125 struct ttychars {
126         char    tc_erasec;      /* erase char */
127         char    tc_killc;       /* erase line */
128         char    tc_intrc;       /* interrupt */
129         char    tc_quitc;       /* quit */
130         char    tc_startc;      /* start output */
131         char    tc_stopc;       /* stop output */
132         char    tc_eofc;        /* end-of-file */
133         char    tc_brkc;        /* input delimiter (like nl) */
134         char    tc_suspc;       /* stop process signal */
135         char    tc_dsuspc;      /* delayed stop process signal */
136         char    tc_rprntc;      /* reprint line */
137         char    tc_flushc;      /* flush output (toggles) */
138         char    tc_werasc;      /* word erase */
139         char    tc_lnextc;      /* literal next character */
140 };
141 .DE
142 .NH 4
143 Terminal hardware support
144 .PP
145 The terminal handler allows a user to access basic
146 hardware related functions; e.g. line speed,
147 modem control, parity, and stop bits.  A special signal,
148 SIGHUP, is automatically
149 sent to processes in a terminal's process
150 group when a carrier transition is detected.  This is
151 normally associated with a user hanging up on a modem
152 controlled terminal line.
153 .NH 3
154 Structured devices
155 .PP
156 Structures devices are typified by disks and magnetic
157 tapes, but may represent any random-access device.
158 The system performs read-modify-write type buffering actions on block
159 devices to allow them to be read and written in a totally random
160 access fashion like ordinary files.
161 File systems are normally created in block devices.
162 .NH 3
163 Unstructured devices
164 .PP
165 Unstructured devices are those devices which
166 do not support block structure.  Familiar unstructured devices
167 are raw communications lines (with
168 no terminal handler), raster plotters, magnetic tape and disks unfettered
169 by buffering and permitting large block input/output and positioning
170 and formatting commands.