blog_os README

The project's README from github.com/phil-opp/blog_os. As one markdown file: README.md.

Blog OS

This repository contains the source code for the Writing an OS in Rust series at os.phil-opp.com.

If you have questions, open an issue or chat with us on Gitter.

Where is the code?

The code for each post lives in a separate git branch. This makes it possible to see the intermediate state after each post.

The code for the latest post is available here.

You can find the branch for each post by following the (source code) link in the post list below. The branches are named post-XX where XX is the post number, for example post-03 for the VGA Text Mode post or post-07 for the Hardware Interrupts post. For build instructions, see the Readme of the respective branch.

You can check out a branch in a subdirectory using git worktree:

git worktree add code post-10

The above command creates a subdirectory named code that contains the code for the 10th post ("Heap Allocation").

Posts

The goal of this project is to provide step-by-step tutorials in individual blog posts. We currently have the following set of posts:

Bare Bones:

Interrupts:

Memory Management:

Multitasking:

First Edition Posts

The current version of the blog is already the second edition. The first edition is outdated and no longer maintained, but might still be useful. The posts of the first edition are:

Click to expand

Bare Bones:

Memory Management:

Exceptions:

Additional Resources:

License

This project, with exception of the blog/content folder, is licensed under either of

at your option.

For licensing of the blog/content folder, see the blog/content/README.md.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

blog_os (phil-opp/blog_os)

Searching Database…

17.8K ·GitHub
这是什么?这是 os.phil-opp.com 上「Writing an OS in Rust」博客系列的源代码——一系列step-by-step的教程文章,教你用 Rust 从零构建一个小型 x86-64 操作系统内核。
它只是一个博客,还是也有能运行的代码?两者都有:网站上的每篇文章都配有能正常运行的代码,存放在本仓库单独的 git 分支里,所以你可以运行该文章所描述的那一版代码。
我怎么拿到某一篇文章对应的代码?点击文章旁边的(源代码)链接,或者直接检出对应的分支——分支命名为 post-XX(post-03 是 VGA Text Mode,post-07 是 Hardware Interrupts)。构建说明在每个分支各自的 README 里。
这个系列写完了吗?还在持续更新中:第二版目前有 12 篇文章,最新的一篇是 Multitasking 部分的 Async/Await。较早的第一版已不再维护。
开始之前我需要先会 Rust 吗?文章是循序渐进的,但从第一篇(「A Freestanding Rust Binary」)开始你就要写 Rust 了,所以实际上需要掌握一些 Rust 基础。至于操作系统开发本身的概念,则是从零讲起的。
做出来的 OS 到底能跑在哪里?这个内核面向 x86-64 裸机——它可以直接在硬件上运行,也可以在 QEMU 这类模拟器里运行,而不是跑在 Linux 或 Windows 这类现有操作系统里面。
我可以把自己的项目里复用这些代码吗?可以——代码同时以 Apache-2.0 和 MIT 双许可发布,你可以任选其一。博客/内容文件夹另行授权(见 blog/content/README.md)。
这些文章都讲哪些内容?共四个部分:Bare Bones(独立可执行文件、最小内核、VGA 文本模式、测试)、Interrupts(CPU 异常、双重错误、硬件中断)、Memory Management(分页、堆分配、分配器设计)和 Multitasking(async/await)。
新手应该从哪里开始?从 Bare Bones 部分的第一篇文章「A Freestanding Rust Binary」开始。各篇文章按顺序层层递进,每一篇在本仓库里都有对应的 post-XX 分支存放它的代码。
能不能同时保留多篇文章的代码,而不用来回切换分支?可以——README 建议使用 git worktree,它会把某个分支检出到一个子目录里;示例命令是把 post-10(Heap Allocation)的代码放到一个名为 code 的文件夹里。
既然这是一个 Rust 写的 OS,为什么 GitHub 上显示的语言是 HTML?因为仓库根目录放的是博客网站本身;真正的 Rust 内核代码在各个 post-XX 分支里,所以主页显示的是网站而不是内核源码。
Creator
phil-opp
Size
21.4 MB
Stars
17.8K
Updated
CommitAug 07
Age
11y
Commits · 90 Days