diff --git a/Changelog.md b/Changelog.md index d0bcc6edf59..0ec786bb4e7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -11,6 +11,8 @@ OpenCore Changelog - Fixed assert caused by dependency ordering in OpenDuet - Prevented assert in normal situation when freeing memory above 4GB in OpenDuet - Prevented debug assert reporting that optional Hii protocols are not present in OpenDuet +- Fixed problem loading non-firmware runtime drivers (e.g. OpenRuntime.efi) in OpenDuet +- Resolved issue using NOOPT debugging in OpenDuet #### v0.9.9 - Fixed incorrect warning in ocvalidate diff --git a/Legacy/BootSector/Makefile b/Legacy/BootSector/Makefile index 12f60c3490e..577f56c9df7 100644 --- a/Legacy/BootSector/Makefile +++ b/Legacy/BootSector/Makefile @@ -10,6 +10,10 @@ PRODUCTS64=$(BINDIR)/StartX64_$(PAGE_TABLE).com $(BINDIR)/StartX64_$(PAGE_TABLE_ all: $(PRODUCTS32) $(PRODUCTS64) +IA32: $(PRODUCTS32) + +X64: $(PRODUCTS64) + clean: $(RM) -f $(BINDIR)/*.com diff --git a/OpenCorePkg.dsc b/OpenCorePkg.dsc index be304b49929..d5d157a6357 100755 --- a/OpenCorePkg.dsc +++ b/OpenCorePkg.dsc @@ -406,7 +406,6 @@ gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAlignmentPolicy|0xFFFFFFFF gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRelocTypePolicy|0xFFFFFFFF gEfiMdePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x00000003 - gEfiMdePkgTokenSpaceGuid.PcdUefiImageFormatSupportNonFv|0x01 [PcdsPatchableInModule] gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth|8 diff --git a/OpenDuetPkg.dsc b/OpenDuetPkg.dsc index 60366885052..82021d3cedf 100644 --- a/OpenDuetPkg.dsc +++ b/OpenDuetPkg.dsc @@ -146,8 +146,6 @@ DxeServicesTableLib|MdeModulePkg/Library/DxeCoreDxeServicesTableLib/DxeCoreDxeServicesTableLib.inf UefiBootServicesTableLib|MdeModulePkg/Library/DxeCoreUefiBootServicesTableLib/DxeCoreUefiBootServicesTableLib.inf UefiRuntimeServicesTableLib|MdeModulePkg/Library/DxeCoreUefiRuntimeServicesTableLib/DxeCoreUefiRuntimeServicesTableLib.inf - - gEfiMdePkgTokenSpaceGuid.PcdUefiImageFormatSupportFv|0x03 } MdeModulePkg/Universal/PCD/Dxe/Pcd.inf @@ -182,7 +180,10 @@ MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf OpenCorePkg/Legacy/BootPlatform/SmbiosGenDxe/SmbiosGen.inf +!if $(TARGET) != NOOPT + # We will reuse DEBUG EfiLdr in NOOPT build to keep within allotted 0x10000-0x20000 space. OpenCorePkg/Legacy/BootPlatform/EfiLdr/EfiLdr.inf +!endif OpenCorePkg/Legacy/BootPlatform/BdsDxe/BdsDxe.inf { PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf @@ -290,8 +291,8 @@ gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAllowMisalignedOffset|TRUE [BuildOptions] - MSFT:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline /GS /kernel - MSFT:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline -DMDEPKG_NDEBUG /GS /kernel + MSFT:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline /GS /kernel + MSFT:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline /GS /kernel MSFT:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline -DMDEPKG_NDEBUG /GS /kernel XCODE:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -fno-unwind-tables -O0 -fstack-protector-strong -ftrivial-auto-var-init=pattern @@ -299,9 +300,9 @@ XCODE:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -fno-unwind-tables -flto -Os -DMDEPKG_NDEBUG -fstack-protector-strong -ftrivial-auto-var-init=pattern GCC:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized - GCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized + GCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized GCC:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized CLANGGCC:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized - CLANGGCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized + CLANGGCC:DEBUG_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized CLANGGCC:RELEASE_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 -DMDEPKG_NDEBUG -Wno-unused-but-set-variable -fstack-protector-strong -mstack-protector-guard=global -Wuninitialized diff --git a/OpenDuetPkgDefines.fdf.inc b/OpenDuetPkgDefines.fdf.inc index 013d6467b92..f7487cf5ec5 100644 --- a/OpenDuetPkgDefines.fdf.inc +++ b/OpenDuetPkgDefines.fdf.inc @@ -20,7 +20,7 @@ NumBlocks = 0x8 #GenFv image size 0x80000 !else !if ($(TARGET) == DEBUG) - NumBlocks = 0xd #GenFv image size 0xd0000 + NumBlocks = 0xe #GenFv image size 0xe0000 !else NumBlocks = 0x24 #GenFv image size 0x240000 !endif diff --git a/build_duet.tool b/build_duet.tool index 82ffde0623d..43e984fddaa 100755 --- a/build_duet.tool +++ b/build_duet.tool @@ -36,8 +36,12 @@ imgbuild() { "${BUILD_DIR_ARCH}/DxeIplUe.raw" || exit 1 echo "Generating Loader Image..." - - ImageTool GenImage -c PE -x -b 0x10000 -o "${BUILD_DIR_ARCH}/EfiLoaderRebased.efi" "${BUILD_DIR_ARCH}/EfiLoader.efi" || exit 1 + # Reuse DEBUG EfiLdr in NOOPT build to keep within allotted 0x10000-0x20000 space. + # With this approach, everything after EfiLdr is fully NOOPT, but EfiLdr starts. + # TODO: Look at moving EFILDR_BASE_SEGMENT (see also kBoot2Segment, BASE_ADDR_32) + # to make space for NOOPT loader. + SAFE_LOADER=$(echo "${BUILD_DIR_ARCH}/EfiLoader.efi" | sed -e 's/NOOPT/DEBUG/') + ImageTool GenImage -c PE -x -b 0x10000 -o "${BUILD_DIR_ARCH}/EfiLoaderRebased.efi" "${SAFE_LOADER}" || exit 1 "${FV_TOOLS}/EfiLdrImage" -o "${BUILD_DIR}/FV/Efildr${arch}" \ "${BUILD_DIR_ARCH}/EfiLoaderRebased.efi" "${BUILD_DIR}/FV/DxeIpl${arch}.z" \ @@ -77,7 +81,7 @@ imgbuild() { # Build bootsectors. mkdir -p "${BOOTSECTORS}" || exit 1 cd "${BOOTSECTORS}"/.. || exit 1 - make || exit 1 + make "${arch}" || exit 1 cd - || exit 1 # Concatenate bootsector into the resulting image.