xref: /freebsd/usr.sbin/dconschat/dconschat.8 (revision 7661de35d15f582ab33e3bd6b8d909601557e436)
1.\" Copyright (c) 2003 Hidetoshi Shimokawa
2.\" 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.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
17.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
22.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23.\" POSSIBILITY OF SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.\"
28.Dd February 11, 2003
29.Dt DCONSCHAT 8
30.Os
31.Sh NAME
32.Nm dconschat
33.Nd user interface to
34.Xr dcons 4
35.Sh SYNOPSIS
36.Nm
37.Op Fl brvwRT1
38.Op Fl e Ar escape-char
39.Op Fl h Ar hz
40.Op Fl C Ar console_port
41.Op Fl G Ar gdb_port
42.Op Fl M Ar core
43.Op Fl N Ar system
44.Nm
45.Op Fl brvwR1
46.Op Fl h Ar hz
47.Op Fl C Ar console_port
48.Op Fl G Ar gdb_port
49.Op Fl a Ar address
50.Op Fl u Ar bus_num
51.Fl t Ar target_eui64
52.Sh DESCRIPTION
53The
54.Nm
55utility is designed to provide a way for users to access
56.Xr dcons 4
57(dumb console device) on a local or remote system.
58The
59.Nm
60utility interacts with
61.Xr dcons 4
62using
63.Xr kvm 3
64or
65.Xr firewire 4 ,
66and interacts with the user over TTY or TCP/IP.
67To access remote
68.Xr dcons 4
69using
70.Xr firewire 4 ,
71you have to specify target EUI64 address using the
72.Fl t
73option. Physical DMA should be enabled on the target machine for access
74via FireWire.
75.Pp
76The
77.Nm
78utility and the
79.Xr dcons 4
80driver communicate using 2 ports, one for the console port and another
81for remote
82.Xr gdb 1
83port.
84Users are supposed to access
85.Nm
86using TTY,
87.Xr telnet 1
88and
89.Xr gdb 1 .
90You can specify listen ports for console and
91.Xr gdb 1
92port using the
93.Fl C
94and
95.Fl G
96options respectively.
97The port number 0 has special meaning that
98current TTY (stdin/stdout) is used instead of TCP/IP.
99A negative port number will disable the port.
100By analogy with
101.Xr pty 4
102device, the
103.Xr dcons 4
104acts as a slave device and
105.Nm
106acts as a master device with
107.Xr telnetd 8 .
108.Pp
109Typed characters are normally transmitted directly to
110.Xr dcons 4 .
111A escape character (the default is
112.Ql ~
113) appearing as the first character of a line is an escape signal; the
114following are recognized:
115.Bl -tag -width ident
116.It Ic ~.
117Drop the connection and exit.
118.It Ic ~^G
119Invoke kgdb on the terminal on which dconschat is running.
120.It Ic ~^R
121Reset the target over FireWire if a reset address is registered in Configuration ROM.
122.It Ic ~^Z
123Suspend the dconschat process.
124.El
125.Pp
126The following options are supported.
127.Bl -tag -width indent
128.It Fl b
129Translate Ctrl-C to ALT_BREAK (CR +
130.Ql ~
131+ Ctrl-B) on
132.Xr gdb 1
133port.
134.It Fl r
135Replay old buffer on connection.
136.It Fl v
137Verbose debug output.
138Multiple
139.Fl v
140options increase verbosity.
141.It Fl w
142Listen on a wildcard address rather than localhost.
143.It Fl R
144Read-only.
145Do not write anything to the
146.Xr dcons 4
147buffer.
148.It Fl T
149Enable ad-hoc workaround for the TELNET protocol to
150remove unnecessary byte sequences.
151It should be set when you access
152.Nm
153using
154.Xr telnet 1 .
155.It Fl 1
156One-shot.
157Read available buffer, then exit.
158This implies the
159.Fl r
160option.
161.It Fl e Ar escape-char
162Specify escape character.
163The default is '~'.
164.It Fl h Ar hz
165Specify polling rate.
166The default value is 100.
167.It Fl C Ar console_port
168Specify the console port.
169The default value is 0 (stdin/stdout).
170.It Fl G Ar gdb_port
171Specify
172.Xr gdb 1
173port.
174The default value is \-1 (disabled).
175.It Fl M Ar core
176Specify core file.
177.It Fl N Ar system
178Specify system file such as
179.Pa /boot/kernel/kernel .
180.It Fl t Ar target_eui64
181Specify the 64-bit extended unique identifier of the target,
182and use FireWire to access remote
183.Xr dcons 4 .
184.It Fl a Ar address
185Specify the physical I/O address of the
186.Xr dcons 4
187buffer.
188See
189.Xr dcons 4
190for details.
191If this option is not specified,
192.Nm
193tries to get the address from the Configuration ROM on the target.
194You are supposed to enable
195.Xr dcons_crom 4
196on the target to omit this option.
197.It Fl u Ar bus_num
198Specify FireWire bus number.
199The default is 0.
200.El
201.Sh FILES
202.Bl -tag -width indent -compact
203.It Pa /dev/fwmem0.0
204.It Pa /dev/mem
205.It Pa /dev/kmem
206.El
207.Sh EXAMPLES
208To use
209.Nm
210with FireWire for remote
211.Xr dcons 4 ,
212you have to specify the EUI64 of the target.
213You can obtain EUI64 by running
214.Xr fwcontrol 8
215without options.
216The first EUI64 is of the host running
217.Xr fwcontrol 8
218and others on the bus follow.
219.Bd -literal -offset indent
220# fwcontrol
2212 devices (info_len=2)
222node           EUI64          status
223   1  77-66-55-44-33-22-11-00      0
224   0  00-11-22-33-44-55-66-77      1
225.Ed
226.Pp
227The EUI64 does not change unless you change the hardware
228as the ethernet address.
229.Pp
230Now we can run
231.Nm .
232.Bd -literal -offset indent
233# dconschat -br -G 12345 -t 00-11-22-33-44-55-66-77
234.Ed
235.Pp
236You will get console output of the target and login prompt if a
237.Xr getty 8
238is running on
239.Xr dcons 4 .
240You can break to DDB with ALT_BREAK (CR +
241.Ql ~
242+ Ctrl-B)
243if
244.Dv DDB
245and
246.Dv ALT_BREAK_TO_DEBUGGER
247are enabled in the target kernel.
248To quit the session, type CR +
249.Ql ~
250+
251.Ql \&.
252in the console port.
253.Pp
254Using
255.Xr gdb 1
256port is almost the same as remote
257.Xr gdb 1
258over serial line except
259using TCP/IP instead of
260.Pa /dev/cu* .
261See
262.Sx "On-line Kernel Debugging Using Remote GDB"
263section of
264.%T "The FreeBSD Developers Handbook"
265and
266.Xr gdb 4
267for details.
268.Bd -literal -offset indent
269% gdb -k kernel.debug
270(kgdb) target remote :12345
271.Ed
272.Pp
273Once
274.Xr gdb 1
275is attached and you specified the
276.Fl b
277option to
278.Nm ,
279typing Ctrl-C in
280.Xr gdb 1
281causes a break to debugger.
282.Pp
283The following command gets the console log from the crash dump:
284.Bd -literal -offset indent
285# dconschat -1 -M vmcore.0 -N kernel.0
286.Ed
287.Pp
288If you want access to the console using
289.Xr telnet 1 ,
290try the following:
291.Bd -literal -offset indent
292# dconschat -rTC 5555 &
293# telnet localhost 5555
294.Ed
295.Pp
296You may want to keep logging console output of several machines.
297.Nm conserver-com
298in the Ports collection may help you.
299Insert the following lines in
300.Pa conserver.cf :
301.Bd -literal -offset indent
302console local {
303	master localhost;
304	type exec;
305	exec /usr/sbin/dconschat -rh 25;
306}
307console remote {
308	master localhost;
309	type exec;
310	exec /usr/sbin/dconschat -rh 25 -t 00-11-22-33-44-55-66-77;
311}
312.Ed
313.Sh SEE ALSO
314.Xr gdb 1 ,
315.Xr telnet 1 ,
316.Xr kvm 3 ,
317.Xr dcons 4 ,
318.Xr dcons_crom 4 ,
319.Xr ddb 4 ,
320.Xr firewire 4 ,
321.Xr fwohci 4 ,
322.Xr gdb 4 ,
323.Xr eui64 5 ,
324.Xr fwcontrol 8
325.Sh AUTHORS
326.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
327.Sh BUGS
328This utility is
329.Ud
330