On Mon, 2 Feb 2026 at 23:08, charles.embedded via
lists.openembedded.org
<[email protected]> wrote:
> 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!

nographic is an option that can be passed only as a command line
parameter to runqemu. It is also not the default: when you run runqemu
with no parameters, it will default to having graphical output if that
is detected to be supported (via trying 'qemu-system.. --help' and
seeing what is enabled), or no output otherwise:

        # If we have no display option, we autodetect based upon what
qemu supports. We
        # need our font setup and show-cusor below so we need to see
what qemu --help says
        # is supported so we can pass our correct config in.
        if not self.nographic and not self.sdl and not self.gtk and
not self.publicvnc and not self.egl_headless == True:
            output = subprocess.check_output([self.qemu_bin,
"--help"], universal_newlines=True, env=self.qemu_environ)
            if "-display gtk" in output:
                self.gtk = True
            elif "-display sdl" in output:
                self.sdl = True
            else:
                self.qemu_opt += ' -display none'

Once again, it is not up to layers to force a decision where qemu
output goes. Maybe users want it in a graphical window. Maybe they
want it in a vnc server. Maybe they don't want it at all, because they
will ssh into the system. We can consider whether the above logic
makes sense, and if nographic should be the default (instead of the
above if..else block), but taking that choice altogether away from
users is not right.

Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#230424): 
https://lists.openembedded.org/g/openembedded-core/message/230424
Mute This Topic: https://lists.openembedded.org/mt/117568097/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to