0
votes

I emulate the firmware of a embedded device with qemu-system-arm. The output of the console is working fine by appending "console=ttyAMA0" to the kernel. On the guest there is a binary which opens another serial port for communication (bi-directional) on /dev/ttyGS0 and listens on that port. Now I need to connect to this port from the host, to send commands to the binary and receive the output.

I already tried different things like creating character devices and pseudo ttys, but I don't know how to define the serial device for the guest.

Is there a way to do this? Thanks in advance.

1

1 Answers

2
votes

If you pass multiple -serial options to QEMU they will be interpreted as defining what you want to do for UARTs 0, 1, 2, etc. So for example "-serial stdio -serial tcp::4444,server" will send UART 0 to your terminal and connect UART 1 to a TCP server on port 4444 which you can then connect to with netcat or similar utility. (You can connect serial output to a lot of different backends, not just stdio or TCP: check the QEMU documentation.)

(NB: this relies on your board model actually creating multiple UARTs and wiring them up to the command line options correctly, of course.)