[MinnowBoard] How to DebugPrint in SMM at runtime?

Edward Chicopee edward.chicopee at gmail.com
Fri Feb 13 23:24:53 UTC 2015


After finding out OVMF doesn't do SMM (on the EDK2-devel list), I decided
to try working on a MinnowboardMax (hello minnow list too!)

I can see with the MinnowboardMax serial port debug output that if I write
0x01 to port 0xB2, it prints some things like
"PiSmmCommunicationHandler Enter"
"PiSmmCommunicationHandler CommunicateHeader - 0"
etc
But when I search through the source code such lines don't seem to be
present.

Eventually I found that they exist in a binary-only package,
MinMAX076\Vlv2BinaryPkg\IA32DEBUG\IA32\PiSmmCommunicationSmm.efi
Running strings on the binary seems to imply that it was linked against
things like MdePkg\Library\BaseDebugLibSerialPort\DebugLib.c

As I did with OVMF, I just put a "DebugPrint (0xFFFFFFFF, "Hi from SMM\n");
into PiSmmCore.c. I see printout at boot time, but not at runtime upon
forcing an SMI. I assume this is because it's just using some DXE
DebugPrint which goes away at runtime? And I assume the reason the binary
package can continue to DebugPrint into runtime is because it has (static?)
linked against the DebugLib.c and so it contains all the code it needs
internally? Or maybe the serial port configuration gets screwed up at
runtime? But then I would expect after the first PiSmmCommunicationHandler
print for it to be reconfigured properly.

I can see that PiSmmCode.inf says MdePkg/MdePkg.dec is under [Packages],
and DebugLib is under [LibraryClasses], so maybe it's some other reason I
can't see my DebugPrint in PiSmmCore.c at runtime only?

So any help on how to see the print and/or (static?) link against the
DebugLib.c that so I can keep printing at runtime would be very appreciated.

Ed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.elinux.org/pipermail/elinux-minnowboard/attachments/20150213/eff3008e/attachment.html>


More information about the elinux-MinnowBoard mailing list