0
votes

i am using qemu-system-arm to execute a bare-metal cortex-m3 binary using a custom machine populated with emulations of memory mapped devices. To exchange data between host and the m3 binary running in qemu, I start qemu with

-chardev udp, id=ch0, port=x, localport=y -serial chardev:ch0

Then in qemu I bind a device to serial_hds[0]. Writing to the serial device, then results in udp packets sent to the host.

My question is: do I have to make the connection to -serial ? Can I in some way access the created chardevs without using the way via the -serial?

I want to setup qemu to listen on 10 udp ports, but what I understand, the -serial option is limited to max 4 devices.

1

1 Answers

0
votes

QEMU's chardev abstraction has "front ends" and "back ends".

The "back end" is whatever you connect to on the host side (which might be a UDP port, stdin/stdout, a UNIX domain socket, etc). The -chardev option is what creates and configures this back end.

The "front end" is the part on the QEMU side of this. The most common use is a UART (serial port), but you can also use chardevs to specify how to talk to the QEMU monitor, or to a guest parallel port.

In this case your problem is "what are the N things that the guest sees", ie what are the front ends? There has to be something here, which means your board needs to actually create multiple UARTs or something. -serial is a limit of 4 (you can probably raise that with a local hack changing MAX_SERIAL_PORTS), but if your device model is written to take a QEMU chardev rather than to look directly at serial_hds[] it should be possible to configure it other than via -serial (either with -device ... or -global ... to set the chardev as the device property).