Philipp Oppermann
os.phil-opp.com · Personal blog · on HN since 2015
Philipp Oppermann writes a tutorial series on building an operating system kernel in Rust, covering paging, heap allocation, and async/await.
What HN saysHN commenters recommend it as an approachable series for writing a kernel, one that shows how little unsafe code low-level Rust needs.
95HN people shared it
68linked it in comments
50stories submitted
4.6Kstory points
5 months agolast shared
2015people per year2026
Most-shared posts
- 1Learn Rust by writing a small OS59 people · 897 points · first shared 2015 · 80 comments on HN
- 2Writing an OS in Rust: Async/Await10 people · 414 points · first shared 2020 · 103 comments on HN
- 3A Minimal Kernel in Rust7 people · 13 points · first shared 2018 · 1 comments on HN
- 4Writing an OS in Rust: Accessing and Modifying Page Tables5 people · 19 points · first shared 2015 · 1 comments on HN
- 5Writing an OS in Rust: Better Exception Messages3 people · 220 points · first shared 2016 · 31 comments on HN
- 6Writing an OS in Rust: Heap Allocation3 people · 69 points · first shared 2019 · 2 comments on HN
- 7Writing an OS in Rust: Double Faults3 people · 8 points · first shared 2017 · discussion on HN
- 8Writing an OS in Rust3 people · 2 points · first shared 2016 · discussion on HN
- 9Writing an OS in Rust: Introduction to Paging2 people · 597 points · first shared 2019 · 79 comments on HN
- 10Writing an OS in Rust: Testing2 people · 173 points · first shared 2019 · 9 comments on HN
- 11Allocator Designs2 people · 145 points · first shared 2020 · 9 comments on HN
- 12Writing an OS in pure Rust2 people · 36 points · first shared 2018 · discussion on HN
- 13Writing an OS in Rust: Paging Implementation2 people · 11 points · first shared 2019 · discussion on HN
- 14VGA Text Mode – Writing an OS in Rust2 people · 3 points · first shared 2020 · discussion on HN
- 15Writing an OS in Rust: Unit Testing2 people · 2 points · first shared 2018 · discussion on HN
What HN people wrote when they linked it
exDM69 · 2025-09-30
The osdev wiki is the best source for this and they have the bare bones tutorials with all the linker scripts, bootstrap code, makefiles, etc you might need. They have examples for multiboot and UEFI (and BIOS boot sector).
For Rust there's this popular series: https://os.phil-opp.com/
If I were to start a new OS project I would do it in Rust too but as awesome as Rust is, I can't recommend doing a bare metal project as your first foray into the language. Learning two or more things at once doesn't work for me.
Levitating · 2023-10-23
A very basic kernel isn't that hard to make. I think currently the easiest way would be to follow this series of blogpost by Philip Oppermann: https://os.phil-opp.com/
He made a few crates which handles the boot process, paging, x86 structures and more.
linkdd · 2022-12-13
I'd recommend reading https://os.phil-opp.com/ to drive away those wrong assumptions.
chucksmash · 2021-10-06
I also did Nand2Tetris, like Rust, and had an interest in more material in this area. I followed v2 of this tutorial[1] and enjoyed it enough to become a GitHub sponsor for in-progress UEFI work, you might enjoy:
[1]: https://os.phil-opp.com/
bluejekyll · 2021-08-04
> Any Rust code that goes low level liberally uses unsafe{} blocks
This isn't an accurate statement. Liberal use of unsafe is not common or best practice in Rust. My favorite educational series that shows how little unsafe is required to work in low-level spaces is Phil Opperman's, "Writing an OS in Rust": https://os.phil-opp.com/
That being said, I don't think most people use "Rust is safe" in an particular way that's different from saying Java is safe. Rust in many ways offers similar (and stronger) safety guarantees than Java (one of the safest langauges to date). Is Java safe? We all know that bugs can be created in every language, it's really the different classes of bugs that each language offers some defense against that sets them apart from each other.
faitswulff · 2021-01-15
I've been working my way through the blog os resources in Rust (https://os.phil-opp.com/) - is there a similar tutorial for Zig? I think it would be a great comparison. Closest thing I can find is this hobby x86 kernel in Zig: https://news.ycombinator.com/item?id=21967668
ekidd · 2020-07-18
If anybody enjoys this and wants to take it much further, you might want to check out https://os.phil-opp.com/. This is basically a book-in-progress that shows how to build an OS in Rust OS from scratch. It shows how boot up an OS, and it goes on to show how to set up basic drivers and memory management. He does a great job of explaining each step as he goes.
(This is linked near the end of the article, but I think it's worth pointing out.)
Full disclosure: I think he uses a library I wrote to initialize the keyboard controller.
rvz · 2020-01-18
That's it?
While the point of this project is to go for developing a very small kernel, I afraid I can't recommend this as a way to "learn to write your first OS kernel".
Particularly, this project has been fossilised for two years, (last commit was in 2018) with a single commit each year hardly qualifies as an updated tutorial for writing OS kernels.
My first recommendation would be the "writing an OS in Rust" tutorials [0] and the xv6 tutorials [1].
[0] https://os.phil-opp.com/
[1] https://pdos.csail.mit.edu/6.828/2019/xv6.html
jackhalford · 2020-01-06
OSDev can be hit or miss. All of the bootstrapping was done following this [0] tutorial for Rust, which translates easily to zig. For the more advanced parts you can find usefull ones in [1] or use the OSDev search bar. For even more advanced topics though you'll find that there are no tutorial and only a few open source implementations to take inspiration from!
ps: I've updated my readme with a few references
[0] https://os.phil-opp.com/
[1] https://wiki.osdev.org/Tutorials
rubyn00bie · 2019-08-27
This book has been immensely helpful to me, it's "Writing an OS in Rust" https://os.phil-opp.com/ and I can't recommend it enough.
Also, Redox OS is an OS written in Rust and has a ton of wonderful documentation on it that's been helping me get into systems development: https://www.redox-os.org/docs/
matthewmacleod · 2019-06-23
It’s worth reading through Phillip Opperman’s blog series (https://os.phil-opp.com/) where he writes about creating an OS in Rust. Not necessarily for the Rust part, but it has lots of nice info on how a modern system is bootstrapped.
nixpulvis · 2018-11-13
Redox is a really cool project. I haven't tried running it in a while though. Last time I tried it I couldn't get it running on real hardware, maybe things have gotten better there.
Either way, if you find Redox interesting, I bet you'll find https://os.phil-opp.com/ interesting too. It's a much less full fledged project, but the blog posts are a great way to learn about Rust and OSes at the same time.
xxr · 2016-10-19
Haven't read the article yet, but the coauthor Philipp Oppermann has a really enjoyable guide I've been following on building an OS in Rust: http://os.phil-opp.com/
pcwalton · 2016-08-24
> every attempt I've seen makes widespread use of `unsafe', so the value mostly comes from Rust's modern type system with its traits and enums.
http://os.phil-opp.com/ follows the Rust way of making safe abstractions as much as possible.
dikaiosune · 2016-02-23
Re: amount of low level code needing unsafe blocks, its worth checking out this series that documents creating a bare metal kernel in rust that has lots of type safety and uses shockingly little assembly or unsafe:
http://os.phil-opp.com/
anp · 2016-01-06
Re: low-level Rust, I've been really enjoying following this series:
http://os.phil-opp.com/
It shows a variety of ways to safely wrap unsafe code and then provide strongly-typed safe interfaces to the hardware, no pointer twiddling required. A particularly good example is the section "Some Clever Solution" in the "Page Tables" post.
1letterunixname · 2023-07-21
There's a no-std tutorial on how to write a demo kernel in Rust. https://os.phil-opp.com
osdev.org, sandpile.org, RBIL, and freevga. The biggest PITA is hardware support. There are many good vintage hardcopy books with recipes for things like reliable port IO and undocumented hardware tricks.
- Intel® 64 and IA-32 Architectures Software Developer’s Manual Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4
- Microsoft MS-DOS Programmer's Reference (also includes real-mode BIOS calls)
- PC Interrupts
- Undocumented PC
- PC Intern
- Programmer's Guide To The EGA, VGA, And Super VGA Cards
- Graphics Programming Black Book Special Edition
Also, it's worth toying with advances in OS dev past the era of monolithic, microkernel, and hybrid.
1. Capability-based like seL4. It has a number of inherent performance and security advantages including capabilities and excellent IPC.
2. POSIX compatibility layer. Even embedded OSes without the concept of threads or processes can implement POSIX.
3. Hypervisor. They're much easier to add with intel's VT-[xd]. Failing that, fall back to emulation. Translational emulation is very performant.
4. Get good at generalizing interrupt handlers, making them fast, avoiding race conditions, and using lock-free patterns.
Also:
5. Rewriting or trapping unsupported instructions including x87 and MMX.
6. The failure of pure microkernel was the added complexity and management of sequencing multiple resources in a transactional manner.…
Gazoche · 2025-10-28
The Rust OS tutorial you're thinking of is probably this one: https://os.phil-opp.com/
yencabulator · 2025-09-14
I'd suggest https://os.phil-opp.com/ instead of a book from long ago. There is no reason to drag yourself through C anymore.
And if you do want the more historical content, https://www.projectoberon.net/
the_duke · 2025-07-30
Even if you don't care about building an OS: the async/await post [1] is the best resource for understanding how async actually works in Rust.
Highly recommended.
[1] https://os.phil-opp.com/async-await/
udev4096 · 2024-12-06
There's https://os.phil-opp.com/ for rust, https://github.com/tuhdo/os01 for general OS development and make sure to read Operating Systems: Three Easy Pieces
dysoco · 2024-06-28
Sadly no, they moved all courses to a private platform, but we used a lot of external resources not too much of our own except the exercises.
The kernel development one was pretty much what you can find in the Intel Manuals + osdev wiki [1] or some of the many osdev tutorials [2].
For SIMD I'm not aware of good tutorials or books, we did use again Intel manuals for reference and also [3]. For the image filters I assume you can search algorithms for basic filters such as pixelate, edges, etc. expressed as matrix operations and see how you can write that as SIMD ops.
[1]: https://wiki.osdev.org/Expanded_Main_Page [2]: https://os.phil-opp.com/ [3]: https://www.felixcloutier.com/x86/
maxbond · 2024-06-08
There's tons of stuff of the kind you're describing in Rust, more than I care to list but I'll offer you some [1-3] that I think would interest you (based on this comment alone). If your perception of what people are doing in Rust is driven by what people post to HN, it may not reflect everything that is going on in that ecosystem.
[1] https://os.phil-opp.com/
[2] https://gitlab.redox-os.org/redox-os/redox
[3] https://oxide.computer/
junon · 2023-11-08
Not exactly a course, but Phil-opp's guides are pretty well done.
https://os.phil-opp.com/
dento · 2022-08-02
For a hands-on introduction, writing a minimal kernel in Rust, see https://os.phil-opp.com/
Dzugaru · 2022-03-25
Unfortunately, this (really nice) PDF isn't complete.
For me an Operating System means processes in userland, sadly it comes short of that.
I'm now pushing my own x86 32bit OS in Rust using [0][1]:
There is definitely a shortage of information on this stuff (for example writing a USB driver is really hard and I couldn't find easily available tutorials - you have to resort to raw *HCI and USB specs to get things done).
[0] https://wiki.osdev.org/Expanded_Main_Page
[1] https://os.phil-opp.com/
FemmeAndroid · 2021-11-10
You might enjoy this series of blog posts. I went through them last year and learned a lot!
https://os.phil-opp.com/
faraaz98 · 2021-09-10
IntermezzOS: http://intermezzos.github.io/
Phillip Opperman's Blog OS: https://os.phil-opp.com/
dimitrios1 · 2020-08-12
Try writing an operating system in rust https://os.phil-opp.com/
davidhyde · 2020-05-31
This is a very good series if you want to build it in rust. https://os.phil-opp.com/
That minesweeper game seems to only use the vga buffer and that blog series explains that tech very well.