Moss:一个与Linux兼容的Rust异步内核,三个月后
你好!<p>三个月前,我分享了一个我一直在进行的项目:moss,一个兼容Linux的内核,使用Rust和AArch64汇编语言编写。自那时以来,它已经跨越了一个相当重要的里程碑,我想分享一下更新。现在它可以启动一个动态链接的Arch Linux aarch64用户空间(ext4 ramdisk),并以/bin/bash作为初始化进程。<p>过去几个月的一些主要新增功能:<p>- 支持ptrace(足以在Arch二进制文件上运行strace)
- 扩展的ELF支持:静态、静态PIE、动态和动态PIE
- 动态链接的glibc二进制文件现在可以执行
- /proc支持,足以运行ps和top
- 作业控制和信号传递(后台任务,SIGSTOP/SIGCONT等)
- 内核动态分配的slab分配器(通过global_allocator连接)
- devfs、tmpfs和procfs的实现
- 完整的SMP启动和任务迁移,使用EEVDF调度器<p>该内核目前实现了105个Linux系统调用,并可以在QEMU以及多个ARM64开发板(如Pi 4、Jetson Nano、Kria、i.MX8等)上运行。<p>该项目继续探索在Rust中,基于async/await驱动的Linux兼容内核架构的样子。<p>仍然缺失的功能:<p>- 网络栈(正在开发中)
- 更广泛的系统调用覆盖<p>该项目目前大约有41k行Rust代码。欢迎反馈!<p>我还想感谢在过去三个月中做出贡献的每一个人,特别是arihant2math、some100以及其他提交修复和想法的人。<p>仓库链接:https://github.com/hexagonal-sun/moss
查看原文
Hello!<p>Three months ago I shared a project I’ve been working on: moss, a Linux-compatible kernel written in Rust and AArch64 assembly. Since then, it has crossed a pretty major milestone and I wanted to share an update. It now boots into a dynamically linked Arch Linux aarch64 userspace (ext4 ramdisk) with /bin/bash as init.<p>Some of the major additions over the past few months:<p>- ptrace support (sufficient to run strace on Arch binaries)
- Expanded ELF support: static, static-pie, dynamic, and dynamic-pie
- Dynamically linked glibc binaries now execute
- /proc support sufficient for ps, top
- Job control and signal delivery (background tasks, SIGSTOP/SIGCONT, etc.)
- A slab allocator for kernel dynamic allocations (wired through global_allocator)
- devfs, tmpfs, and procfs implementations
- Full SMP bringup and task migration with an EEVDF scheduler<p>The kernel currently implements 105 Linux syscalls and runs in QEMU as well as on several ARM64 boards (Pi 4, Jetson Nano, Kria, i.MX8, etc).<p>The project continues to explore what an async/await-driven, Linux-compatible kernel architecture looks like in Rust.<p>Still missing:<p>- Networking stack (in the works)
- Broader syscall coverage<p>The project is now about ~41k lines of Rust. Feedback is very welcome!<p>I also want to thank everyone who has contributed over the past three months, particularly arihant2math, some100, and others who have submitted fixes and ideas.<p>Repo: https://github.com/hexagonal-sun/moss