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.
The Cosmos build pipeline runs NativeAOT codegen, assemble, link and pack a bootable ISO for the Limine bootloader.
Cosmos.Patcher replaces runtime methods at the IL level before NativeAOT compiles them.
Target selected by RuntimeIdentifier: APIC interrupts on x64, GIC on ARM64, GAS assembly on both, MMIO where there is no port I/O.
Strings, collections, generics, threading, Console — compiled by NativeAOT, no JIT, no managed runtime.
Mark-and-sweep GC with precise stack scanning, a preemptive priority-based stride scheduler with lock support, exception handling with unwinding.
TCP and UDP sockets over Cosmos’ own network stack: ARP, IPv4, DHCP and DNS. HTTPS/TLS is on the roadmap.
AHCI/SATA and NVMe drivers, MBR/GPT/EBR partitioning, FAT12/16/32 on a Unix-style VFS.
Double-buffered Canvas API on the UEFI GOP framebuffer (via Limine), keyboard and mouse input.
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!
- Project-Prism/Prism-OS89 starsAn operating system written in C#, Made possible by the cosmos community! #csharp #operating-system #os
- LumaTechnologies/SphereOS74 starsSphereOS - An operating system written in C#, powered by Cosmos. #operating-system
- Ncleardev/NclearOS-241 starsCosmos based Operating System with GUI. #operating-system #os
- Adisol07/SaphireOS25 starsNew operating system #csharp
- ascpixi/cosmos-coroutines22 starsA simple, non-preemptive coroutine scheduler that allows for cooperative multitasking within Cosmos kernels #coroutines #multitasking #csharp
- AAM1075/XenOS15 starsXenOS 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-classic12 starsMirage Desktop Environment (Classic) #csharp #desktop
- DogOSdev/DogOS9 starsA 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.
Built by the community.
Every author in the Cosmos history — 189 people across both generations, from the 2007 proof of concept to Gen3.
Find us, file issues, jump in.
Cosmos is open source and community-led. Pull requests welcome, start with the priority board.
