I was playing around with TTYs, and for qemu-system-x86_64 -M pc
, whenever I pass the -serial
option it crates a new TTY and I can attach a serial like ttyS0
and ttyS1
to it from Linux.
For ARM however, I can't get past the first ttyAMA0
. If I add -serial
, it does not show on info qtree
and the kernel boot messages only find one:
9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 54, base_baud = 0) is a PL011 rev1
Is it possible, and if not, is there a specific design reason for that?
I'm on QEMU v3.0.0. From the source it does not seem possible: https://github.com/qemu/qemu/blob/v3.0.0/hw/arm/virt.c#L138 as there is only one UART in the memory map:
[VIRT_GIC_REDIST] = { 0x080A0000, 0x00F60000 },
[VIRT_UART] = { 0x09000000, 0x00001000 },
[VIRT_RTC] = { 0x09010000, 0x00001000 },
I'm doing this because I'm trying to see if connecting from a different serial will make KGDB work. On x86_64 I can connect to ttyS0
, but I thought it was worth giving this a try on ARM. See also: https://stackoverflow.com/questions/22004616/how-to-debug-the-linux-kernel-with-qemu-and-kgdb/44197715#44197715
Best Answer
this is my multiple serial support patch for virt board in qemu 4.0.1 (official git commit is f9bec78), please enjoy it :-)
config and build
run