Skip to content

valentinbreiz/nativeaot-patcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,526 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Voted French law aimed at criminalizing free culture. No to authoritarianism! No to fascism! Support your local sound systems!

🇫🇷 French citizens — SIGN THE PETITION

Cosmos gen3

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.

Status

.NET Tests Kernel Tests Release Gen3 Release Progress

Why gen3?

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.

Features

  • 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

Related resources

Contributors

Thanks to everyone who has contributed code, reviews, plugs, and bug reports:

See the live list on the Contributors page.

License

MIT — Copyright (c) 2024 Kaleb McGhie (zarlo) and contributors.

About

POC of CosmosOS gen3

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors