Pr/minimal uefi target support#5452
Open
sparques wants to merge 23 commits into
Open
Conversation
Contributor
Author
|
@deadprogram, I do have a lot more features implemented like text input, graphics output, time functions, etc, but this is as small as I could make the diff and still produce an executable .efi file. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR adds a minimal
uefi-amd64target to TinyGo.The intent is to land the smallest useful slice of UEFI support first:
uefi-amd64ld.lldThis PR does not try to upstream the larger protocol surface from the previous UEFI branch. It is intentionally limited
to getting a basic UEFI application built and run as a TinyGo baremetal target.
What this adds
targets/uefi-amd64.jsonld.lldhandling without a UEFI-specific builder special case
device/uefisupport for:efi_mainentryAllocatePagesexamples/uefi-exitas a simple regression-style smoke exampleWhat this does not add
This PR intentionally leaves out higher-level UEFI features, including:
Those can be added in follow-up PRs once the target itself is established.
Design notes
TinyGo baremetal targets commonly use
goos: "linux"for runtime selection, and this target follows that existingconvention.
The unusual part of UEFI is not the runtime model, but the output format: the target must produce a valid PE/COFF image. The linker changes here keep the working
ld.lld-based approach, but move it behind a generic target property instead of a UEFI-specific special case in the builder.The runtime in this PR is intentionally minimal:
gc=leakingscheduler=noneThat keeps the initial target small and reduces the number of moving pieces needed for first upstream support.
Testing
Built successfully with: