Port-m68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: KGDB on virt68k?



On Apr 26, 2026, at 1:32 PM, Chris Hanson <cmhanson%eschatologist.net@localhost> wrote:
> 
> On Apr 26, 2026, at 4:56 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
>> 
>> On Apr 26, 2026, at 4:47 AM, Chris Hanson <cmhanson%eschatologist.net@localhost> wrote:
>>> 
>>> Anyone have any suggestions for how I should adjust GENERIC.local in virt68k for kernel debugging via KGDB?
>> 
>> Hm, that would need a separate serial port, and I don’t think Qemu provides one other than the one Goldfish virtual serial (unless there’s a Qemu arg that allows you to create an additional one; I never tried).  In any case, KGDB glue would have to be added to gftty.
> 
> I’ll take a look at QEMU to see if this is feasible.

I don't know the syntax to create another Goldfish tty on the QEMU command line, but it looks like it should be possible: The Android docs for the QEMU Goldfish devices say that serial device IDs are "0 to N" and that the Android emulator reserves the first *two* ports. I think that's expected to be passed to the kernel via the device tree; I don't know whether that's supported by the QEMU virt platform, or by NetBSD virt68k.

I do know I can one or more pairs like this

    -serial tcp:localhost:4000,server,nowait,id="kgdb" \
    -device virtio-serial-device,id="kgdb" \

on the QEMU command line and VirtIO consoles are detected

    [   1.0000000] virtio0 at mainbus0 addr 0xff01f600
    [   1.0000000] virtio0: VirtIO-MMIO-v2
    [   1.0000000] virtio0: console device (id 3, rev. 0x01)
    [   1.0000000] viocon0 at virtio0: features: 0x110000000<V1,INDIRECT_DESC>
    [   1.0000000] virtio0: interrupting at gfpic4 irq 28 (IPL 5)

and I can connect to the port via telnet or nc. So maybe VirtIO serial might be a better approach for KGDB. (I assume if I create an appropriate node in /dev and run getty on it that I'd be able to connect to that port and get a login...)

  -- Chris



Home | Main Index | Thread Index | Old Index