Moss: a Rust Linux-compatible kernel in 26,000 lines of code
Recorded: Nov. 29, 2025, 1:09 a.m.
| Original | Summarized |
GitHub - hexagonal-sun/moss-kernel: Rust Linux-compatible kernel Skip to content Navigation Menu Toggle navigation
Sign in
Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests...
Search Clear
Search syntax tips Provide feedback Include my email address so I can be contacted Cancel Submit feedback Saved searches
Name Query To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up
Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. Dismiss alert hexagonal-sun moss-kernel Public
Notifications
Fork
Star Rust Linux-compatible kernel MIT license 1.4k 49 Branches Tags Activity
Star
Notifications Code Issues Pull requests Discussions Actions Projects Security Uh oh! There was an error while loading. Please reload this page. Insights
Additional navigation options
Code Issues Pull requests Discussions Actions Projects Security Insights
hexagonal-sun/moss-kernel
masterBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History58 Commits.cargo.cargo .github/workflows.github/workflows etcetc libkernellibkernel scriptsscripts srcsrc .gitignore.gitignore Cargo.lockCargo.lock Cargo.tomlCargo.toml LICENSELICENSE README.mdREADME.md build.rsbuild.rs rust-toolchain.tomlrust-toolchain.toml View all filesRepository files navigationREADMEMIT licensemoss moss is a Unix-like, Linux-compatible kernel written in Rust and Aarch64 Full support for aarch64. Full MMU enablement and page table management. Async Core All non-trivial system calls are written as async functions, sleep-able Process Management Full task management including scheduling and task migration via IPIs. VFS & Filesystems Virtual File System with full async abstractions. Ramdisk block device implementation. libkernel & Testing Address Types: Strong typing for VA (Virtual), PA (Physical), and UA Building and Running Basic Linux Syscall Compatibility (Testing through BusyBox). Contributing About Rust Linux-compatible kernel Readme MIT license Uh oh! There was an error while loading. Please reload this page. Activity 1.4k 7 49 Report repository Releases Packages No packages published Contributors Languages Rust Other Footer © 2025 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
The moss-kernel project represents a significant undertaking: a Linux-compatible kernel written entirely in Rust, designed for AArch64 architecture. Developed by hexagonal-sun, the kernel’s core philosophy centers around asynchronous operation, aiming to mitigate common kernel deadlocks through Rust’s strong guarantees. This project meticulously constructs a functional kernel leveraging Rust’s features, including strong typing, ownership, and concurrency primitives. The kernel achieves full MMU enablement, copy-on-write pages, and robust process management, mirroring elements of the Linux kernel while employing a novel asynchronous core. The design explicitly incorporates a modular architecture abstraction layer facilitated by `libkernel`, a utility library that allows for testing kernel logic on a host machine (e.g., x86) before deployment on bare metal. This decoupled architecture, coupled with strong typing for virtual, physical, and user addresses, constitutes a key element of the project's development strategy. Furthermore, the project offers robust container management utilizing VMA (Virtual Memory Area) management, page-based ring buffers, and waker sets. Synchronization primitives like spinlocks, mutexes, condition variables, and per-CPU data structures provide the foundation for its concurrent operations. A comprehensive test suite, numbering over 230 tests, is integrated to validate functionality across diverse architectures, facilitating architecture independent testing via the `libkernel` library. The development process is notably practical, with a strong emphasis on a streamlined build and deployment workflow. Prerequisites include QEMU emulation for AArch64 and dosfstools for VFS creation and the aarch64-none-elf toolchain. The project provides a detailed running guide, incorporating steps to prepare the image, build dependencies, and deploy the kernel via QEMU. The guide encompasses specific instructions for macOS (experimental support) and NixOS. The build process involves downloading, building, and packaging necessary dependencies, culminating in the creation of a VFAT 32 formatted image file named `moss.img`. The project’s roadmap outlines several key areas of development, including improving Linux syscall compatibility (through BusyBox testing), implementing a networking stack (TCP/IP), enhancing scheduler efficiency with task load balancing, and developing a fully read/write filesystem driver (e.g., ext2/4), expanding syscall coverage beyond the initial 49 calls. While currently under active development, the project aims to bolster existing capabilities and extend functionality, furthering the feasibility of a Rust-based Linux kernel. Contributions for developing drivers, porting to x86, or adding new syscalls are welcome. The project is licensed under the MIT License and is presented under the guidance of hexagonal-sun. |