Skip to content

Migrating to GOOS=custom

Andrea Barisani edited this page Nov 11, 2026 · 8 revisions

The Go distribution changes created for GOOS=tamago, and required by the tamago package, are part of an upstream proposal and described in its design document.

Important

These changes will be part of the future major release of tamago-go and tamago, regardless of upstream adoption.

The following Go distribution changes, against the current implementation, are introduced by the proposal:

GOOS=tamago GOOS=custom
GOOSPKG points to module path GOOSPKG points to package path
runtime/goos internal/runtime/goospkg
-ldflags "-T address" GOOSPKG TextAddr uintpr (or ldflags)
runtime/goos.Hwinit0 internal/runtime/goospkg.InitHW0
runtime/goos.Hwinit1 internal/runtime/goospkg.InitHW1
runtime/goos.RamStart removed
runtime/goos.RamSize removed
runtime/goos.RamStackOffset removed
runtime.MemRegion removed
runtime.TextRegion removed
runtime.CallOnG0 internal/runtime/goospkg·SystemStack
runtime.Printk internal/runtime/goospkg.WriteConsole
os/signal.Relay internal/runtime/goospkg.Relay

The following tamago library changes, against the current implementation, are implemented to follow the proposal:

GOOS=tamago GOOS=custom
linkhwinit0 (build tag) linkinithw0 (build tag)
linkhwinit1 (build tag) linkinithw1 (build tag)
runtime/goos.RamStart mem.RamStart
runtime/goos.RamSize mem.RamSize
runtime/goos.RamStackOffset mem.RamStackOffset
runtime.MemRegion mem.Region
runtime.TextRegion mem.Text
(*CPU).GetTime (*CPU).GetTime(monotonic bool)
runtime.CPU (*CPU).Name

All changes are implemented in the following repositories:

Platform support packages

Processor support packages

Applications

External drivers

Clone this wiki locally