* [edk2-devel] UefiPayloadPkg debugging
@ 2025-03-17 11:01 Stepan via groups.io
2025-03-18 4:20 ` Stepan via groups.io
0 siblings, 1 reply; 5+ messages in thread
From: Stepan via groups.io @ 2025-03-17 11:01 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 4532 bytes --]
Hello EDK2 community,
I have encountered a strange error. I am trying to activate source code debugging with the following changes:
Index: UefiPayloadPkg/UefiPayloadPkg.dsc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc (revision f19361fd31354003185eef2dba6374805bc6ca9f)
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc (revision 111c1f14db9b0876f66640101fcb2d498d65e8dd)
@@ -26,7 +26,7 @@
FLASH_DEFINITION = UefiPayloadPkg/UefiPayloadPkg.fdf
PCD_DYNAMIC_AS_DYNAMICEX = TRUE
- DEFINE SOURCE_DEBUG_ENABLE = FALSE
+ DEFINE SOURCE_DEBUG_ENABLE = TRUE
DEFINE PS2_KEYBOARD_ENABLE = TRUE
DEFINE RAM_DISK_ENABLE = FALSE
DEFINE SIO_BUS_ENABLE = TRUE
@@ -59,7 +59,7 @@
#
DEFINE UNIVERSAL_PAYLOAD = TRUE
#DEFINE UNIVERSAL_PAYLOAD = FALSE
- DEFINE UNIVERSAL_PAYLOAD_FORMAT = ELF
+ DEFINE UNIVERSAL_PAYLOAD_FORMAT = FIT
#
# NULL: NullMemoryTestDxe
@@ -293,6 +293,7 @@
!if $(SOURCE_DEBUG_ENABLE) == TRUE
PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
!else
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
@@ -435,6 +436,10 @@
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf
+ !if $(SOURCE_DEBUG_ENABLE)
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
+ !endif
+
MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf
SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
@@ -449,6 +454,10 @@
!if $(SMM_SUPPORT) == TRUE
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+ !if $(SOURCE_DEBUG_ENABLE)
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
+ !endif
+
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
I drew information from the following sources: https://raw.githubusercontent.com/wiki/tianocore/tianocore.github.io/OSFC/Debugging_UEFI_Firmware_Linux_Workshop_OSFC_19.pdf , https://cdrdv2-public.intel.com/671474/udk-debugger-tool-user-manual-v1-11.pdf.
Building and running on the target platform causes execution to stop at the following message:
Updated SBL Performance Table: S1 = 692000000ns, S2 = 2179000000ns, OSL = 37000000ns
Payload entry: 0x008085BB
Switch to x64 mode
Jump to payload
Entering Universal Payload...
sizeof(UINTN) = 0x8
BootloaderParameter = 0x47810000
Start init Hobs...
...
HOB[63]: Type = EFI_HOB_TYPE_FV, Offset = 0x1AF0, Length = 0x18
BaseAddress = 0xB71000
Length = 0x59000
There are totally 64 Hobs, the End Hob address is 42DB9B08
===============================
PDB = /edk/Build/UefiPayloadPkg/DEBUG_GCC5/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll
Then the download is interrupted. I don't understand why this is happening. Just a few days ago it was working and the log was as follows:
...
Updated SBL Performance Table: S1 = 694000000ns, S2 = 2136000000ns, OSL = 38000000ns
Payload entry: 0x008015A8
Jump to payload
Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5) ...
\xFE \x3F \x06 \x59 \xBA HOST connection is successful! ...
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121203): https://edk2.groups.io/g/devel/message/121203
Mute This Topic: https://groups.io/mt/111746873/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 5549 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [edk2-devel] UefiPayloadPkg debugging
2025-03-17 11:01 [edk2-devel] UefiPayloadPkg debugging Stepan via groups.io
@ 2025-03-18 4:20 ` Stepan via groups.io
2025-03-18 5:00 ` Chiu, Chasel via groups.io
0 siblings, 1 reply; 5+ messages in thread
From: Stepan via groups.io @ 2025-03-18 4:20 UTC (permalink / raw)
To: Stepan, devel
[-- Attachment #1.1: Type: text/plain, Size: 5584 bytes --]
Hello EDK2 community,
I found out that it depends on the platform. I work with next changes:
Index: UefiPayloadPkg/UefiPayloadPkg.dsc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc (revision a5ab82f61077e869abfeb1849f7b6e820c7fefd8)
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc (revision 28da9ed468c5025c8bc882109a44d6b64444ebf1)
@@ -26,7 +26,7 @@
FLASH_DEFINITION = UefiPayloadPkg/UefiPayloadPkg.fdf
PCD_DYNAMIC_AS_DYNAMICEX = TRUE
- DEFINE SOURCE_DEBUG_ENABLE = FALSE
+ DEFINE SOURCE_DEBUG_ENABLE = TRUE
DEFINE PS2_KEYBOARD_ENABLE = TRUE
DEFINE RAM_DISK_ENABLE = FALSE
DEFINE SIO_BUS_ENABLE = TRUE
@@ -57,8 +57,8 @@
# ELF: Build UniversalPayload file as UniversalPayload.elf
# FIT: Build UniversalPayload file as UniversalPayload.fit
#
- DEFINE UNIVERSAL_PAYLOAD = TRUE
- #DEFINE UNIVERSAL_PAYLOAD = FALSE
+ #DEFINE UNIVERSAL_PAYLOAD = TRUE
+ DEFINE UNIVERSAL_PAYLOAD = FALSE
DEFINE UNIVERSAL_PAYLOAD_FORMAT = ELF
#
@@ -163,6 +163,8 @@
DEFINE SECURE_BOOT_ENABLE = FALSE
[BuildOptions]
+# GCC:DEBUG_*_*_CC_FLAGS = -g -Od
+# MSFT:DEBUG_*_*_CC_FLAGS = /Od /Oy-
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
!if $(USE_CBMEM_FOR_CONSOLE) == FALSE
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -293,6 +295,7 @@
!if $(SOURCE_DEBUG_ENABLE) == TRUE
PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
!else
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
@@ -306,7 +309,7 @@
!endif
!endif
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
!if $(LOCKBOX_SUPPORT) == TRUE
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
!else
@@ -370,7 +373,10 @@
HobLib|UefiPayloadPkg/Library/PayloadEntryHobLib/HobLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+ !if $(SOURCE_DEBUG_ENABLE) == TRUE
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
+ !endif
!if $(MULTIPLE_DEBUG_PORT_SUPPORT) == TRUE
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
!endif
@@ -453,7 +459,8 @@
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
SmmCpuPlatformHookLib|UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf
SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
I used the command build -a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log for building edk2 for x86_64. Debuuging for this plarform WORKING!!! I attach log below.
I used the command build -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log for building edk2 for x64. Debuuging for this plarform NOT WORKING!!! I attach log below.
The build for the x86 platform failed. I use command build -a IA32 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log. Result is:
Build environment: Linux-6.8.0-52-generic-x86_64-with-glibc2.35
Build start time: 11:15:52, Mar.18 2025
WORKSPACE = /edk
EDK_TOOLS_PATH = /edk/BaseTools
CONF_PATH = /edk/Conf
PYTHON_COMMAND = python3
Processing meta-data Architecture(s) = IA32
.Build target = DEBUG
Toolchain = GCC5
Active Platform = /edk/UefiPayloadPkg/UefiPayloadPkg.dsc
build.py...
: error F001: Module /edk/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf NOT found in DSC file; Is it really a binary module?
- Failed -
Build end time: 11:15:53, Mar.18 2025
Build total time: 00:00:00
I can 't figure out why this is happening.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121204): https://edk2.groups.io/g/devel/message/121204
Mute This Topic: https://groups.io/mt/111746873/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #1.2: Type: text/html, Size: 8243 bytes --]
[-- Attachment #2: x64.debug.log.gz --]
[-- Type: application/gzip, Size: 3814 bytes --]
[-- Attachment #3: x86_64.debug.log.gz --]
[-- Type: application/gzip, Size: 4059 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] UefiPayloadPkg debugging
2025-03-18 4:20 ` Stepan via groups.io
@ 2025-03-18 5:00 ` Chiu, Chasel via groups.io
2025-03-18 5:19 ` Guo Dong via groups.io
0 siblings, 1 reply; 5+ messages in thread
From: Chiu, Chasel via groups.io @ 2025-03-18 5:00 UTC (permalink / raw)
To: devel@edk2.groups.io, radio-fan@mail.ru
[-- Attachment #1: Type: text/plain, Size: 6421 bytes --]
For IA32 build failure, it should be relating to the driver component section is X64 only. We have not verified/supported IA32 build for UefiPayloadPkg DXE phase drivers, but I think X64 build should work as we have platforms using X64 build.
[Components.X64, Components.AARCH64]
…
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Stepan via groups.io
Sent: Monday, March 17, 2025 9:21 PM
To: Stepan <radio-fan@mail.ru>; devel@edk2.groups.io
Subject: [edk2-devel] UefiPayloadPkg debugging
Hello EDK2 community,
I found out that it depends on the platform. I work with next changes:
Index: UefiPayloadPkg/UefiPayloadPkg.dsc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc (revision a5ab82f61077e869abfeb1849f7b6e820c7fefd8)
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc (revision 28da9ed468c5025c8bc882109a44d6b64444ebf1)
@@ -26,7 +26,7 @@
FLASH_DEFINITION = UefiPayloadPkg/UefiPayloadPkg.fdf
PCD_DYNAMIC_AS_DYNAMICEX = TRUE
- DEFINE SOURCE_DEBUG_ENABLE = FALSE
+ DEFINE SOURCE_DEBUG_ENABLE = TRUE
DEFINE PS2_KEYBOARD_ENABLE = TRUE
DEFINE RAM_DISK_ENABLE = FALSE
DEFINE SIO_BUS_ENABLE = TRUE
@@ -57,8 +57,8 @@
# ELF: Build UniversalPayload file as UniversalPayload.elf
# FIT: Build UniversalPayload file as UniversalPayload.fit
#
- DEFINE UNIVERSAL_PAYLOAD = TRUE
- #DEFINE UNIVERSAL_PAYLOAD = FALSE
+ #DEFINE UNIVERSAL_PAYLOAD = TRUE
+ DEFINE UNIVERSAL_PAYLOAD = FALSE
DEFINE UNIVERSAL_PAYLOAD_FORMAT = ELF
#
@@ -163,6 +163,8 @@
DEFINE SECURE_BOOT_ENABLE = FALSE
[BuildOptions]
+# GCC:DEBUG_*_*_CC_FLAGS = -g -Od
+# MSFT:DEBUG_*_*_CC_FLAGS = /Od /Oy-
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
!if $(USE_CBMEM_FOR_CONSOLE) == FALSE
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -293,6 +295,7 @@
!if $(SOURCE_DEBUG_ENABLE) == TRUE
PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
!else
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
@@ -306,7 +309,7 @@
!endif
!endif
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
!if $(LOCKBOX_SUPPORT) == TRUE
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
!else
@@ -370,7 +373,10 @@
HobLib|UefiPayloadPkg/Library/PayloadEntryHobLib/HobLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+ !if $(SOURCE_DEBUG_ENABLE) == TRUE
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
+ !endif
!if $(MULTIPLE_DEBUG_PORT_SUPPORT) == TRUE
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
!endif
@@ -453,7 +459,8 @@
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
SmmCpuPlatformHookLib|UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf
SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
I used the command build -a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log for building edk2 for x86_64. Debuuging for this plarform WORKING!!! I attach log below.
I used the command build -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log for building edk2 for x64. Debuuging for this plarform NOT WORKING!!! I attach log below.
The build for the x86 platform failed. I use command build -a IA32 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log . Result is:
Build environment: Linux-6.8.0-52-generic-x86_64-with-glibc2.35
Build start time: 11:15:52, Mar.18 2025
WORKSPACE = /edk
EDK_TOOLS_PATH = /edk/BaseTools
CONF_PATH = /edk/Conf
PYTHON_COMMAND = python3
Processing meta-data Architecture(s) = IA32
.Build target = DEBUG
Toolchain = GCC5
Active Platform = /edk/UefiPayloadPkg/UefiPayloadPkg.dsc
build.py...
: error F001: Module /edk/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf NOT found in DSC file; Is it really a binary module?
- Failed -
Build end time: 11:15:53, Mar.18 2025
Build total time: 00:00:00
I can't figure out why this is happening.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121205): https://edk2.groups.io/g/devel/message/121205
Mute This Topic: https://groups.io/mt/111746873/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 15032 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [edk2-devel] UefiPayloadPkg debugging
2025-03-18 5:00 ` Chiu, Chasel via groups.io
@ 2025-03-18 5:19 ` Guo Dong via groups.io
2025-03-24 6:05 ` Stepan via groups.io
0 siblings, 1 reply; 5+ messages in thread
From: Guo Dong via groups.io @ 2025-03-18 5:19 UTC (permalink / raw)
To: devel@edk2.groups.io, radio-fan@mail.ru, Chiu, Chasel
[-- Attachment #1: Type: text/plain, Size: 7166 bytes --]
I didn't see the reason to build IA32 for UEFI payload. So all the DXE and SMM modules in the UEFI payload are built with X64 by default.
IA32 support is only for the payload entry driver (in folder UefiPayloadEntry) only. The UEFI payload could support 32bit and 64bit bootloader.
So pure 32bit UEFI payload was not tested/supported.
Thanks,
Guo
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Chiu, Chasel via groups.io <chasel.chiu=intel.com@groups.io>
Sent: Monday, March 17, 2025 10:00 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>; radio-fan@mail.ru <radio-fan@mail.ru>
Subject: Re: [edk2-devel] UefiPayloadPkg debugging
For IA32 build failure, it should be relating to the driver component section is X64 only. We have not verified/supported IA32 build for UefiPayloadPkg DXE phase drivers, but I think X64 build should work as we have platforms using X64 build.
[Components.X64, Components.AARCH64]
…
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Stepan via groups.io
Sent: Monday, March 17, 2025 9:21 PM
To: Stepan <radio-fan@mail.ru>; devel@edk2.groups.io
Subject: [edk2-devel] UefiPayloadPkg debugging
Hello EDK2 community,
I found out that it depends on the platform. I work with next changes:
Index: UefiPayloadPkg/UefiPayloadPkg.dsc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc (revision a5ab82f61077e869abfeb1849f7b6e820c7fefd8)
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc (revision 28da9ed468c5025c8bc882109a44d6b64444ebf1)
@@ -26,7 +26,7 @@
FLASH_DEFINITION = UefiPayloadPkg/UefiPayloadPkg.fdf
PCD_DYNAMIC_AS_DYNAMICEX = TRUE
- DEFINE SOURCE_DEBUG_ENABLE = FALSE
+ DEFINE SOURCE_DEBUG_ENABLE = TRUE
DEFINE PS2_KEYBOARD_ENABLE = TRUE
DEFINE RAM_DISK_ENABLE = FALSE
DEFINE SIO_BUS_ENABLE = TRUE
@@ -57,8 +57,8 @@
# ELF: Build UniversalPayload file as UniversalPayload.elf
# FIT: Build UniversalPayload file as UniversalPayload.fit
#
- DEFINE UNIVERSAL_PAYLOAD = TRUE
- #DEFINE UNIVERSAL_PAYLOAD = FALSE
+ #DEFINE UNIVERSAL_PAYLOAD = TRUE
+ DEFINE UNIVERSAL_PAYLOAD = FALSE
DEFINE UNIVERSAL_PAYLOAD_FORMAT = ELF
#
@@ -163,6 +163,8 @@
DEFINE SECURE_BOOT_ENABLE = FALSE
[BuildOptions]
+# GCC:DEBUG_*_*_CC_FLAGS = -g -Od
+# MSFT:DEBUG_*_*_CC_FLAGS = /Od /Oy-
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
!if $(USE_CBMEM_FOR_CONSOLE) == FALSE
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -293,6 +295,7 @@
!if $(SOURCE_DEBUG_ENABLE) == TRUE
PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
!else
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
@@ -306,7 +309,7 @@
!endif
!endif
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
!if $(LOCKBOX_SUPPORT) == TRUE
LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf
!else
@@ -370,7 +373,10 @@
HobLib|UefiPayloadPkg/Library/PayloadEntryHobLib/HobLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLibNull/DxeHobListLibNull.inf
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+ !if $(SOURCE_DEBUG_ENABLE) == TRUE
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
+ !endif
!if $(MULTIPLE_DEBUG_PORT_SUPPORT) == TRUE
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
!endif
@@ -453,7 +459,8 @@
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
- DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+ DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
SmmCpuPlatformHookLib|UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf
SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
I used the command build -a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log for building edk2 for x86_64. Debuuging for this plarform WORKING!!! I attach log below.
I used the command build -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log for building edk2 for x64. Debuuging for this plarform NOT WORKING!!! I attach log below.
The build for the x86 platform failed. I use command build -a IA32 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 -Y COMPILE_INFO -y BuildReport.log . Result is:
Build environment: Linux-6.8.0-52-generic-x86_64-with-glibc2.35
Build start time: 11:15:52, Mar.18 2025
WORKSPACE = /edk
EDK_TOOLS_PATH = /edk/BaseTools
CONF_PATH = /edk/Conf
PYTHON_COMMAND = python3
Processing meta-data Architecture(s) = IA32
.Build target = DEBUG
Toolchain = GCC5
Active Platform = /edk/UefiPayloadPkg/UefiPayloadPkg.dsc
build.py...
: error F001: Module /edk/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf NOT found in DSC file; Is it really a binary module?
- Failed -
Build end time: 11:15:53, Mar.18 2025
Build total time: 00:00:00
I can't figure out why this is happening.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121206): https://edk2.groups.io/g/devel/message/121206
Mute This Topic: https://groups.io/mt/111746873/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 24041 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [edk2-devel] UefiPayloadPkg debugging
2025-03-18 5:19 ` Guo Dong via groups.io
@ 2025-03-24 6:05 ` Stepan via groups.io
0 siblings, 0 replies; 5+ messages in thread
From: Stepan via groups.io @ 2025-03-24 6:05 UTC (permalink / raw)
To: Guo Dong, devel
[-- Attachment #1: Type: text/plain, Size: 948 bytes --]
Hello,
Hmm, that's weird. Source debugging is working for universal payload, which builded by python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32 -b DEBUG -t GCC5 -D SOURCE_DEBUG_ENABLE=TRUE. But payload, which builded by python UefiPayloadPkg/UniversalPayloadBuild.py -a IA32 -b DEBUG -t GCC5 -D SOURCE_DEBUG_ENABLE=TRUE is not starting.
It works similarly for non-universal load:
build -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 : is not starting
build -a IA32 -a X64 -p UefiPayloadPkg/UefiPayloadPkg.dsc -b DEBUG -t GCC5 : is working with debugging
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121216): https://edk2.groups.io/g/devel/message/121216
Mute This Topic: https://groups.io/mt/111746873/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 1499 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-24 6:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 11:01 [edk2-devel] UefiPayloadPkg debugging Stepan via groups.io
2025-03-18 4:20 ` Stepan via groups.io
2025-03-18 5:00 ` Chiu, Chasel via groups.io
2025-03-18 5:19 ` Guo Dong via groups.io
2025-03-24 6:05 ` Stepan via groups.io
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox