Voted French law aimed at criminalizing free culture. No to authoritarianism! No to fascism! Support your local sound systems!
🇫🇷 French citizens — SIGN THE PETITION
A bare-metal C# kernel framework built on NativeAOT. Cosmos gen3 is the next generation of the Cosmos operating system project, replacing the IL2CPU transpiler with the official .NET ahead-of-time compiler. The result is an ordinary dotnet build that produces a bootable kernel ELF for x64 or ARM64, linked with an integrated runtime, plugged with the Cosmos plug system, and packaged into an ISO with the Limine bootloader.
Originally based on Zarlo's NativeAOT patcher. See CosmosOS/Cosmos#3088 for the design discussion behind the gen3 effort.
Cosmos gen2 (the current public Cosmos OS) compiles C# IL to x86 assembly through IL2CPU, a custom transpiler. IL2CPU is powerful but maintains its own JIT-like backend separate from the .NET ecosystem. Gen3 replaces it with NativeAOT, the official .NET ahead-of-time toolchain, so kernels benefit from the same optimizer used in the wider .NET ecosystem and stay aligned with upstream as it evolves. This also makes it possible to support modern .NET features and additional architectures (currently ARM64 and RISC-V in the future) without re-implementing them in the toolchain.
- NativeAOT compilation
- x64 and ARM64
- Limine boot protocol
- Cosmos plug system
- Native runtime stubs
- .NET runtime support (String, Collections, List, Dictionary, Math, Console, DateTime, Random, BitOperations, threading, generics, reflection basics)
- Mark-and-sweep GC
- Priority-based stride scheduler
- Exception handling
- Interrupts (APIC on x64, GIC on ARM64)
- ACPI (via LAI)
- PCI and MMIO drivers
- UART serial
- UEFI GOP framebuffer graphics
- Keyboard and mouse input
- Network stack
- Timer / clock
- Documentation site
- Installation Guide
- Dev Container Setup
- Kernel Compilation Steps
- Debugging with VS Code and QEMU
- Kernel Project Layout
- Coding Guidelines
- Plugs
- Garbage Collector
- Testing
- Cosmos.Build.Asm, .CC, .Patcher, .Ilc
- Cosmos Gen3: The NativeAOT Era and the End of IL2CPU?
- NativeAOT Developer Workflow
- NativeAOT Limitations
- Limine Boot Protocol
Thanks to everyone who has contributed code, reviews, plugs, and bug reports:
- @zarlo
- @valentinbreiz
- @Guillermo-Santos
- @kumja1
- @AzureianGH
- @warquys
- @ascpixi
- @Demiomad
- @ilobilo
- @spectradevv
- All Cosmos gen2 contributors
See the live list on the Contributors page.
MIT — Copyright (c) 2024 Kaleb McGhie (zarlo) and contributors.