Skip to content

Add UEFI support for amd64 and arm64 platforms.#5241

Open
cclerget wants to merge 1 commit intotinygo-org:devfrom
ciq-research:uefi-amd64-arm64
Open

Add UEFI support for amd64 and arm64 platforms.#5241
cclerget wants to merge 1 commit intotinygo-org:devfrom
ciq-research:uefi-amd64-arm64

Conversation

@cclerget
Copy link
Copy Markdown

@cclerget cclerget commented Mar 5, 2026

Some decisions points:

  • no external libc dependency, builtin functions replaced by Go equivalent (runtime_minimal_libc.go)
  • assembly efi_main entrypoint as assembly stub is required for sbat and few symbols anyway
  • a default sbat section (required for Linux shim secure boot)
  • dedicated rand reader in crypto/rand for EFI as it doesn't fit well with the generic machine interface
  • the timer calibration is deliberately simple but hopefully good enough for EFI purpose
  • no heap grow support, just get the biggest memory region available

Inspired by #3996 and essentially with Claude Code assistance to be totally transparent.

@cclerget cclerget force-pushed the uefi-amd64-arm64 branch 5 times, most recently from 6485e53 to fbd4bd3 Compare March 6, 2026 16:20
@cclerget cclerget changed the base branch from release to dev March 26, 2026 15:05
@cclerget cclerget force-pushed the uefi-amd64-arm64 branch 3 times, most recently from 075c40f to 38cf7b7 Compare March 26, 2026 15:21
@cclerget cclerget changed the title Add EFI support for amd64 and arm64 platforms. Add UEFI support for amd64 and arm64 platforms. Mar 26, 2026
@cclerget
Copy link
Copy Markdown
Author

cclerget commented Apr 1, 2026

Now target dev branch. Any chance to get some feedbacks from maintainers?

Some decisions points:
- no external libc dependency, builtin functions replaced by Go equivalent (runtime_minimal_libc.go)
- assembly efi_main entrypoint as assembly stub is required for sbat and few symbols anyway
- a default sbat section (required for Linux shim secure boot)
- dedicated rand reader in crypto/rand for EFI as it doesn't fit well with the generic machine interface
- the timer calibration is deliberately simple but hopefully good enough for EFI purpose
- no heap grow support, just get the biggest memory region available
// Handle special scan codes (arrow keys, function keys, etc.)
if key.ScanCode != ScanNull {
var seq []byte
switch key.ScanCode {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be a lookup table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants