From owner-freebsd-mips@FreeBSD.ORG Tue May 10 15:31:17 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A999106566B for ; Tue, 10 May 2011 15:31:17 +0000 (UTC) (envelope-from ehmoeok@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 20A988FC0C for ; Tue, 10 May 2011 15:31:17 +0000 (UTC) Received: by iwn33 with SMTP id 33so7511293iwn.13 for ; Tue, 10 May 2011 08:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:content-type:content-transfer-encoding :subject:date:message-id:to:mime-version:x-mailer; bh=EQxtgGswcX1nuOEIRxRZT7dxBtnbjJM1GxFClvmcdnw=; b=jLhMvib3Mit1o7DyDalIK5SgWkKGvpSR0XDxKtEWHrrGx/6lCLLLiI6v104TtFihqA WWZanbPSK2luJl9ygWxFTYrGXFu2AO7IMe47kJfAJ1trW86bT6S6f6cWlxMwzro+5H63 P46UxabW1rDUmRND4iFUznLjwZe4O4g4saiAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=w4JQDe7N1/u1FZWkZ6//lJ00qF5TWgNsv+I4D9tBxxNFQu8qvbQVJ1YZIqi90ZUsfB SnfALtC3DpNq9yNNu2kfpCQPx/hNCg75QIUNL9yfQkFEBGkFvMPD77kwAM4xeMIQlDPO L3aOpsuAO69hJ/k3XWH3xE9HMxv+WD1ariMBY= Received: by 10.42.142.71 with SMTP id r7mr1952831icu.397.1305041476565; Tue, 10 May 2011 08:31:16 -0700 (PDT) Received: from [192.168.1.103] (24-136-20-122.c3-0.stn-ubr3.chi-stn.il.cable.rcn.com [24.136.20.122]) by mx.google.com with ESMTPS id xe5sm2880530icb.10.2011.05.10.08.31.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2011 08:31:15 -0700 (PDT) From: Erik Moe Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Tue, 10 May 2011 10:31:14 -0500 Message-Id: <034B1706-6E5A-41C6-988F-D4B3C911D840@gmail.com> To: freebsd-mips@freebsd.org Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: Remote debugging RB133c X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 15:31:17 -0000 Me again, I'm trying to do some remote debugging on the RB133c. I can get the = kernel to boot over tftp. I've added the following option to the = ADM5120 kernel config: makeoptions DEBUG=3D-g=20 options DDB options KDB options GDB options BREAK_TO_DEBUGGER I've also built a cross-debugger: export SRCROOT=3D/home/emoe/svn/mips export TARGET_ARCH=3Dmipsel cd ${SRCROOT}/gnu/usr.bin/binutils && make depend all && cd ../gdb && make depend all && cd gdb && make install && cd ../kgdb && make install I've locked my serial port at 115200 baud: # stty -f /dev/cuaU0.init speed 115200 # stty -f /dev/cuaU0.lock 1 I connect to the serial port on the RB133c using screen and boot the = kernel: # screen /dev/cuaU0 RouterBOOT booter 2.18 RouterBoard 133C3 CPU frequency: 175 MHz Memory size: 16 MB Press any key within 6 seconds to enter setup...... trying dhcp protocol... OK resolved mac address 00:0C:29:29:27:66 Gateway: 192.168.11.1 transfer started ......................... transfer ok, time=3D5.07s setting up elf image... OK jumping to kernel code entry: mips_init() Cache info: picache_stride =3D 4096 picache_loopcount =3D 2 pdcache_stride =3D 4096 pdcache_loopcount =3D 2 cpu0: MIPS Technologies processor v11.128 MMU: Standard TLB, 16 entries L1 i-cache: 2 ways of 256 sets, 16 bytes per line L1 d-cache: 2 ways of 256 sets, 16 bytes per line Config1=3D0x1e994c8a Physical memory chunk(s): 0x29c000 - 0xffffff, 14041088 bytes (3428 pages) Maxmem is 0x1000000 GDB: debug ports: uart GDB: current port: uart KDB: debugger backends: ddb gdb KDB: current backend: ddb Copyright (c) 1992-2011 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights = reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #9 r221418M: Sun May 8 20:20:54 CDT 2011 = root@freebsd.localdomain:/usr/home/emoe/obj/mips/mips.mipsel/usr/home/emoe= /svn/mips/sys/ADM5120 mips real memory =3D 16777216 (16384K bytes) Physical memory chunk(s): 0x00328000 - 0x00f8dfff, 13000704 bytes (3174 pages) avail memory =3D 12746752 (12MB) nfslock: pseudo-device mem: null: nexus0: clock0: on nexus0 Timecounter "MIPS32" frequency 175000000 Hz quality 800 Event timer "MIPS32" frequency 175000000 Hz quality 800 obio0 at mem 0-0x1ffffffe on nexus0 admsw0: on obio0 admsw0: ADM5120 Switch Engine, 6 ports admsw0: base Ethernet address 00:0c:42:07:b2:4e admsw0: Ethernet address: 00:0c:42:07:b2:4e admsw1: Ethernet address: 00:0c:42:07:b2:4f admsw2: Ethernet address: 00:0c:42:07:b2:50 admsw3: Ethernet address: 00:0c:42:07:b2:51 admsw4: Ethernet address: 00:0c:42:07:b2:52 admsw5: Ethernet address: 00:0c:42:07:b2:53 uart0: on obio0 uart0: fast interrupt uart0: console (115200,n,8,1) Device configuration finished. Timecounters tick every 10.000 msec bootpc_init: wired to interface 'admsw0' Sending DHCP Discover packet from interface admsw0 (00:0c:42:07:b2:4e) DHCP/BOOTP timeout for server 255.255.255.255 DHCP/BOOTP timeout for server 255.255.255.255 DHCP/BOOTP timeout for server 255.255.255.255 DHCP/BOOTP timeout for server 255.255.255.255 DHCP/BOOTP timeout for server 255.255.255.255 =20 Within screen, I can send a BREAK (ctrl-a b) and drop into DDB and = invoke the GDB backend. KDB: enter: Line break on console [ thread pid 10 tid 100002 ] Stopped at kdb_enter+0x4c: lui at,0x8029 db> gdb (ctrl-c will return control to ddb) Switching to gdb back-end $T0525:78dc0b80;thread:186a2;#e4 Then I can exit screen (ctrl-a K) and invoke kgdb-mipsel, but I'm seeing = a lot of "Ignoring packet error", "Reply contains invalid hex digit 116" = errors and it doesn't seem to be functioning. # kgdb-mipsel -r /dev/cuaU0 /home/emoe/tftpboot/boot/kernel/kernel GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you = are welcome to change it and/or distribute copies of it under certain = conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for = details. This GDB was configured as "--host=3Di386-marcel-freebsd = --target=3Dmipsel-marcel-freebsd"...Switching to remote protocol kdb_enter (why=3D0x801f1eac "break", Ignoring packet error, = continuing... msg=3DReply contains invalid hex digit 116 ) at /usr/home/emoe/svn/mips/sys/kern/subr_kdb.c:336 336 kdb_why =3D KDB_WHY_UNSET; Ignoring packet error, continuing... (kgdb) break admsw_start Ignoring packet error, continuing... Reply contains invalid hex digit 116 (kgdb) continue Continuing. Ignoring packet error, continuing... It could very well be I don't know what I'm doing, but has anyone had = success? Thanks, Erik =20=