Can Go Power a Real Operating System? Pros, Cons, and Real-World Attempts
This article examines why C has long dominated operating‑system development, evaluates the advantages and limitations of using Go for OS kernels, and reviews concrete projects like the Biscuit OS that attempt to build a usable system with Go.
This piece summarizes the JetBrains GoLand blog post “OS in Go? Why Not?” which asks whether a high‑level language such as Go can replace C for operating‑system development.
Operating systems consist of a kernel that directly interacts with hardware and user‑space components such as GUIs and applications. The kernel is almost always written in C or assembly because those languages give direct memory control, lack abstraction, require no runtime, and are highly portable.
High‑level languages bring attractive features: Go offers type safety, built‑in error handling, and native concurrency primitives, which could simplify OS development.
Type safety reduces certain classes of bugs.
Concurrency is easier thanks to goroutines and channels.
Error handling is more structured than in C.
However, Go also has significant drawbacks for kernel work. Its garbage collector must be carefully avoided, otherwise latency spikes (e.g., mouse lag) can occur during interrupt handling. Go’s runtime is large and cannot run directly on bare metal; even TinyGo, which compiles Go to bare‑metal code, supports only a few architectures compared with C’s near‑universal reach.
Consequently, building a non‑toy, multi‑architecture OS with full device support and POSIX compliance in Go is extremely challenging.
One concrete effort is the Biscuit operating system, a Go‑based OS targeting 64‑bit x86. Biscuit uses a modified Go 1.10 runtime with additional assembly for system‑call handling and interrupt entry/exit. It provides a POSIX interface for user processes, supports fork, exec, and core file‑system calls, and includes a TCP/IP stack and driver for an Intel PCI‑Express Ethernet NIC, allowing many Linux C programs to run unchanged.
Despite these achievements, Biscuit lacks essential features such as scheduling priorities, paging or disk swapping, and security mechanisms like user accounts, ACLs, and address‑space randomization.
For further reading, see the original blog post:
https://blog.jetbrains.com/go/2023/05/16/os-in-go-why-not/
Go Development Architecture Practice
Daily sharing of Golang-related technical articles, practical resources, language news, tutorials, real-world projects, and more. Looking forward to growing together. Let's go!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
