RE: [Edk2 Dev] Early debug output

Subject: RE: [Edk2 Dev] Early debug output

From: Lu ken <ken.lu@intel.com>

To: dev@edk2.tianocore.org

Date: 2008-09-27 19:32:22

Hi, Thomas:
=09The first thing you need to know is DEBUG() macro is produced by
DebugLib library class, the output of DEBUG() macro can be different in
different platform or environment. You can implement your own DebugLib
library instance to output debug information to whatever device.
=09Some useful PCD(Platform Configuration Database) flag you need
set in your platform DSC to make sure correct debug information is
output, they are
=09gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel
=09gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask
=09Please ref to MdePkg\Include\Library\DebugLib to set value of
these PCD.

=09EDKII code base provide an implementation of library class
DebugLib to output debug information via ReportStatusCode library class.
This implementation is
IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\PeiDxeDeb
ugLibReportStatusCode.inf.=20

=09In PEI phase, ReportStatusCode service is produced by
EFI_PEI_SERVICE, but it will do nothing at beginning of PEI phase until
PEIM IntelFrameworkModulePkg\Universal\StatusCode\Pei\PeiStatusCode.inf
install implementation. So you need make sure PEIM
IntelFrameworkModulePkg\Universal\StatusCode\Pei\PeiStatusCode.inf is
dispatched as early as possible in you platform. You can use APRIORI
file mechanism to ensure it.

=09So, if you use EDKII default implementation that output debug
information via EFI_PEI_SERVICE->ReportStatusCode, following steps is
need:
=091) Use DebugLib library class in your module's INF
=092) In platform's DSC map library class DebugLib to library
instance
IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\PeiDxeDeb
ugLibReportStatusCode.inf
=093) In platform's DSC map library class ReportStatusCode to
library instance
IntelFrameworkModulePkg\Library\PeiReportStatusCodeLib\ReportStatusCodeL
ib.c for PEIM module type;
=094) In platform's DSC, add PEIM module
IntelFrameworkModulePkg\Universal\StatusCode\Pei\PeiStatusCode.inf=20
=095) In platform's FDF file, use APRIORI to make sure
PeiStatusCode is dispatched as early as possible.
=096) In platform's DSC, Set value of PCD
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial to
TRUE.
=097) In platform's DSC set value of=20
=09  a) PCD gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel to
0x80000042, that means debug information marked as DEBUG_ERROR,
DEBUG_INFO, DEBUG_WARN will be output.
=09  b) PCD gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask to 0x2F,
that means ASSERT, DEBUG all will be enable.
=09
=09
=20

-----Original Message-----
From: admin@tianocore.org [mailto:admin@tianocore.org]=20
Sent: Friday, September 26, 2008 5:39 PM
To: dev@edk2.tianocore.org
Subject: [Edk2 Dev] Early debug output

Hi all

I'm knew to UEFI and EDK2 so please forgive me I my question sounds
stupid.

How can I have debug output (serial or vga) as early as possible ?=20

I need to output debug traces just after the SEC phase, in the PeiCore
function. What do I need to enable / perform in order to have the
DEBUG() macro working ?

Regards,
Thomas

------------------------------------------------------
https://edk2.tianocore.org/ds/viewMessage.do?dsForumId=3D135&dsMessageId=3D=
2
9652

To unsubscribe from this discussion, e-mail:
[dev-unsubscribe@edk2.tianocore.org].

------------------------------------------------------
https://edk2.tianocore.org/ds/viewMessage.do?dsForumId=3D135&dsMessageId=3D=
29706

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@edk2.tianocor=
e.org].