用Rust写一个操作系统
这个博客系列用Rust编程语言编写了一个小操作系统。每篇文章都是一个小教程,并且包含了所有代码,你可以跟着一起学习。源代码也放在了Github 仓库。
最新文章: Async/Await
Double Faults
在这篇文章中,我们会探索 double fault 异常的细节,它的触发条件是调用错误处理函数失败。通过捕获该异常,我们可以阻止致命的 triple faults 异常导致系统重启。为了尽可能避免 triple faults ,我们会在一个独立的内核栈配置 中断栈表 来捕捉 double faults。
更多 »内存分页初探
本文主要讲解 内存分页 机制,一种我们将会应用到操作系统里的十分常见的内存模型。同时,也会展开说明为何需要进行内存隔离、分段机制 是如何运作的、虚拟内存 是什么,以及内存分页是如何解决内存碎片问题的,同时也会对x86_64的多级页表布局进行探索。
更多 »分页实现
这篇文章展示了如何在我们的内核中实现分页支持。它首先探讨了使物理页表帧能够被内核访问的不同技术,并讨论了它们各自的优点和缺点。然后,它实现了一个地址转换功能和一个创建新映射的功能。
更多 »Async/Await
在这篇文章中,我们将探索 Rust 的 协作式多任务处理 及 async/await 特性。我们将深入探讨 Rust 中 async/await 的工作原理,包括 Future
trait 的设计、状态机转换与 pinning 。随后,我们通过创建一个异步键盘任务和基础执行器,为我们的内核添加对 async/await 的基本支持。
Subscribe
Receive notifications about new posts and other major changes! You can either:
- Subscribe to our RSS/Atom Feed,
- Subscribe to this GitHub issue, or
- Subscribe to our email newsletter.
Status Updates
These posts give a regular overview of the most important changes to the blog and the tools and libraries behind the scenes.
First Edition
You are currently viewing the second edition of “Writing an OS in Rust”. The first edition is very different in many aspects, for example it builds upon the GRUB bootloader instead of using the `bootloader` crate. In case you're interested in it, it is still available. Note that the first edition is no longer updated and might contain outdated information. read the first edition »
支持我
创建和维护这个博客以及相关的库带来了十分庞大的工作量,即便我十分热爱它们,仍然需要你们的支持。通过赞助我,可以让我有能投入更多时间与精力在创造新内容,开发新功能上。赞助我最好的办法是通过sponsor me on GitHub. 十分感谢各位!