A Minimal Kernel In Swift, Running In QEMU
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Before you orderOffer from Amazon

Get the latest gadgets delivered free with Prime

  • Fast, free delivery on millions of items
  • Prime Video, Amazon Music and more included
  • Member-only deals all year
Start your free Prime trial Free trial for eligible customers · Cancel anytime
As an affiliate, we earn on qualifying purchases.

A developer has built a minimal kernel in Embedded Swift and run it in QEMU on an Apple Silicon machine. The experiment currently initializes a single CPU core, prints a message through QEMU, and then waits; it is a learning project, not a replacement for an operating system.

A developer has reported running a minimal kernel written in Embedded Swift on QEMU’s ARM virtual machine, demonstrating a small program executing without an operating system beneath it. The experimental kernel sets up a stack for the first CPU core, prints a message through QEMU, and then waits indefinitely; its author says the project is intended to explore bare-metal programming, not replace Linux or another operating system.

The project targets QEMU’s aarch64-none-none-elf configuration on an Apple Silicon machine. That target describes a 64-bit ARM system with no operating system or C runtime supplied. Because the processor begins without the setup a normal application expects, a small assembly routine defines the _start entry point, prepares a stack, and calls the Swift function kernel_main.

The assembly also checks which CPU core is running. The report says QEMU can start multiple virtual cores, but this kernel currently lets only the first core proceed; other cores enter a wait loop. The Swift entry function prints “Hello, Embedded Swift” and then loops without returning. The report describes that output as being sent through QEMU, but the supplied material does not give further implementation details for the output path.

Getting the program to link required treating it differently from an ordinary Swift executable. The developer configured the compiler and linker to omit standard libraries and use a custom linker script. Early linking attempts exposed missing putchar and memmove symbols, which the report connects to the absence of a C library on the bare-metal target. The linker also rejected ELF metadata sections until the script was adjusted to place sections explicitly.

At a glance
reportWhen: Project report updated September 28, 20…
The developmentA developer reports running a bare-metal Swift kernel on QEMU, with a recent update changing its Swift-to-C entry-point annotation.

What the QEMU Kernel Shows

The demonstration shows how much infrastructure normally hidden by an operating system is needed before a program can run directly on a machine. Even this limited example needs an entry point, a stack, a target-specific build configuration, linker rules, and a plan for handling multiple CPU cores. Those requirements make the experiment useful as a practical illustration of bare-metal startup, rather than evidence that a production-ready Swift operating system exists.

It also gives Swift developers an example of using Embedded Swift in an environment without the usual operating-system services. The current result is deliberately narrow: a message followed by an infinite wait. It does not establish support for broader kernel functions such as device management, memory allocation, scheduling, or application execution.

Amazon

QEMU ARM virtualization software

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Why Embedded Swift Needs Setup

The author says Embedded Swift is a subset intended for environments without an operating system and the standard library in its usual form. In the report’s initial test, a simple Swift program failed because the installed compiler could not load the Embedded Swift standard library for its target. The author then installed a development toolchain and successfully ran the small test program.

The report cautions that Embedded Swift was experimental and not supported in public Swift releases at the time described, requiring a development toolchain. The bare-metal build then introduced a separate challenge: unlike a regular executable, it could not rely on a C runtime to provide familiar functions or on platform defaults to arrange every linker section. The developer says an earlier kernel experiment, arOS, was undertaken about 10 years before this project.

In an update dated September 28, 2026, the author credited Max Desiatov with noting that Swift’s @c attribute should work in place of @_cdecl for marking a global Swift function as a C function. The author says the post and code were updated accordingly. This is a change to how the Swift entry function is exposed, not a report of new kernel capabilities.

“The goal is obviously not to replace Linux or any other popular kernel, but just to have fun and understand what is required to make a program run without an operating system underneath it.”

— Project author

Amazon

embedded Swift development kit

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Limits of the Current Demonstration

The report establishes a small QEMU demonstration, but it does not describe a general-purpose kernel or show the project running on physical hardware. It also does not specify the full mechanism that routes the printed message through QEMU. Further details about the missing runtime functions, including how they are provided or avoided in the completed build, are not included in the supplied report excerpt.

It remains unclear whether the author plans to add features beyond the current print-and-wait behavior, and no schedule or roadmap is given. The report also does not provide independent testing, performance measurements, or a claim that this setup is ready for use outside experimentation.

Amazon

bare-metal programming tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Further Kernel Work Remains Open

The immediate next step described in the report is modest: the kernel already reaches its Swift entry function, emits its message, and remains running in QEMU. The September 28 update records a code adjustment to use @c for the Swift function exposed to assembly. The supplied material does not announce a further release, feature milestone, or development timetable.

Any expansion would require additional work beyond the demonstrated startup path, including decisions about runtime support, hardware interaction, and how multiple cores should behave. Until the author reports such changes, the confirmed result remains a minimal bare-metal experiment that prints once and waits.

Amazon

Apple Silicon QEMU setup

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What does the Swift kernel currently do?

It starts in QEMU, runs its Swift entry function on the first CPU core, prints a message through QEMU, and then waits indefinitely.

Does this replace Linux or another operating system?

No. The author describes it as a small experiment for learning how software runs without an operating system, not as a replacement for Linux or another kernel.

Why does the project need assembly?

The bare-metal target has no normal startup environment. The assembly defines the _start entry point, sets up a stack, directs secondary cores to wait, and calls the Swift function.

What is Embedded Swift?

In the report, Embedded Swift is described as a Swift subset for environments without an operating system and the standard library in its usual form. The author says the experiment required a development toolchain because the feature was experimental and not supported in public Swift releases at the time.

What changed in the September 2026 update?

The author says the code was updated to use Swift’s @c attribute instead of @_cdecl to expose the Swift function as callable from assembly. The update does not report additional kernel behavior.

Source: hn

HALLOWEEN

Halloween Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

Everything in C is undefined behavior

C programming language is riddled with undefined behavior, affecting code correctness and portability. Experts highlight the pervasive nature of UB and its implications.

Amazon launches 30-minute delivery across the U.S.

Amazon now offers 30-minute delivery across dozens of U.S. cities, expanding ultra-fast shopping options for Prime members and others.

6 Best Desktop Processors for Gaming and Everyday Performance in 2026

Explore the best desktop processors in 2026 for gaming and everyday use, including AMD’s Ryzen lineup and platform considerations.

Undervolting Your GPU for Local Inference: Lower Heat, Same Tokens/sec

Thorsten Meyer AI published a GPU tuning guide linking power limits to lower heat and similar local inference speed, with workload caveats.