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 EXAMPLES 187To use 188.Nm 189with FireWire for remote 190.Xr dcons 4 , 191you have to specify the EUI64 of the target. 192You can obtain EUI64 by running 193.Xr fwcontrol 8 194without options. 195The first EUI64 is of the host running 196.Xr fwcontrol 8 197and others on the bus follow. 198.Bd -literal -offset indent 199# fwcontrol 2002 devices (info_len=2) 201node EUI64 status 202 1 77-66-55-44-33-22-11-00 0 203 0 00-11-22-33-44-55-66-77 1 204.Ed 205.Pp 206The EUI64 does not change unless you change the hardware 207as the ethernet address. 208.Pp 209Now we can run 210.Nm . 211.Bd -literal -offset indent 212# dconschat -br -G 12345 -t 00-11-22-33-44-55-66-77 213.Ed 214.Pp 215You will get console output of the target and login prompt if a 216.Xr getty 8 217is running on 218.Xr dcons 4 . 219You can break to DDB with ALT_BREAK (CR + 220.Ql ~ 221+ Ctrl-B) 222if 223.Dv DDB 224and 225.Dv ALT_BREAK_TO_DEBUGGER 226are enabled in the target kernel. 227To quit the session, type CR + 228.Ql ~ 229+ 230.Ql \&. 231in the console port. 232.Pp 233Using 234.Xr gdb 1 235port is almost the same as remote 236.Xr gdb 1 237over serial line except 238using TCP/IP instead of 239.Pa /dev/cu* . 240See 241.Sx "On-line Kernel Debugging Using Remote GDB" 242section of 243.%T "The FreeBSD Developers Handbook" 244and 245.Xr gdb 4 246for details. 247.Bd -literal -offset indent 248% gdb -k kernel.debug 249(kgdb) target remote :12345 250.Ed 251.Pp 252Once 253.Xr gdb 1 254is attached and you specified the 255.Fl b 256option to 257.Nm , 258typing Ctrl-C in 259.Xr gdb 1 260causes a break to debugger. 261.Pp 262The following command gets the console log from the crash dump: 263.Bd -literal -offset indent 264# dconschat -1 -M vmcore.0 -N kernel.0 265.Ed 266.Pp 267If you want access to the console using 268.Xr telnet 1 , 269try the following: 270.Bd -literal -offset indent 271# dconschat -rTC 5555 & 272# telnet localhost 5555 273.Ed 274.Pp 275You may want to keep logging console output of several machines. 276.Nm conserver-com 277in the Ports collection may help you. 278Insert the following lines in 279.Pa conserver.cf : 280.Bd -literal -offset indent 281console local { 282 master localhost; 283 type exec; 284 exec /usr/sbin/dconschat -rh 25; 285} 286console remote { 287 master localhost; 288 type exec; 289 exec /usr/sbin/dconschat -rh 25 -t 00-11-22-33-44-55-66-77; 290} 291.Ed 292.Sh FILES 293.Bl -tag -width indent -compact 294.It Pa /dev/fwmem0.0 295.It Pa /dev/mem 296.It Pa /dev/kmem 297.El 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