GEN3NativeAOT release · v3.0.79

Write an OS in modern C#.
Compiled ahead-of-time.
Runs on every hardware.

Cosmos is an open-source C# operating system framework. Author your kernel in C# 14, compile it with NativeAOT, and boot it on x64 or ARM64, no JIT, no managed runtime.

// what's inside

Everything you need to boot C# on bare metal.

Gen3 replaces IL2CPU with the official .NET toolchain. Everything above it: GC, scheduler, drivers, network, filesystem is C# you can read, plug or replace.

C# 14.NET 10NativeAOTLimine
  • builddotnet build → bootable ISO

    The Cosmos build pipeline runs NativeAOT codegen, assemble, link and pack a bootable ISO for the Limine bootloader.

  • plugsIL patching with Mono.Cecil

    Cosmos.Patcher replaces runtime methods at the IL level before NativeAOT compiles them.

  • archx64 · ARM64 — RISC-V planned

    Target selected by RuntimeIdentifier: APIC interrupts on x64, GIC on ARM64, GAS assembly on both, MMIO where there is no port I/O.

  • bclthe real .NET BCL

    Strings, collections, generics, threading, Console — compiled by NativeAOT, no JIT, no managed runtime.

  • kernelGC · scheduler · exceptions

    Mark-and-sweep GC with precise stack scanning, a preemptive priority-based stride scheduler with lock support, exception handling with unwinding.

  • netSystem.Net.Sockets

    TCP and UDP sockets over Cosmos’ own network stack: ARP, IPv4, DHCP and DNS. HTTPS/TLS is on the roadmap.

  • diskSystem.IO down to the disk

    AHCI/SATA and NVMe drivers, MBR/GPT/EBR partitioning, FAT12/16/32 on a Unix-style VFS.

  • gfxCanvas · input

    Double-buffered Canvas API on the UEFI GOP framebuffer (via Limine), keyboard and mouse input.

  • platACPI · UART

    ACPI support through the LAI library, plus UART serial for logging and debugging the kernel.

// three generations

Eighteen years of C# on the metal.

Cosmos has had three lives. Gen3 is the largest re-foundation since the project began.

  1. Gen12007

    The proof.

    Original Cosmos. Proof that you could compile C# down to something that boots on bare metal. A small project with a big idea.

  2. Gen22010s — 2024

    IL2CPU era.

    A custom IL-to-x86 compiler, built and maintained by the community for over a decade. IL2CPU translated .NET bytecode straight to assembly, and powered hobby OSes for years.

  3. Gen3Today

    NativeAOT.

    We retired 15 years of custom compiler work and stood on the shoulders of NativeAOT. Cosmos now patches .NET's official AOT pipeline at the IL level, modern language features, faster builds, less code to maintain.

// the people

Built by the community.

Pulled live from the Cosmos (Gen2) and nativeaot-patcher (Gen3) repos. Click to visit a profile.