Skip to content

UEFI target groundwork: add device/uefi and device/amd64#5466

Open
sparques wants to merge 1 commit into
tinygo-org:devfrom
sparques:pr/device-uefi
Open

UEFI target groundwork: add device/uefi and device/amd64#5466
sparques wants to merge 1 commit into
tinygo-org:devfrom
sparques:pr/device-uefi

Conversation

@sparques

Copy link
Copy Markdown
Contributor

Split from https://github.com/tinygo-org/tinygo/pull//5452

This pr adds the device/uefi and device/amd64 packages.

UEFI definitions and tables were pulled directly from the UEFI spec: https://uefi.org/specs/UEFI/2.11/

  • Adds basic UEFI type definitions, table layouts, boot/runtime service structs, EFI status constants, and status-to-error mapping in uefi/efidef.go, uefi/efistatus.go, and uefi/tables.go.
  • Adds amd64 assembly trampolines for calling UEFI functions with 0-10 arguments using the UEFI/MS x64 calling convention in uefi/asm_amd64.S, exposed through uefi/call.go.
  • Adds UEFI initialization/access helpers for the system table, boot services, and image handle in uefi/util.go.
  • Adds simple text output protocol bindings plus io.Writer-style console/stderr wrappers in uefi/simple_text_out.go and uefi/text_output.go.
  • Adds UTF-8/UTF-16 CHAR16 conversion helpers in uefi/char16.go. (This one is weird, but I wanted to keep all the UEFI weirdness contained in the the uefi package)
  • Adds TSC-based timing support for UEFI, including CPU pause/read-TSC helpers and TSC frequency detection/calibration via CPUID or a UEFI timer event in amd64/cpu.go, amd64/cpu_amd64.S, uefi/arch_x86.go, and uefi/clock.go.

This is purely additive so nothing existing should be affected by this PR.

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.

1 participant