Re: KGDB on virt68k?

Jason Thorpe <[email protected]> Mon, 27 Apr 2026 15:56:32 -0700
Newsgroups gmane.os.netbsd.ports.m68k
Message-ID <[email protected]>

> On Apr 27, 2026, at 3:45=E2=80=AFPM, Chris Hanson =
<[email protected]> wrote:
>=20
> 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.

Well, there is not (yet) any device tree support in the m68k universe.  =
Qemu 68k virt platform provides all of that info to the kernel using =
Linux/68k-style =E2=80=9Cbootinfo=E2=80=9D, which can pass more than one =
BI_VIRT_GF_TTY_BASE record to the kernel (the kernel uses the first one =
for the console).

> I do know I can one or more pairs like this
>=20
>    -serial tcp:localhost:4000,server,nowait,id=3D"kgdb" \
>    -device virtio-serial-device,id=3D"kgdb" \
>=20
> on the QEMU command line and VirtIO consoles are detected
>=20
>    [   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)
>=20
> 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...)

Yah, should:

device-major viocon    char 364            viocon

-- thorpej