Skip to content

Commit df9b18e

Browse files
committed
extra debug prints
Signed-off-by: Filip Lewiński <[email protected]>
1 parent 11fff7d commit df9b18e

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

DasharoPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,8 @@ AddOutput (
607607
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
608608

609609
DevicePath = DevicePathFromHandle (Handle);
610+
DEBUG ((DEBUG_INFO, "%a: %s: handle %p: device path found\n",
611+
__FUNCTION__, ReportText, Handle));
610612
if (DevicePath == NULL) {
611613
DEBUG ((EFI_D_ERROR, "%a: %s: handle %p: device path not found\n",
612614
__FUNCTION__, ReportText, Handle));
@@ -615,7 +617,7 @@ AddOutput (
615617

616618
Status = EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);
617619
if (EFI_ERROR (Status)) {
618-
DEBUG ((EFI_D_ERROR, "%a: %s: adding to ConOut: %r\n", __FUNCTION__,
620+
DEBUG ((DEBUG_INFO, "%a: %s: adding to ConOut: %r\n", __FUNCTION__,
619621
ReportText, Status));
620622
return;
621623
}
@@ -1619,6 +1621,50 @@ PlatformBootManagerAfterConsole (
16191621
gBS->Stall (200 * 1000);
16201622
EfiBootManagerConnectAll ();
16211623

1624+
// ------
1625+
1626+
EFI_DEVICE_PATH_PROTOCOL *dp;
1627+
UINTN Size;
1628+
EFI_STATUS dumpStatus;
1629+
1630+
// Dump ConOut
1631+
Size = 0;
1632+
Status = gRT->GetVariable(
1633+
L"ConOut", &gEfiGlobalVariableGuid,
1634+
NULL, &Size, NULL);
1635+
if (Status == EFI_BUFFER_TOO_SMALL) {
1636+
dp = AllocatePool(Size);
1637+
if (dp) {
1638+
Status = gRT->GetVariable(
1639+
L"ConOut", &gEfiGlobalVariableGuid,
1640+
NULL, &Size, dp);
1641+
if (!EFI_ERROR(dumpStatus)) {
1642+
DEBUG((DEBUG_INFO, "[ConOut] %s\n", ConvertDevicePathToText(dp, TRUE, TRUE)));
1643+
}
1644+
FreePool(dp);
1645+
}
1646+
}
1647+
1648+
// Repeat the same for ConIn
1649+
Size = 0;
1650+
Status = gRT->GetVariable(
1651+
L"ConIn", &gEfiGlobalVariableGuid,
1652+
NULL, &Size, NULL);
1653+
if (Status == EFI_BUFFER_TOO_SMALL) {
1654+
dp = AllocatePool(Size);
1655+
if (dp) {
1656+
Status = gRT->GetVariable(
1657+
L"ConIn", &gEfiGlobalVariableGuid,
1658+
NULL, &Size, dp);
1659+
if (!EFI_ERROR(dumpStatus)) {
1660+
DEBUG((DEBUG_INFO, "[ConIn] %s\n", ConvertDevicePathToText(dp, TRUE, TRUE)));
1661+
}
1662+
FreePool(dp);
1663+
}
1664+
}
1665+
1666+
// ------
1667+
16221668
EfiBootManagerRefreshAllBootOption ();
16231669

16241670
//

DasharoPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@ RegisterUartConsole (
266266
// Print Device Path
267267
//
268268
DevPathStr = ConvertDevicePathToText (DevicePath, FALSE, FALSE);
269+
DEBUG((
270+
EFI_D_INFO,
271+
"%segistering UART Console: COM%d DevPath: %s\n",
272+
UartEnabled ? L"R" : L"Unr",
273+
UartNumber + 1,
274+
DevPathStr
275+
));
269276
if (DevPathStr != NULL) {
270277
DEBUG((
271278
EFI_D_INFO,
@@ -464,6 +471,12 @@ PreparePciSerialDevicePath (
464471
// Print Device Path
465472
//
466473
DevPathStr = ConvertDevicePathToText (DevicePath, FALSE, FALSE);
474+
DEBUG((
475+
DEBUG_INFO,
476+
"Setting PCI Serial Console, DevPath: %s\n",
477+
DevPathStr
478+
));
479+
467480
if (DevPathStr != NULL) {
468481
DEBUG((
469482
EFI_D_INFO,

0 commit comments

Comments
 (0)