Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uefi format #54

Merged
merged 38 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1612af7
[WIP] BaseTools: Support UE generation
mhaeuser May 1, 2023
7212f8c
[WIP] Support UE generation and consumption
mhaeuser Jun 3, 2023
0b07137
MdePkg/UeImage: Fix chained UE reloc member order
mhaeuser Jul 6, 2023
0057503
MdePkg/UeImage: Update documentation
mhaeuser Jul 14, 2023
17776c5
MdePkg/UeImage: Remove support for SAL drivers
mhaeuser Jul 17, 2023
fa96f78
OvmfPkg: Fixed compilation and Windows 10 boot.
Jul 24, 2023
a03960f
Build: Switched to uefi-format OC branch.
Jul 24, 2023
0ad0b20
MdeModulePkg/Core: Fixed code style.
Aug 31, 2023
bbf9af4
OvmfPkg, ArmVirtPkg: Switched DXE CORE to UE format.
Sep 6, 2023
51b1872
BaseTools, MdeModulePkg: Fixed code style.
Sep 6, 2023
3af6005
MdePkg/Library/BaseUeImageLib: Fixed Windows 10 BlueScreen issue for …
Sep 7, 2023
b8664d5
BaseTools, BaseUeImageLib: Added support for 32-bit chaining relocati…
Sep 11, 2023
f518fc7
OvmfPkg: Fixed IA32 NOOPT compilation.
Sep 11, 2023
9987179
BaseUeImageLib: Added support for Runtime chaining relocs.
Sep 12, 2023
e086a71
BaseUeImageLib: Fixed buggy alignment in unchaining process.
Sep 18, 2023
1773652
OvmfPkg: Increased SECFV_SIZE
Sep 18, 2023
ff84337
ImageTool, BaseUeImageLib:
Sep 18, 2023
b95e7da
BaseUeImageLib: Refactored out unused code.
Sep 29, 2023
62ecb7b
UE: Added support for XIP.
Oct 3, 2023
c8bca3f
OvmfPkg: Switched SEC to UE format.
Oct 3, 2023
be20192
GenFv: Fixed corruption of FFS file after rebasing.
Oct 6, 2023
caa02bc
ArmVirtPkg: Switched SEC to UE format.
Oct 9, 2023
743edca
OvmfPkg, ArmVirtPkg: Switched PEI to UE format.
Oct 9, 2023
304fce8
MdeModulePkg: Added EFI_PEI_LOAD_FILE_WITH_HOB_PPI
Oct 12, 2023
e03fe52
UE: Added support for relocatable XIP images.
Oct 17, 2023
4384b4f
Build: Upgraded OpenCorePkg.
Oct 17, 2023
757ca17
UE: Added FIXME comments.
Oct 24, 2023
e1a1b7c
UE: Made UE the only supported format outside FVs.
Oct 27, 2023
c49ecd1
OvmfPkg: Returned PE32 format for UEFI_DRIVER.BINARY
Nov 3, 2023
63380a3
BaseTools: Fixed '-D EDK2_REDUCE_FW_SIZE' build option.
Nov 3, 2023
add62b9
MdeModulePkg: Added PROTECT_IF_ALIGNED_ELSE_DISALLOW option for PcdIm…
Nov 6, 2023
761db89
ArmVirtPkg: Returned PE32 format for UEFI_DRIVER.BINARY
Nov 13, 2023
bf305a8
Various refactoring.
Nov 13, 2023
53240ed
SecurePE: Defined new PcdImageProtectionPolicy.
Nov 16, 2023
3c9e1b6
Build: Upgraded OpenCorePkg.
Nov 16, 2023
36430a3
Core/Dxe/Image: Fixed error handling.
Nov 20, 2023
c47320c
BaseUefiImageLib: Removed superfluous returns.
Nov 22, 2023
42c6407
Build: Upgraded OpenCorePkg.
Nov 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ GetImageContext (
EFI_COMMON_SECTION_HEADER *Section;
VOID *EfiImage;

Section = (EFI_COMMON_SECTION_HEADER *)(FfsHeader + 1);
Section = (EFI_COMMON_SECTION_HEADER *)(FfsHeader + 1);
SectionLength = 0;
SectionSize = *(UINT32 *)(FfsHeader->Size) & 0x00FFFFFF;
SectionSize -= sizeof (EFI_FFS_FILE_HEADER);
ParsedLength = 0;
EfiImage = NULL;
SectionSize = *(UINT32 *)(FfsHeader->Size) & 0x00FFFFFF;
SectionSize -= sizeof (EFI_FFS_FILE_HEADER);
ParsedLength = 0;
EfiImage = NULL;

while (ParsedLength < SectionSize) {
//
Expand Down Expand Up @@ -218,7 +218,8 @@ GetImageContext (
ImageContext,
EfiImage,
SectionLength - sizeof (*Section),
UEFI_IMAGE_SOURCE_FV
UEFI_IMAGE_SOURCE_FV,
UefiImageOriginFv
);
if (!EFI_ERROR(Status)) {
Status = UefiImageLoadImageInplace( ImageContext);
Expand Down
6 changes: 0 additions & 6 deletions ArmVirtPkg/ArmVirt.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|20
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0

#
# Enable strict image permissions for all images. (This applies
# only to images that were built with >= 4 KB section alignment.)
#
gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy|0x3

#
# Enable NX memory protection for all non-code regions, including OEM and OS
# reserved ones, with the exception of LoaderData regions, of which OS loaders
Expand Down
52 changes: 26 additions & 26 deletions ArmVirtPkg/ArmVirtRules.fdf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,61 +35,61 @@
############################################################################

[Rule.Common.SEC]
FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED FIXED {
PE32 PE32 Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
FILE SEC = $(NAMED_GUID) {
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
}

[Rule.Common.SEC.SELF_RELOC]
FILE SEC = $(NAMED_GUID) {
PE32 PE32 Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
}

[Rule.Common.PEI_CORE]
FILE PEI_CORE = $(NAMED_GUID) FIXED {
PE32 PE32 Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING ="$(MODULE_NAME)" Optional
FILE PEI_CORE = $(NAMED_GUID) {
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
}

[Rule.Common.PEIM]
FILE PEIM = $(NAMED_GUID) FIXED {
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
PE32 PE32 Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
FILE PEIM = $(NAMED_GUID) {
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
}

[Rule.Common.DXE_CORE]
FILE DXE_CORE = $(NAMED_GUID) {
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
}

[Rule.Common.UEFI_DRIVER]
FILE DRIVER = $(NAMED_GUID) {
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
}

[Rule.Common.DXE_DRIVER]
FILE DRIVER = $(NAMED_GUID) {
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
RAW ACPI Optional |.acpi
RAW ASL Optional |.aml
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
RAW ACPI Optional |.acpi
RAW ASL Optional |.aml
}

[Rule.Common.DXE_RUNTIME_DRIVER]
FILE DRIVER = $(NAMED_GUID) {
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
}

[Rule.Common.UEFI_APPLICATION]
FILE APPLICATION = $(NAMED_GUID) {
UI STRING ="$(MODULE_NAME)" Optional
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
UE UE $(INF_OUTPUT)/$(MODULE_NAME).efi
}

[Rule.Common.UEFI_DRIVER.BINARY]
Expand All @@ -102,7 +102,7 @@

[Rule.Common.UEFI_APPLICATION.BINARY]
FILE APPLICATION = $(NAMED_GUID) {
PE32 PE32 |.efi
UE UE |.efi
UI STRING="$(MODULE_NAME)" Optional
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}
Expand Down
3 changes: 2 additions & 1 deletion ArmVirtPkg/PrePi/PrePi.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ RelocateUefiImage (
&ImageContext,
SectionData,
SectionSize,
UEFI_IMAGE_SOURCE_FV
UEFI_IMAGE_SOURCE_FV,
UefiImageOriginFv
);
ASSERT_RETURN_ERROR (Status);

Expand Down
4 changes: 4 additions & 0 deletions BaseTools/ImageTool/DynamicBuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include "ImageTool.h"
#include "DynamicBuffer.h"

#ifndef IMAGE_TOOL_DYNAMIC_BUFFER_GROWTH
#define IMAGE_TOOL_DYNAMIC_BUFFER_GROWTH 0x1000
#endif // IMAGE_TOOL_DYNAMIC_BUFFER_GROWTH

void
ImageToolBufferInit (
Expand Down Expand Up @@ -186,9 +188,11 @@ ImageToolBufferDump (
void *Data;
uint32_t DataSize;

// LCOV_EXCL_START
if (Buffer->Memory == NULL) {
return NULL;
}
// LCOV_EXCL_STOP

DataSize = ImageToolBufferGetSize (Buffer);

Expand Down
9 changes: 5 additions & 4 deletions BaseTools/ImageTool/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
PROJECT = ImageTool
PRODUCT = $(PROJECT)$(INFIX)$(SUFFIX)
OBJS = $(PROJECT).o
OBJS += Image.o UefiImageScan.o PeEmit32.o PeEmit64.o PeEmitCommon.o PeScan.o ElfScan32.o ElfScan64.o ElfScanCommon.o BinEmit.o ImageToolEmit.o
OBJS += UefiImageExtraActionLib.o
OBJS += Image.o UefiImageScan.o UeEmit.o UeScan.o PeEmit32.o PeEmit64.o PeEmitCommon.o PeScan.o ElfScan32.o ElfScan64.o ElfScanCommon.o BinEmit.o ImageToolEmit.o
OBJS += UeImageLib.o UefiImageExtraActionLib.o
OBJS += PeCoffInit.o PeCoffInfo.o PeCoffLoad.o PeCoffRelocate.o PeCoffHii.o PeCoffDebug.o PeCoffHash.o
OBJS += PeSupport.o UefiImageLib.o CommonSupport.o DynamicBuffer.o
OBJS += PeSupport.o UeSupport.o UefiImageLib.o CommonSupport.o DynamicBuffer.o

WERROR = 1
DEBUG = 1
Expand All @@ -20,7 +20,8 @@ UDK_PATH = ../..

VPATH += ../../MdePkg/Library/BasePeCoffLib2:$\
../../MdePkg/Library/BaseUefiImageExtraActionLibNull:$\
../../MdePkg/Library/BaseUefiImageLib
../../MdePkg/Library/BaseUefiImageLib:$\
../../MdePkg/Library/BaseUeImageLib

include $(OC_USER)/User/Makefile

Expand Down
Loading