Go Runtime: Proposal for OS-Free Execution

2025-05-07
Go Runtime: Proposal for OS-Free Execution

This proposal suggests adding a new GOOS target (e.g., GOOS=none) to the Go runtime, enabling Go programs to execute under application-defined exit functions instead of relying on arbitrary OS syscalls. This allows freestanding execution without direct OS support, a capability already implemented in the TamaGo project. The proposal advocates for upstream inclusion. Go applications built with GOOS=none would run on bare metal; all necessary support comes from the Go runtime and external Go driver packages. Key functions like CPU initialization, hardware initialization, standard output, random number generation, and system time retrieval must be defined. This significantly expands Go's applicability to environments like embedded systems, virtual machines, and UEFI.