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 dcons 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 58interacts with 59.Xr dcons 4 60using 61.Xr kvm 3 62or 63.Xr firewire 4 64and interact with a 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 by 70.Fl t 71option. 72.Pp 73The 74.Nm 75and 76.Xr dcons 4 77communicate using 2 port, one for console port and the other for 78remote gdb port. 79Users are supposed to access 80.Nm 81using tty, telnet and gdb. 82You can specify listen ports for console and gdb port by 83.Fl C 84and 85.Fl G 86options respectively. The port number 0 has special meaning that 87current tty(stdin/out) is used instead of TCP/IP. 88A negative port number will disable the port. 89To quit dconschat, send a CR + '~' + '.' sequence to the console port 90or send signal to the process. 91.Pp 92By analogy with 93.Xr pty 4 94device, the 95.Xr dcons 4 96acts as a slave device and 97.Nm 98acts as a master device with 99.Xr telnetd 8 . 100.Pp 101.Bl -tag -width indent 102.It Fl b 103Translate Ctrl-C to ALT_BREAK(CR + '~' + Ctrl-B) on gdb port. 104.It Fl r 105Replay old buffer on connection. 106.It Fl v 107Verbose debug output. Multiple '-v' increase verbosity. 108.It Fl w 109Listen on wildcard address rather than localhost. 110.It Fl R 111Read-only. Don't write anything on dcons buffer. 112.It Fl T 113Enable ad hoc workaround for telnet protocol to 114remove unnecessary byte sequences. 115It should be set when you access dconschat using telnet. 116.It Fl 1 117One-Shot. Read available buffer then exit. This implies 118.Fl r 119option. 120.It Fl h Ar hz 121Specify polling rate. The default value is 100. 122.It Fl C Ar console_port 123Specify console port. The default value is 0(stdin/stdout). 124.It Fl G Ar gdb_port 125Specify gdb port.. The default value is -1(disabled). 126.It Fl M Ar core 127Specify core file. 128.It Fl N Ar system 129Specify system file such as /boot/kernel/kernel. 130.It Fl t Ar target_eui64 131Specify the 64bit extended unique identifier of the target and use FireWire to access remote 132.Xr dcons 4 . 133.It Fl a Ar address 134Specify the physical/IO address of the dcons buffer. See 135.Xr dcons 4 136for details. 137If this option is not specified, 138.Nm 139tries to get the address from the Configuration ROM on the target. 140You are supposed to enable 141.Xr dcons_crom 4 142on the target to omit this option. 143.It Fl u Ar bus_num 144Specify FireWire bus number. The default is 0. 145.El 146.Sh EXAMPLE 147To use 148.Nm 149with FireWire for remote 150.Xr dcons , 151you have to specify the eui64 of the target. 152You can obtain EUI64 by running 153.Xr fwcontorl 4 154without options. 155The first EUI64 is of the host running fwcontrol and others on the 156bus follow. 157.Bd -literal -offset indent 158# fwcontrol 1592 devices (info_len=2) 160node EUI64 status 161 1 77-66-55-44-33-22-11-00 0 162 0 00-11-22-33-44-55-66-77 1 163.Ed 164.Pp 165The EUI64 doesn't change unless you change the hardware 166as the ethernet address. 167.Pp 168Now we can run the 169.Nm . 170.Bd -literal -offset indent 171# dconschat -br -G 12345 -t 00-11-22-33-44-55-66-77 172.Ed 173.Pp 174You'll get console output of the target and login prompt if a getty is 175running on dcons. You can break to DDB with ALT_BREAK (CR + '~' + Ctrl-B) 176if DDB and ALT_BREAK_TO_DEBUGGER is enabled in the target kernel. 177To quit the session, type CR + '~' + '.' in the console port. 178.Pp 179Using gdb port is almost the same as remote gdb over serial line except 180using TCP/IP instead of /dev/cu*. See 181"On-line Kernel Debugging Using Remote GDB" 182section of The FreeBSD Developers Handbook and 183.Xr gdb 4 184for detail. 185.Bd -literal -offset indent 186% gdb -k kernel.debug 187(kgdb) target remote :12345 188.Ed 189.Pp 190Once gdb is attached and you specified '-b' option to dconschat, 191typing "Ctrl-C" on gdb causes break to debugger. 192.Pp 193The following command get console log from crash dump: 194.Bd -literal -offset indent 195# dconschat -1 -M vmcore.0 -N kernel.0 196.Ed 197.Pp 198If you want access to the console using telnet, try the following: 199.Bd -literal -offset indent 200# dconschat -rTC 5555 & 201# telnet localhost 5555 202.Ed 203.Pp 204You may want to keep logging console output of several machines. Conserve-com 205in the ports collection may help you. Insert the following lines 206in the conserver.cf. 207.Bd -literal -offset indent 208console local { 209 master localhost; 210 type exec; 211 exec /usr/sbin/dconschat -rh 25; 212} 213console remote { 214 master localhost; 215 type exec; 216 exec /usr/sbin/dconschat -rh 25 -t 00-11-22-33-44-55-66-77; 217} 218.Ed 219.Sh FILES 220.Bl -tag -width indent 221.It Pa /dev/fwmem0.0 222.It Pa /dev/mem 223.It Pa /dev/kmem 224.El 225.Sh SEE ALSO 226.Xr gdb 1 , 227.Xr telnet 1 , 228.Xr kvm 3 , 229.Xr dcons 4 , 230.Xr dcons_crom 4 , 231.Xr ddb 4 , 232.Xr firewire 4 , 233.Xr fwohci 4 , 234.Xr gdb 4 , 235.Xr eui64 5 , 236.Xr fwcontrol 8 237.Sh AUTHORS 238.An Hidetoshi Shimokawa Aq simokawa@FreeBSD.org 239.Sh BUGS 240This utility is still under development. 241.Pp 242