diff --git a/OpenDuetPkg.dsc b/OpenDuetPkg.dsc index 3267f605..82021d3c 100644 --- a/OpenDuetPkg.dsc +++ b/OpenDuetPkg.dsc @@ -180,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 diff --git a/build_duet.tool b/build_duet.tool index 309e7e56..e3cc2c3b 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" \