The art of (VM) firmware logging
kraxel.org·12h·
Flag this post

If something goes wrong if usually is very helpful to have log files at hand. Virtual machine firmware is no exception here. So, lets have a look at common practices here.

qemu debug console

On the x86 platform qemu provides a isa-debugcon device. That is the simplest possible logging device, featuring a single ioport. Reading from the ioport returns a fixed value, which can be used to detect whenever the device is present or not. Writing to the ioport sends the character written to the chardev backend linked to device.

By convention the qemu firmware – both seabios and OVMF – uses the ioport address 0x402. So getting the firmware log printed on your terminal works this way:

qemu-system-x86_64 \
-chardev stdio,id=fw \
-device isa-debugcon,iobase=0x402,chardev=fw
``...

Similar Posts

Loading similar posts...