|
|
1.1 root 1:
2:
3: com Device Driver com
4:
5:
6:
7:
8: Device drivers for asynchronous serial lines
9:
10:
11: The COHERENT system has drivers for four asynchronous serial
12: lines, ccoomm11 through ccoomm44.
13:
14: A serial line can be opened into any of four different
15: ``flavors'', as follows:
16:
17:
18: ccoomm?ll Interrupt driven, local mode (no modem control)
19: ccoomm?rr Interrupt driven, remote mode (modem control)
20: ccoomm?ppll Polled, local mode (no modem control)
21: ccoomm?pprr Polled, remote mode (modem control)
22:
23:
24: ``Local mode'' means that the line will have a terminal plugged
25: into it, to directly access the computer. ``Modem control''
26: means that the line will have a modem plugged into it. Modem
27: control is enabled on a serial line by resetting the modem
28: control bit (bit 7) in the minor number for the device. This
29: allows the system to generate a hangup signal when the modem
30: indicates loss of carrier by dropping DCD (Data Carrier Detect).
31: A modem line should always have its DSR, DCD and CTS pins
32: connected. If left hanging, spurious transitions can cause
33: severe system thrashing. To disable modem control on a given
34: serial line, use the minor device which has the modem control bit
35: set (bit 7). An ooppeenn to a modem-control line will block until a
36: carrier is detected (DCD goes true).
37:
38: ``Interrupt mode'' means that the port can generate an interrupt
39: to attract the attention of the COHERENT system; ``polled mode''
40: means that the port cannot generate an interrupt, but must be
41: checked (or ``polled'') constantly by the COHERENT system to see
42: if activity has occurred on it.
43:
44: The COHERENT system uses two device drivers to manage serial
45: lines: one driver manages COM1 and COM3, and the other manages
46: COM2 and COM4. Due to limitations in the design of the ports,
47: you can enable interrupts on either COM1 or COM3 (or on COM2 or
48: COM4), but not both. If you wish to use both ports
49: simultaneously, one must be run in polled mode. For example, if
50: you wish to open all four serial lines, you can open two of the
51: lines in interrupt mode: you can open either COM1 or COM3 in
52: interrupt mode, and you can open either COM2 or COM4 in interrupt
53: mode. The other two lines must be opened in polled mode.
54:
55: Opening a device in polled mode consumes many CPU cycles, based
56: upon the speed of the highest baud rate requested. For example,
57: on a 20 MHz 80386-based machine, polling at 9600-baud was found
58: to consume about 15% of the CPU time. As only one device can use
59: the interrupt line at any given time, the best approach is to
60: make the high-speed line of the pair interrupt driven and open
61: the low-speed or less-frequently used line in polled mode.
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
67:
68:
69: com Device Driver com
70:
71:
72:
73: However, if you enable a polled line for logins, the port is open
74: and will be polled as long as the port remains open (enabled).
75: Thus, even if a port is not in use, the fact that it has a ggeettttyy
76: on it consumes CPU cycles. As a rule of thumb, try and open a
77: port in interrupt mode. If you cannot, use the polled version.
78: Also note that use of any of the four serial ports in polled mode
79: prevents other polled serial device drivers, such as the hhss
80: generic multi-port polled serial driver, from being used at the
81: same time.
82:
83: If you intend to use a modem on your serial port, you must insure
84: that the DCD signal from the modem actually _f_o_l_l_o_w_s the state of
85: carrier detect. Some modems allow the user to ``strap'' or set
86: the DCD signal so that it is always asserted (true). This
87: incorrect setup will cause COHERENT to think that the modem is
88: ``connected'' to a remote modem, even when there is no such
89: connection.
90:
91: In addition, if you wish to allow remote logins to your COHERENT
92: system via your modem, you must insure that the modem does nnoott
93: echo any commands or status information. Failure to do so will
94: result in severe system thrashing due to the ggeettttyy or llooggiinn
95: processes endlessly ``talking'' to your modem.
96:
97: ***** Changing Default Port Speeds *****
98:
99: Serial lines ccoomm11 through ccoomm44 default to 9600 baud when opened.
100: This default speed can be permanently changed on a "per port"
101: basis by changing the value of driver variables CC11BBAAUUDD_, CC22BBAAUUDD_,
102: CC33BBAAUUDD_ or CC44BBAAUUDD_. The list of acceptible values can be found in
103: header file <ssggttttyy.hh> and range from 1, corresponding to 50 baud,
104: up to 17, which corresponds to 19,200 baud. For a table of legal
105: baud rates, see the Lexicon entry for ssggttttyy.hh.
106:
107: To change the default value for a port, you must use the
108: /ccoonnff/ppaattcchh command. For example, to change the default speed
109: for port ccoomm22 to 2400 baud, enter the following command while
110: running as the superuser:
111:
112:
113: /conf/patch /drv/al1 C2BAUD_=12
114:
115:
116: The change will not take effect until the next time that you boot
117: your system.
118:
119: ***** See Also *****
120:
121: ccoomm11, ccoomm22, ccoomm33, ccoomm44, ddeevviiccee ddrriivveerrss
122:
123: ***** Diagnostics *****
124:
125: An attempt to open a non-existent device will generate error
126: messages. This can occur if hardware is absent or not turned on.
127:
128:
129:
130: COHERENT Lexicon Page 2
131:
132:
133:
134:
135: com Device Driver com
136:
137:
138:
139: ***** Notes *****
140:
141: The ccoomm* series of devices are not compatible with the iiooccttll()
142: parameters defined in header file <tteerrmmiioo.hh>. Be sure to include
143: header file <ssggttttyy.hh> if you wish to perform terminal specific
144: iiooccttll() calls.
145:
146: In the current version of these drivers, the following sequence
147: of steps results in a panic:
148:
149:
150: enable com4pl
151: enable com3pl
152: disable com4pl
153: kill kill <al1 driver process id>
154:
155:
156: The key is that the driver containing the polling routine cannot
157: be unloaded if the other driver is still polling.
158:
159: Note, too, that if any ccoomm device driver is used in polling mode,
160: the hhss driver cannot be used, and vice versa.
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196: COHERENT Lexicon Page 3
197:
198:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.