On 08/07/14 18:03, Andrew Fish wrote:
> OVFM maintainers,
> 
> This is an example of using the BaseSerialPortLibIoPort. It enables the
> CpuExceptionHandlerLib serial prints. 
> 
> The BaseSerialPortLibIoPort can also be used to enable
> the MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf and
> obsolete the need
> for OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Andrew Fish <[email protected] <mailto:[email protected]>>
> 
> Thanks,
> 
> Andrew Fish

As far as I can see, pre-patch we have:

DEBUG_ON_SERIAL_PORT (non-default):
- DebugLib resolves to MdePkg/Library/BaseDebugLibSerialPort

Otherwise (default):
- DebugLib resolves to OvmfPkg/Library/PlatformDebugLibIoPort

Post patch, we always resolve DebugLib to
MdePkg/Library/BaseDebugLibSerialPort, and (apparently) we move the
choice to one level deeper, choosing
- between PcAtChipsetPkg/Library/SerialIoLib
- and OvmfPkg/Library/BaseSerialPortLibIoPort
for SerialPortLib.

Presumably, this latter library instance implements SerialPortWrite() by
writing to the QEMU debug port. I assume the benefit is that now all
code that goes through SerialPortLib will reach the QEMU debug port, not
just the code that goes through DebugLib.

Two points:
- Did you add the "OvmfPkg/Library/BaseSerialPortLibIoPort" directory to
the index with "git add" (ie. did you "stage it") before calling "git
commit"? Because it's not in the patch. It's present in your working
tree only I believe.

- Will this redirection break the terminal driver, for example? OVMF
does make use of the serial port even when DEBUG() goes to the QEMU
debug port. For example, thanks to ConSplitterDxe, the setup screens
(Boot manager, Boot maintenance manager etc) are fully usable on the
virtual serial port. I don't immediately see how that stack is built,
but it should not be disturbed. (I don't know if this patch disturbs it,
I'm asking.)

... TerminalDxe seems to consume gEfiSerialIoProtocolGuid, which seems
to be provided by IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe. Hmm... I
think that one doesn't depend on SerialPortLib. Good.

Also, I grepped for SerialPortRead(), to see what code in the tree tries
to read from the serial port (which won't work if the qemu debug port,
faking the serial port, is redirected to a file). The only caller OVMF
*maybe* cares about is
SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort.

Hence I *guess* this patch might break DebugCommunicationLib for OVMF
(see SOURCE_DEBUG_ENABLE), but the debug agent / debug comms never ever
worked for me with OVMF, so I'm not sure if we should care. Probably
something for Jordan to decide.

Thanks,
Laszlo

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to