I'm not sure specifying -nographic in a BSP layer via QB_GRAPHICS is
correct. QB_GRAPHICS is intended for what emulated hardware should be
present in the guest machine.
-nographic is a host option that tells qemu what to do with the
graphical output (in case of -nographic, discard it). I don't think
it's up to the BSP layer to make that decision.
Hi Alex,
Thanks for the feedback.
In meta-zephyr/meta-zephyr-bsp/conf/machine/qemu-x86.conf are defined several QEMU settings that are used to generate the .qemuboot.conf file during the image build (e.g. ${TMPDIR}/deploy/images/qemu-x86/zephyr-helloworld-qemu-x86-20260201174846.elf).
The expectation is that, based on the resulting .qemuboot.conf, running runqemu should be sufficient to boot Zephyr and see the console output in the terminal (no GUI required). However, in this case QB_GRAPHICS="-nographic" is ignored, and the generated QEMU invocation still selects a graphical display device, so the Zephyr output does not appear on the terminal as expected. Please see the QEMU command:
/<path-to>/usr/bin/qemu-system-i386 -nic none -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 -machine type=q35 -cpu qemu32,+nx,+pae -m 256 -serial mon:vc -serial null -device virtio-vga -display sdl,show-cursor=on -nographic -machine acpi=off -kernel <path-to-build>/tmp/deploy/images/qemu-x86/zephyr-helloworld-qemu-x86-20260201174846.elf -append ' mem=256M swiotlb=0 '
So even though -nographic is present, QEMU is still invoked with -device virtio-vga and -display sdl, and the serial is set to mon:vc.
My intent with the patch is to ensure that when QB_GRAPHICS includes -nographic, runqemu does not select a graphical display device and routes the serial console to the terminal (so the Zephyr log is visible as expected).
Please let me know if I'm not on the right track. Thank you!
Charles Dias