How to tell if a SIMPLE_TEXT_OUTPUT_PROTOCOL writes to serial


Joshua Seaton
 

Hi all,

I'm trying to write generic EFI code that wires up `printf` to both
SIMPLE_TEXT_OUTPUT_PROTOCOL and SERIAL_IO_PROTOCOL when present.
However, at least on headless QEMU, doing this in the naive way results in
double-printing to the console. Is there a way to programmatically
detect whether an implementation of SIMPLE_TEXT_OUTPUT_PROTOCOL writes
to serial so that this can be avoided?


Joshua.