Hi,

following man kgdb, 
I tested the cable on the first serial port (on the notebook) with the 
system console using cu -l /dev/tty05 -s 9600.
And it works just fine.

I built a sparc Kernel with KGDB enabled:
option          KGDB            # support for kernel gdb
option          KGDBDEV=0xc01   # kgdb device number (dev_t)
option          KGDBRATE=9600   # baud rate
makeoptions DEBUG="-g"

and in config/GENERIC I have DDB disabled:

#option         DDB             # in-kernel debugger
#option         DDB_SAFE_CONSOLE # allow break into ddb during boot

The kernel built fine so far, I run it on the target system, which
is a Tadpole SPARCbook, see the dmesg.

For the remote gdb, I connected the serial cable to the 
second serial port of the notebook.

then in gdb on my debugging host I run:
# gdb /home/sebastia/bsd.gdb
...
(gdb) set remotebaud 9600


When the notebook is booting the system, then I run in gdb:
(gdb) target remote /dev/tty05


And see on the console of the notebook:
zstty1:  kgdb interrupt
kgdb waiting...

and in gdb I see:
(gdb) target remote /dev/cua05
Remote debugging using /dev/cua05
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Couldn't establish connection to remote target
Malformed response to offset query, timeout
(gdb)

And then, that's it. The notebook doesn't seem to
react on any keyboard input anymore, but gdb also
doesn't seem to be able to connect to it via the
serial line.

The system running gdb is a i386.

For kgdb to work, do I need to connect from a 
machine of the same architecture?

I tried from my SS5, connected the serial cable
to its second serial port, but I wasn't even able
to get a serial console.
# cu -l /dev/tty01 -s 9600                                                      
                                                                         
cu: open("/dev/tty01"): Device not configured
Also tried cua01. I don't know which would be the right device.

any hint what I may be doing wrong?
The kernel on the Notebook is a bit modified, since
I'm trying to port the dbri audio driver from NetBSD.

Sebastian


>From the notebook:
$ cat /tmp/dmesg.kgdb                                                          
OpenBSD 5.3-current (GENERIC.kgdb) #0: Sun Mar 31 17:57:23 CEST 2013
    sebastia@warbird.ds9:/usr/src/sys/arch/sparc/compile/GENERIC.kgdb
real mem = 66732032 (63MB)
avail mem = 61648896 (58MB)
mainbus0 at root: Tadpole_S3GX
cpu0 at mainbus0: MB86904 @ 110 MHz, on-chip FPU
cpu0: 16K instruction (32 b/l), 8K data (16 b/l) cache enabled
obio0 at mainbus0
clock0 at obio0 addr 0x71202000: mk48t08 (eeprom)
timer0 at obio0 addr 0x71d00000: delay constant 52, frequency 2000000 Hz
zs0 at obio0 addr 0x71100000 pri 12, softpri 6
zstty0 at zs0 channel 0
zstty1 at zs0 channel 1 (kgdb)
zs1 at obio0 addr 0x71000000 pri 12, softpri 6
zskbd0 at zs1 channel 0: keyboard, type 5, layout 0x21
wskbd0 at zskbd0: console keyboard
zsms0 at zs1 channel 1
wsmouse0 at zsms0 mux 0
slavioconfig at obio0 addr 0x71800000 not configured
auxreg0 at obio0 addr 0x71900000
auxreg1 at obio0 addr 0x71910000
tctrl0 at obio0 addr 0x42000020 pri 11
tctrl0: main power available
clk-ctrl at obio0 addr 0x713c0000 not configured
com0 at obio0 addr 0x713a0000 pri 13: ns16550a, 16 byte fifo
com0: probed fifo depth: 0 bytes
iommu0 at mainbus0 addr 0x10000000: version 0x4/0x0, page-size 4096, range 64MB
sbus0 at iommu0: 22 MHz
pnozz0 at sbus0 slot 0 offset 0x8000000 pri 2: rev 4, 800x600
wsdisplay0 at pnozz0 mux 1: console (std, sun emulation), using wskbd0
dma0 at sbus0 slot 4 offset 0x8400000: rev 2
esp0 at dma0 offset 0x8800000 pri 4: ESP200, 40MHz
scsibus0 at esp0: 8 targets, initiator 7
sd0 at scsibus0 targ 3 lun 0: <IBM, DPRS-21215 !, S61B> SCSI2 0/direct fixed 
serial.IBM_DPRS-21215_!_7L4V6079_
sd0: 1160MB, 512 bytes/sector, 2376864 sectors
bpp0 at sbus0 slot 4 offset 0xc800000: DMA2
ledma0 at sbus0 slot 4 offset 0x8400010: rev 2
le0 at ledma0 offset 0x8c00000 pri 6: address 00:00:83:ae:11:44
le0: 16 receive buffers, 4 transmit buffers
tslot0 at sbus0 slot 1 offset 0x2000000 pri 11: 2 slots
pcmcia0 at tslot0 socket 0
ep0 at pcmcia0 function 0 "3Com, 3C574-TX Fast EtherLink PC Card, A" port 
0x0/32: address 00:60:08:b3:f5:61
tqphy0 at ep0 phy 0: 78Q2120 10/100 PHY, rev. 3
pcmcia1 at tslot0 socket 1
dbri0 at sbus0 slot 2 offset 0x40 pri 9
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootpath: 
/iommu@0,10000000/sbus@0,10001000/espdma@4,8400000/esp@4,8800000/sd@3,0
root on sd0a (15849b035c6ca151.a) swap on sd0b dump on sd0b
WARNING: preposterous time in file system
WARNING: clock lost 10257 days -- CHECK AND RESET THE DATE!


