<div dir="ltr">inline<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 13, 2015 at 7:23 PM, Andrew Fish <span dir="ltr"><<a href="mailto:afish@apple.com" target="_blank">afish@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><br><div><div><div class="h5"><blockquote type="cite"><div>On Feb 13, 2015, at 3:24 PM, Edward Chicopee <<a href="mailto:edward.chicopee@gmail.com" target="_blank">edward.chicopee@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div><div><div><div><div>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!)<br><br></div>I can see with the MinnowboardMax serial port debug output that if I write 0x01 to port 0xB2, it prints some things like <br>"PiSmmCommunicationHandler Enter"<br></div>"PiSmmCommunicationHandler CommunicateHeader - 0"<br>etc<br></div>But when I search through the source code such lines don't seem to be present.<br><br>Eventually I found that they exist in a binary-only package, MinMAX076\Vlv2BinaryPkg\IA32DEBUG\IA32\PiSmmCommunicationSmm.efi<br></div>Running
strings on the binary seems to imply that it was linked against things
like MdePkg\Library\BaseDebugLibSerialPort\DebugLib.c<br><br>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.<br><br></div>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?<br><div><br></div></div></div></blockquote><div><br></div></div></div><div>Ed,</div><div><br></div><div>The INF defines the Library Class (think API) that the driver consumes. There is not a 1:1 mapping between a Library Class (API) and a Library Instance (Implementation). </div><div><br></div><div>The DSC defines the which Library Instance is linked against the driver. The idea is the library choices are pushed into the platform build, and don’t exist in the INF. So for example if you get Reference Code for the Silicon you don’t need to modify it to use a different debug scheme. </div><span><br><blockquote type="cite"><div><div dir="ltr"><div>So any help on how to
see the print and/or (static?) link against the DebugLib.c that so </div></div></div></blockquote><div><br></div></span><div>All linking in the edk2 is static linking. Dynamic stuff is all done in code via Protocols. </div></div></div></blockquote><div><br></div><div>That makes sense, and is a good point. Thanks for setting me straight there, lest I keep thinking about it wrong.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div><span><br><blockquote type="cite"><div><div dir="ltr"><div>I can
keep printing at runtime would be very appreciated.<br><br></div></div></div></blockquote><div><br></div></span><div>I don’t know the specifics of your platform but the best way to see what is going on is to generate a build report. You do this by adding a -y build.log to the build command. You can lookup the driver you care about and it will show you what libraries where used. If those libraries depended on libraries it will show you that too. </div></div></div></blockquote><div><br></div><div>Anyone know how to pass this -y build.log through to the MinnowMax Build_IFWI.bat so that it generates that log file?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div><div><br></div><div>A quick way to figure out the different DebugLib instances is to do something like:</div><div><div style="margin:0px;font-family:Menlo;font-size:11px"><span style="color:rgb(195,55,32)">~/work/src/edk2</span><span style="color:rgb(52,189,38)">(master)</span><span style="color:rgb(175,173,36)">></span>git grep DebugLib -- *.inf | grep LIBRARY_CLASS </div><div style="margin:0px;font-family:Menlo;font-size:11px">ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf:24: LIBRARY_CLASS = DebugLib|BASE SEC DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER</div><div style="margin:0px;font-family:Menlo;font-size:11px">IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf:24: LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER SMM_CORE PEIM SEC PEI_CORE UEFI_APPLICATION UEFI_DRIVER</div><div style="margin:0px;font-family:Menlo;font-size:11px">IntelFspPkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf:21: LIBRARY_CLASS = DebugLib</div><div style="margin:0px;font-family:Menlo;font-size:11px">MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf:23: LIBRARY_CLASS = DebugLib </div><div style="margin:0px;font-family:Menlo;font-size:11px">MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf:24: LIBRARY_CLASS = DebugLib </div><div style="margin:0px;font-family:Menlo;font-size:11px">MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf:25: LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER </div><div style="margin:0px;font-family:Menlo;font-size:11px">MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf:25: LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER </div><div style="margin:0px;font-family:Menlo;font-size:11px">OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf:24: LIBRARY_CLASS = DebugLib</div></div></div></div></blockquote><div><br></div><div>For the MinMAX076 folder that yields</div><div><br></div><div><font size="1"><p>IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf: LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER SMM_CORE PEIM SEC PEI_CORE UEFI_APPLICATION UEFI_DRIVER</p>
<p>IntelFspPkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPort.inf: LIBRARY_CLASS = DebugLib</p>
<p>MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf: LIBRARY_CLASS = DebugLib</p>
<p>MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf: LIBRARY_CLASS = DebugLib</p>
<p>MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf: LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER</p>
<p>MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf: LIBRARY_CLASS = DebugLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER</p></font></div><div><br></div><div>So if I'm following you correctly, you're saying that if I look at something like the PiSmmCore.inf, first it confirms that it consumes the DebugLib Library Class (API), and then I look at the C:\MinMAX076\Vlv2TbltDevicePkg\PlatformPkgIA32.dsc that the target.txt points at, it tells me that if it's a debug build, it links against the code created by the <span lang="EN">"DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf"</span> file. And based on that grep command, I know that this supports basically all the module types.</div><div><br></div><div>Did I interpret that correctly?</div><div><br></div><div>Thank you</div><div><br></div><div>Ed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div><div><div><br></div></div><div>This will show you the set of Library Instances that produce the DebugLib LibraryClass, and what module types they support. </div><div><br></div><div>Good luck,</div><div><br></div><div>Andrew Fish</div><br><blockquote type="cite"><div><div dir="ltr"><div>Ed<br></div></div>
------------------------------------------------------------------------------<br>Dive into the World of Parallel Programming. The Go Parallel Website,<br>sponsored by Intel and developed in partnership with Slashdot Media, is your<br>hub for all things parallel software development, from weekly thought<br>leadership blogs to news, videos, case studies, tutorials and more. Take a<br>look and join the conversation now. <a href="http://goparallel.sourceforge.net/_______________________________________________" target="_blank">http://goparallel.sourceforge.net/_______________________________________________</a><br>edk2-devel mailing list<br><a href="mailto:edk2-devel@lists.sourceforge.net" target="_blank">edk2-devel@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/edk2-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/edk2-devel</a><br></div></blockquote></div><br></div><br>_______________________________________________<br>
elinux-MinnowBoard mailing list<br>
<a href="mailto:elinux-MinnowBoard@lists.elinux.org">elinux-MinnowBoard@lists.elinux.org</a><br>
<a href="http://lists.elinux.org/mailman/listinfo/elinux-minnowboard" target="_blank">http://lists.elinux.org/mailman/listinfo/elinux-minnowboard</a><br>
<br></blockquote></div><br></div></div>