RE: [Edk2 Dev] Early debug output

Subject: RE: [Edk2 Dev] Early debug output

From: Lu ken <>


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
=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

=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
=091) Use DebugLib library class in your module's INF
=092) In platform's DSC map library class DebugLib to library
=093) In platform's DSC map library class ReportStatusCode to
library instance
ib.c for PEIM module type;
=094) In platform's DSC, add PEIM module
=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
=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.

-----Original Message-----
From: []=20
Sent: Friday, September 26, 2008 5:39 PM
Subject: [Edk2 Dev] Early debug output

Hi all

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

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 ?



To unsubscribe from this discussion, e-mail:


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