from the SS5:
OpenBSD 5.3-current (GENERIC) #21: Sat Mar 23 17:23:36 MDT 2013
    dera...@sparc.openbsd.org:/usr/src/sys/arch/sparc/compile/GENERIC
real mem = 200933376 (191MB)
avail mem = 192954368 (184MB)
mainbus0 at root: SUNW,SPARCstation-5
cpu0 at mainbus0: MB86907 @ 170 MHz, on-chip FPU
cpu0: 16K instruction (32 b/l), 16K data (32 b/l), 512K external (32 b/l) DVMA 
coherent cache enabled
obio0 at mainbus0
clock0 at obio0 addr 0x71200000: mk48t08 (eeprom)
timer0 at obio0 addr 0x71d00000: delay constant 82, frequency 2000000 Hz
zs0 at obio0 addr 0x71100000 pri 12, softpri 6
zstty0 at zs0 channel 0: console
zstty1 at zs0 channel 1
zs1 at obio0 addr 0x71000000 pri 12, softpri 6
zskbd0 at zs1 channel 0: no keyboard
zsms0 at zs1 channel 1
wsmouse0 at zsms0 mux 0
slavioconfig at obio0 addr 0x71800000 not configured
auxreg0 at obio0 addr 0x71900000
power0 at obio0 addr 0x71910000
fdc0 at obio0 addr 0x71400000 pri 11, softpri 4: chip 82077
iommu0 at mainbus0 addr 0x10000000: version 0x5/0x0, page-size 4096, range 64MB
sbus0 at iommu0: 21.250 MHz
dma0 at sbus0 slot 5 offset 0x8400000: rev 2
esp0 at dma0 offset 0x8800000 pri 4: ESP200, 40MHz
scsibus0 at esp0: 8 targets, initiator 7
cd0 at scsibus0 targ 2 lun 0: <MATSHITA, CD-ROM CR-504, ST23> SCSI2 5/cdrom 
removable
sd0 at scsibus0 targ 3 lun 0: <IBM, DCAS32160SUN2.1G, S60B> SCSI2 0/direct 
fixed serial.IBM_DCAS32160SUN2.1GF2583160_
sd0: 2063MB, 512 bytes/sector, 4226725 sectors
bpp0 at sbus0 slot 5 offset 0xc800000: DMA2
ledma0 at sbus0 slot 5 offset 0x8400010: rev 2
le0 at ledma0 offset 0x8c00000 pri 6: address 08:00:20:89:d9:b5
le0: 16 receive buffers, 4 transmit buffers
audiocs0 at sbus0 slot 4 offset 0xc000000 pri 9
audio0 at audiocs0
"power-management" at sbus0 slot 4 offset 0xa000000 not configured
cgsix0 at sbus0 slot 3 offset 0x0 pri 9: SUNW,501-2325, 1152x900, rev 11
wsdisplay0 at cgsix0 mux 1
wsdisplay0: screen 0 added (std, sun emulation)
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootpath: 
/iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@3,0
root on sd0a (1096ee405a923d3e.a) swap on sd0b dump on sd0b

Reply via email to