Enable debug prints to be seen on runtime?


mzktsn@...
 

Hello, i have recent compiled edk2 source for a specific board,
flashed the BIOS and everything worked correct.
I was wondering how to enable runtime
EDK2 DEBUG() prints on my board, and if it is possible to see the output using only my board's serial or
it is needing an external computer to be able to see the runtime print-outs?
Something similar as one can see when using an OVMF emulation on qemu.

Thanks.


Laszlo Ersek
 

On 05/21/20 22:23, mzktsn@... wrote:
Hello, i have recent compiled edk2 source for a specific board,
flashed the BIOS and everything worked correct.
I was wondering how to enable runtime
EDK2 DEBUG() prints on my board, and if it is possible to see the output using only my board's serial or
it is needing an external computer to be able to see the runtime print-outs?
Something similar as one can see when using an OVMF emulation on qemu.
You need the following for runtime DEBUGs:

(a) hardware that is not touched by the OS in *any way* at runtime, and

(b) one of:

(b1) the serial hardware to be IO-port based, and a matching
SerialPortLib instance to be linked into your runtime drivers, or

(b2) the serial hardware to be MMIO based, and a matching SerialPortLib
instance that registers the MMIO register block for runtime mapping
(similarly to MarkIoMemoryRangeForRuntimeAccess() in OvmfPkg), and also
reacts to SetVirtualAddressMap.

In the case of QEMU, it's (a) + (b1); the QEMU debug console is not
touched by the OS, and it is a plain IO port, which is not affected by
paging.

The IO port(s) in (b1), and the MMIO reg block in (b2), are board-specific.

Thanks,
Laszlo