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