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.
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.
- 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.
Featured projects
Don’t know where to start? See these projects to learn Cosmos by example and for inspiration!
- valentinbreiz/nativeaot-patcher120POC of CosmosOS gen3 #dotnet #nativeaot #kernel
- Project-Prism/Prism-OS89An operating system written in C#, Made possible by the cosmos community! #csharp #operating-system #os
- LumaTechnologies/SphereOS74SphereOS - An operating system written in C#, powered by Cosmos. #operating-system
- Ncleardev/NclearOS-241Cosmos based Operating System with GUI. #operating-system #os
- Adisol07/SaphireOS25New operating system #csharp
- ascpixi/cosmos-coroutines22A simple, non-preemptive coroutine scheduler that allows for cooperative multitasking within Cosmos kernels #coroutines #multitasking #csharp
- AAM1075/XenOS15XenOS is an operating system written in .NET C# and is made possible by the Cosmos OS project. #c-sharp #dotnet #operating-system
- mirage-desktop/Mirage-classic12Mirage Desktop Environment (Classic) #csharp #desktop
- DogOSdev/DogOS9A Operating System made with Cosmos and in C#. #csharp #dotnet
Eighteen years of C# on the metal.
Cosmos has had three lives. Gen3 is the largest re-foundation since the project began.
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.
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.
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.
Find us, file issues, jump in.
Cosmos is open source and community-led. Pull requests welcome, start with the priority board.
