Skip to content

Commit

Permalink
Project update.
Browse files Browse the repository at this point in the history
  • Loading branch information
imbushuo committed Mar 31, 2018
1 parent b04ce29 commit 25470b8
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 40 deletions.
63 changes: 29 additions & 34 deletions Boot Shim.sln
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BootShim", "contrib\msvc\uefi-simple.vcxproj", "{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}"
ProjectSection(ProjectDependencies) = postProject
{3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gnu-efi", "contrib\msvc\gnu-efi.vcxproj", "{3135D563-9596-4584-9ED6-616ADEC52974}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|arm = Debug|arm
Release|arm = Release|arm
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.ActiveCfg = Debug|ARM
{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.Build.0 = Debug|ARM
{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|arm.ActiveCfg = Release|ARM
{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|arm.Build.0 = Release|ARM
{3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.ActiveCfg = Debug|ARM
{3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.Build.0 = Debug|ARM
{3135D563-9596-4584-9ED6-616ADEC52974}.Release|arm.ActiveCfg = Release|ARM
{3135D563-9596-4584-9ED6-616ADEC52974}.Release|arm.Build.0 = Release|ARM
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {376E6530-5878-4CF4-AFB7-123F799056A2}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BootShim", "contrib\msvc\uefi-simple.vcxproj", "{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}"
ProjectSection(ProjectDependencies) = postProject
{3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gnu-efi", "contrib\msvc\gnu-efi.vcxproj", "{3135D563-9596-4584-9ED6-616ADEC52974}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|arm = Debug|arm
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.ActiveCfg = Debug|ARM
{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.Build.0 = Debug|ARM
{3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.ActiveCfg = Debug|ARM
{3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.Build.0 = Debug|ARM
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {376E6530-5878-4CF4-AFB7-123F799056A2}
EndGlobalSection
EndGlobal
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Or, if using a UI client (such as TortoiseGit) by selecting _Submodule Update_ i

## Compilation and testing

Only Visual Studio is supported in this branch.
Only Visual Studio is supported in this branch. Do not use `Release` mode, it won't work.

I used a well-known certificate from Windows Kits to sign the binary. You can replace with yours.

## Visual Studio 2017 and ARM support

Expand All @@ -38,8 +40,14 @@ the default _Workloads_ screen:

## ELF requirements

Only single `LOAD` section in ELF64 files will be recognized, it must has physical address
and virtual address matched (EFI identity mapping), memory size and file size must match.
Additionaly, entry point and physical address must match.
- There must be a LOAD section has p_paddr and p_vaddr matches program entry point address (e_entry).
- LOAD section must have p_paddr equals to p_vaddr (identity mapping requirements).
- LOAD section must reside in device's memory region. That means p_paddr must larger or equal (not likely) to
device's memory base, and p_addr + p_memsz must not go out of device's memory region.
- LOAD section must have p_memsz equals to p_filesz.
- Only first LOAD section that meets these requirements will be loaded into memory.
- e_machine must be EM_ARM.
- e_type must be ET_EXEC.
- Has name of emmc_appsboot.mbn in a firmware-recognized partition (it will try all partitions and use the first one available)

Little Kernel (aboot) signed variants meet these requirements.
2 changes: 1 addition & 1 deletion src/ARM/ProcessorSupport.asm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ArmDeInitialize
dsb
isb

; Invalidates I-Cache
; Invalidate I-Cache
mcr p15, 0, R0, c7, c5, 0 ; Invalidate entire instruction cache
dsb
isb
Expand Down
2 changes: 1 addition & 1 deletion src/EFIApp.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
/* Jump to LOAD section entry point and never returns */
Print(L"\nJump to address 0x%x\n", lk_elf32_phdr->p_paddr);

#if _DEBUG
#if _DEBUG_INSPECT_
gBS->Stall(SECONDS_TO_MICROSECONDS(5));
#endif
JumpToAddress(ImageHandle, lk_elf32_phdr->p_paddr);
Expand Down

0 comments on commit 25470b8

Please sign in to comment.