Bare metal Go TCP/IP connectivity
June 11, 2026 ยท View on GitHub
This Go package implements TCP/IP connectivity through a generic network
interface to be used with GOOS=tamago as supported by the
TamaGo framework for bare metal Go.
The package bridges generic network device and stack interfaces, which on
GOOS=tamago can be attached to the Go runtime by setting net.SocketFunc to
the interface Socket function.
Support for the following pure Go network stacks is provided:
The following packages provide compatible network devices:
- enet: NXP i.MX ENET Ethernet controllers
- uefi: UEFI Simple Network
- usbnet: Ethernet over NXP i.MX USB through tamago nxp/usb
- vnet: VirtIO network device through tamago virtio
Package documentation
Examples
// TamaGo UEFI Simple Network interface
nic, _ := &x64.UEFI.Boot.GetNetwork{}
// gnet interface with gvisor stack
iface := gnet.Interface{
Stack: NewGVisorStack(1),
}
// gnet interface with lneto stack
iface := gnet.Interface{
Stack: NewLnetoStack(nil),
}
// initialize IP, MAC, Gateway
_ = iface.Init(nic, "10.0.0.1/24", "", "10.0.0.2")
// Go runtime hook
net.SocketFunc = iface.Stack.Socket
UEFI
See go-boot for a full integration example with the UEFI Simple Network Protocol.
VirtIO
See tamago-sev-example or tamago-example for a full integration example.
NXP i.MX ENET/USB
See mx6ullevk and imx8mpevk (ENET) and usbarmory (USB) target support in
tamago-example
for full integration examples.
Authors
Andrea Barisani
andrea@inversepath.com
Andrej Rosano
andrej@inversepath.com
Patricio Whittingslow
graded.sp{at}gmail{dot}com
Documentation
The package API documentation can be found on pkg.go.dev.
For more information about TamaGo see its repository and project wiki.
License
tamago | https://github.com/usbarmory/go-net
Copyright (c) The go-net authors. All Rights Reserved.
These source files are distributed under the BSD-style license found in the LICENSE file.