xref: /freebsd/usr.sbin/dconschat/dconschat.8 (revision 87569f75a91f298c52a71823c04d41cf53c88889)
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 h Ar hz
39.Op Fl C Ar console_port
40.Op Fl G Ar gdb_port
41.Op Fl M Ar core
42.Op Fl N Ar system
43.Nm
44.Op Fl brvwR1
45.Op Fl h Ar hz
46.Op Fl C Ar console_port
47.Op Fl G Ar gdb_port
48.Op Fl a Ar address
49.Op Fl u Ar bus_num
50.Fl t Ar target_eui64
51.Sh DESCRIPTION
52The
53.Nm
54utility is designed to provide a way for users to access
55.Xr dcons 4
56(dumb console device) on a local or remote system.
57The
58.Nm
59utility interacts with
60.Xr dcons 4
61using
62.Xr kvm 3
63or
64.Xr firewire 4 ,
65and interacts with the user over TTY or TCP/IP.
66To access remote
67.Xr dcons 4
68using
69.Xr firewire 4 ,
70you have to specify target EUI64 address using the
71.Fl t
72option.
73.Pp
74The
75.Nm
76utility and the
77.Xr dcons 4
78driver communicate using 2 ports, one for the console port and another
79for remote
80.Xr gdb 1
81port.
82Users are supposed to access
83.Nm
84using TTY,
85.Xr telnet 1
86and
87.Xr gdb 1 .
88You can specify listen ports for console and
89.Xr gdb 1
90port using the
91.Fl C
92and
93.Fl G
94options respectively.
95The port number 0 has special meaning that
96current TTY (stdin/stdout) is used instead of TCP/IP.
97A negative port number will disable the port.
98To quit
99.Nm ,
100send a CR +
101.Ql ~
102+
103.Ql \&.
104sequence to the console port,
105or send signal to the process.
106.Pp
107By analogy with
108.Xr pty 4
109device, the
110.Xr dcons 4
111acts as a slave device and
112.Nm
113acts as a master device with
114.Xr telnetd 8 .
115.Bl -tag -width indent
116.It Fl b
117Translate Ctrl-C to ALT_BREAK (CR +
118.Ql ~
119+ Ctrl-B) on
120.Xr gdb 1
121port.
122.It Fl r
123Replay old buffer on connection.
124.It Fl v
125Verbose debug output.
126Multiple
127.Fl v
128options increase verbosity.
129.It Fl w
130Listen on a wildcard address rather than localhost.
131.It Fl R
132Read-only.
133Do not write anything to the
134.Xr dcons 4
135buffer.
136.It Fl T
137Enable ad-hoc workaround for the TELNET protocol to
138remove unnecessary byte sequences.
139It should be set when you access
140.Nm
141using
142.Xr telnet 1 .
143.It Fl 1
144One-shot.
145Read available buffer, then exit.
146This implies the
147.Fl r
148option.
149.It Fl h Ar hz
150Specify polling rate.
151The default value is 100.
152.It Fl C Ar console_port
153Specify the console port.
154The default value is 0 (stdin/stdout).
155.It Fl G Ar gdb_port
156Specify
157.Xr gdb 1
158port.
159The default value is \-1 (disabled).
160.It Fl M Ar core
161Specify core file.
162.It Fl N Ar system
163Specify system file such as
164.Pa /boot/kernel/kernel .
165.It Fl t Ar target_eui64
166Specify the 64-bit extended unique identifier of the target,
167and use FireWire to access remote
168.Xr dcons 4 .
169.It Fl a Ar address
170Specify the physical I/O address of the
171.Xr dcons 4
172buffer.
173See
174.Xr dcons 4
175for details.
176If this option is not specified,
177.Nm
178tries to get the address from the Configuration ROM on the target.
179You are supposed to enable
180.Xr dcons_crom 4
181on the target to omit this option.
182.It Fl u Ar bus_num
183Specify FireWire bus number.
184The default is 0.
185.El
186.Sh FILES
187.Bl -tag -width indent -compact
188.It Pa /dev/fwmem0.0
189.It Pa /dev/mem
190.It Pa /dev/kmem
191.El
192.Sh EXAMPLES
193To use
194.Nm
195with FireWire for remote
196.Xr dcons 4 ,
197you have to specify the EUI64 of the target.
198You can obtain EUI64 by running
199.Xr fwcontrol 8
200without options.
201The first EUI64 is of the host running
202.Xr fwcontrol 8
203and others on the bus follow.
204.Bd -literal -offset indent
205# fwcontrol
2062 devices (info_len=2)
207node           EUI64          status
208   1  77-66-55-44-33-22-11-00      0
209   0  00-11-22-33-44-55-66-77      1
210.Ed
211.Pp
212The EUI64 does not change unless you change the hardware
213as the ethernet address.
214.Pp
215Now we can run
216.Nm .
217.Bd -literal -offset indent
218# dconschat -br -G 12345 -t 00-11-22-33-44-55-66-77
219.Ed
220.Pp
221You will get console output of the target and login prompt if a
222.Xr getty 8
223is running on
224.Xr dcons 4 .
225You can break to DDB with ALT_BREAK (CR +
226.Ql ~
227+ Ctrl-B)
228if
229.Dv DDB
230and
231.Dv ALT_BREAK_TO_DEBUGGER
232are enabled in the target kernel.
233To quit the session, type CR +
234.Ql ~
235+
236.Ql \&.
237in the console port.
238.Pp
239Using
240.Xr gdb 1
241port is almost the same as remote
242.Xr gdb 1
243over serial line except
244using TCP/IP instead of
245.Pa /dev/cu* .
246See
247.Sx "On-line Kernel Debugging Using Remote GDB"
248section of
249.%T "The FreeBSD Developers Handbook"
250and
251.Xr gdb 4
252for details.
253.Bd -literal -offset indent
254% gdb -k kernel.debug
255(kgdb) target remote :12345
256.Ed
257.Pp
258Once
259.Xr gdb 1
260is attached and you specified the
261.Fl b
262option to
263.Nm ,
264typing Ctrl-C in
265.Xr gdb 1
266causes a break to debugger.
267.Pp
268The following command gets the console log from the crash dump:
269.Bd -literal -offset indent
270# dconschat -1 -M vmcore.0 -N kernel.0
271.Ed
272.Pp
273If you want access to the console using
274.Xr telnet 1 ,
275try the following:
276.Bd -literal -offset indent
277# dconschat -rTC 5555 &
278# telnet localhost 5555
279.Ed
280.Pp
281You may want to keep logging console output of several machines.
282.Nm conserver-com
283in the Ports collection may help you.
284Insert the following lines in
285.Pa conserver.cf :
286.Bd -literal -offset indent
287console local {
288	master localhost;
289	type exec;
290	exec /usr/sbin/dconschat -rh 25;
291}
292console remote {
293	master localhost;
294	type exec;
295	exec /usr/sbin/dconschat -rh 25 -t 00-11-22-33-44-55-66-77;
296}
297.Ed
298.Sh SEE ALSO
299.Xr gdb 1 ,
300.Xr telnet 1 ,
301.Xr kvm 3 ,
302.Xr dcons 4 ,
303.Xr dcons_crom 4 ,
304.Xr ddb 4 ,
305.Xr firewire 4 ,
306.Xr fwohci 4 ,
307.Xr gdb 4 ,
308.Xr eui64 5 ,
309.Xr fwcontrol 8
310.Sh AUTHORS
311.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org
312.Sh BUGS
313This utility is
314.Ud .
315