0

I have been trying to redirect the stdout that QEMU gives (with the boot messages) to a file and to another terminal window or tty (e.g /dev/tty3). In order to be able to understand the operations that QEMU does to redirect output so I can create a new Char device that will get the stdout from the guest being emulated and send it to another location. I'm trying to do this with following command but with no success:

`qemu-system-aarch64 -machine virt \
-cpu cortex-a53 \
-machine type=virt \
-chardev stdio,mux=on,id=char0,signal=off \
-mon chardev=char0 \
-serial chardev:char0 \
-chardev file,id=file1,path=qemu_file.txt \
-chardev serial,id=char1,path="/dev/tty3" \
-device pci-serial,chardev=char1 \
-device pci-serial,chardev=file1 \
-m 2048 \
-kernel Image \
-append "console=ttyAMA0,115200" `

1 Answers1

0

I was searching for a similar solution. Hope you or someone else can still use the following (based on your command):

-chardev stdio,mux=on,id=char0,logfile=qemu_file.txt,signal=off \
-mon chardev=char0 \
-serial chardev:char0 \

You had 2 chardevs too many? and im not sure youd need pci devices (does aarch64 require?)

I cant find a easy aarch64 linux kernel at the moment, but on x86_64 this above works. you might be able to adapt this to aarch64? Its been a few months so I asume youve found something else or nolonger need this. ive based this on: How to redirect QEMU -serial output to both a file and the terminal or a port?