1060 points by ingve 418 days ago | 121 comments on HN
| Moderate positive
Contested
Editorial · v3.7· 2026-02-28 11:47:11 0
Summary Education & Knowledge Access Advocates
This open-source educational tutorial website advocates for accessible technical knowledge and democratic participation through free instruction, multilingual support, and collaborative development frameworks. The content strongly advances Article 26 (education) and Article 19 (free expression) by providing unrestricted access to OS development materials under transparent open-source licensing that enables global scientific collaboration.
I started a toy OS years ago based on the book Operating System Design by Douglas Comer. Personally I just couldn't get excited about anything that didn't run on real hardware, so I made mine for Raspberry Pi.
Is there any real hardware that this could run on?
Looking through this seems to use a lot of assembly. In the above the amount of assembly is kept to a minimum. Pretty much just bootstrapping and context switching. The rest is done in C.
For any rust enthusiasts, phil-opp's guide is such a fun exercise to try out. It was actually the first thing I tried in Rust (very silly idea) and ended up only understanding ~5% of what I had just typed out.
I tried it again 2-3 years later and took the time to go over each subject. I even planned in advance to make sure I was going to finish it.
This looks nice. Thank you!
Been considering something like that for quite a while now (Since my own risc-v CPU, written in VHDL, is working actually). I might get this as inspiration and rewrite it in Rust (tm) - Because I wnat to learn Rust, too
Very cool! I just started to dvelve into RISC-V, and the book I'm reading (not in English) offers their own emulator[1], which, at a glance, is much simpler than QEMU, and comes with a weird license[2]. I wonder if people actually used it, since it looks like an academic project. Maybe I can also follow this tutorial and test it out.
Ah yes, I have a few (too many as always, but I think that's good, especially when getting older; need to not get complacent) resolutions for 2025, one of them is to write a OS/DB with a development environment. Just to see how far I can take it. So these kind of tutorials are great. I was already going to make it RISC-V first because i'm interested.
This looks nice! I would love to have an ebook version to read on my ereader. I wonder how much effort it would take to use the markdown files in the GH repo and convert those.
Very delightful article. Based on my experience in "hobby" OS programming, I would add setting up GDB debugging as early as possible. It was a great help in my projects and an improvement over debugging with the QEMU monitor only.
QEMU contains a built-in GDB server, you'll need a GDB client built for the target architecture (riscv in this case) and connecting to the QEMU GDB server over the network.
I wrote this book so you can spend a boring weekend writing an operating system from scratch. You don’t have to write it in C - you can use your favorite programming language, like Rust or Zig.
I intentionally made it not UNIX-like and kept only the essential parts. Thinking about how the OS differs from Linux or Windows can also be fun. Designing an OS is like creating your own world—you can make it however you like!
BTW, you might notice some paragraphs feel machine-translated because, to some extent, they are. If you have some time to spare, please send me a PR. The content is written in plain Markdown [1].
I never counted, but my first professional software project was an operating system (firmware) for an RF switching box. It was written in 8085 ASM, and was probably in the neighborhood of 1,000 lines.
Apples to oranges, though. It was a specialized firmware system. Probably the biggest part was the IEEE-488 communications handler.
Very cool to see someone tackling a small OS for RISC-V.
Shameless plug: I've written hobby OS (well, a kernel actually) in Nim for x86-64[0] and it's all documented as well. I put its development on hold until I create a JetBrains plugin for Nim (in heavy development right now).
This is on my to do list of things to learn but I also don't know yet the purpose other than it being your own. Maybe security since most of what I work with is on top of the OS eg. programming languages. Maybe for RTOS applications at any rate this and OS Dev good resources.
The article nicely explains how to build a minimalist OS — works great as an intro material. I think understanding basic OS concepts is essential for performance tuning and debugging.
> The tricky part of creating your own OS is debugging.
The older I get, the more I think I can figure out most problems that don't require some really gnarly domain expertise if I have a good way to iterate on them: code something, try it, see the results, see how they compare with what I wanted. It's when pieces of that are difficult or impossible, or very slow, things get more difficult.
Comer was also my introduction to OS design and I still like the approach used in his Xinu books.
I had a quick glance at the OS in the linked article. This seems to be based on a 32-bit RISC-V with MMU. However, AFAIK, all available RISC-V SoCs with MMU are 64-bit. The 32-bit cores are only used for embedded controllers (unless you want to start designing an FPGA-based system).
The 32 and 64 bit versions of RISC-V are _not_ binary compatible, but the differences are rather small. Porting the MMU code from 64 to 32 bit or the other way round is not very complex, see my RV32 port of xv6 at
https://github.com/michaelengel/xv6-rv32 (the regular MIT xv6 version only supports RV64).
The major difference is that virtual address translation on RV32, sv32, uses a two-level page table (10 bit index for the first level, 10 bit index for the second and 12 bit offset) whereas there are several modes of translation for RV64. The most common one, sv39, uses 39 bits of the virtual address split into three 9-bit indexes (so you need a three-level page table for 4 kB pages) plus 12 bit offset.
If you make the modifications, running the OS on real hardware should not be too difficult. The Allwinner D1 is a relatively simply RV64 single code SoC (boards can be found for $20 upwards from aliexpress) and getting the CPU and a UART to work is not that difficult. You can check out my xv6 port to the D1 as a reference:
https://github.com/michaelengel/xv6-d1
Virtio is not qemu only. For example, the macOS virtualization framework on Apple Silicon Macs (and x86 machines IIRC) also provides virtio devices, other hypervisors.
An overview of the available devices can be found in this presentation:
Don't hesitate to send the author an email, open a ticket or a PR to make sure they see this, it seems more appropriate than HN comments for this kind of things :-)
You can clone the repo and install pandoc. Then run "pandoc index.md *.md -o operating-system-in-1000-lines.epub" in "website/en/" folder and you will have a fully working ebook.
It likely doesn't have performance that's good enough for production use. Doesn't look like there's JIT so it's all instruction by instruction interpreting.
Agree, and I'll add 3 other really useful QEMU features for osdev:
1) Record & Replay: Record an execution and replay it back. You can even attach GDB while replaying, and go back in time while debugging with "reverse-next" and "reverse-continue": https://qemu-project.gitlab.io/qemu/system/replay.html
2) The QEMU monitor, especially the "gva2gpa" and "xp" commands which are very useful to debug stuff with virtual memory
3) "-d mmu,cpu_reset,guest_errors,unimp": Basically causes QEMU to log when your code does something wrong. Also check "trace:help", there's a bunch of useful stuff to debug drivers
Notice a bunch of downvotes -- Apologies for being unfamiliar with the rules here (I've always been reading HN, but I'm new to commenting). I should've added a lot more details to my previous comment and been more specific. Any other guides would be helpful too. I'll be careful in the future.
When I learned OS, I followed MIT 6.828 (https://pdos.csail.mit.edu/6.828/2017/overview.html) and implemented a small OS called JOS based on Xv6. So if you're looking for some teaching OS in x86, check it out.
How does your book compare with the classic "Operating systems design and implementation" by Andrew S. Tanenbaum and Albert S. Woodhull implementing MINIX?
I find this kind of thing most useful for microcontrollers and real-time embedded systems that don't require full networking. I've used many of these concepts but maybe not all at once on what many would call "bare metal" systems with no OS.
Audio gizmos like cheap synths, LED nodes, things you want booting really fast with well-bounded functionality. An OS can get in the way with this kind of system if all you really need is some timers and simple I/O. You may still want a primitive scheduler, sane interrupt dispatching, and filesystems.
If you want PRs, I suggest you set up Semantic Linefeeds* sooner, rather than later. Each sentence gets its own line, and it really helps avoid merge conflicts.
The page is an explicitly structured educational tutorial with 17 sequential chapters covering OS development. The text states 'we're going to build a small operating system from scratch, step by step,' making education the core mission.
FW Ratio: 57%
Observable Facts
The page is an explicitly structured educational tutorial with 17 sequential chapters covering OS development from first principles
Content is offered without cost, institutional enrollment requirement, or background-based access restrictions
The tutorial is available in five languages (English, Traditional Chinese, Korean, Japanese, Simplified Chinese), extending educational access to international learners
The text states prerequisites are 'familiarity with the C language and a UNIX-like environment,' making educational scope transparent
Inferences
Structured, free, multilingual technical education directly advances the right to education as a fundamental human right
Removal of cost and institutional barriers enables equitable access to advanced technical knowledge
Clear prerequisites and progressive curriculum structure support self-directed learning and skill development
The tutorial shares detailed scientific and technical knowledge about operating system design and implementation in public forum. The content connects to broader scientific tradition (Linux version 0.01 historical context).
FW Ratio: 60%
Observable Facts
The tutorial shares detailed scientific and technical knowledge about operating system design and implementation publicly
Source code examples are provided under MIT license enabling study, reuse, and derivative works
The content references and contextualizes within broader scientific tradition (Linux version 0.01 cited as historical reference)
Inferences
Open publication of technical knowledge enables global scientific collaboration and advances technological progress
Permissive licensing enables international scientific community participation in knowledge advancement and derivative research
The content advocates for free information access through public code publication. The page states 'You can download the implementation examples from GitHub,' emphasizing accessibility to source materials.
FW Ratio: 60%
Observable Facts
Source code is published in a public GitHub repository without paywalls, login requirements, or access restrictions
The material is explicitly licensed under MIT (code) and CC BY 4.0 (content) for unrestricted sharing and distribution
The page states 'You can download the implementation examples from GitHub' with a direct link to the repository
Inferences
Public repository and permissive licensing remove technical and economic barriers to seeking, receiving, and imparting technical information
Free distribution of source code advances freedom of expression and information access globally
The page explicitly states licensing terms ('This book is available under the CC BY 4.0 license. The implementation examples and source code in the text are under the MIT license.'), demonstrating clear respect for intellectual property frameworks.
FW Ratio: 50%
Observable Facts
The page explicitly states: 'This book is available under the CC BY 4.0 license. The implementation examples and source code in the text are under the MIT license.'
Clear license terms are provided for both educational content and code examples
Inferences
Explicit dual licensing demonstrates clear respect for intellectual property rights and legal frameworks
Permissive licenses (CC BY 4.0 and MIT) enable lawful derivative works, modification, and redistribution by others
The tutorial encourages independent problem-solving and technical understanding of system design, promoting freedom of thought through technical literacy and critical engagement with underlying concepts.
FW Ratio: 50%
Observable Facts
The tutorial teaches independent problem-solving and technical understanding of how systems work at the kernel level
The content presents foundational concepts allowing learners to examine and critique system design decisions
Inferences
Technical education promotes freedom of thought by enabling readers to understand and potentially critique underlying design decisions
Open-source code access allows readers to examine and form independent opinions about technical implementations
The tutorial frames operating system development as accessible to all learners ('the basic functions of an OS...are surprisingly simple'), promoting equal intellectual capacity regardless of background.
FW Ratio: 50%
Observable Facts
The tutorial is offered in five languages: English, Traditional Chinese, Korean, Japanese, and Simplified Chinese, with no apparent access restrictions based on user background
The page states 'the basic functions of an OS...are surprisingly simple,' positioning technical knowledge as accessible to all learners
Inferences
Multilingual availability demonstrates explicit commitment to equal knowledge access across linguistic communities
Framing complex topics as learnable promotes equal dignity and intellectual capacity regardless of educational or socioeconomic background
The author is credited as the creator of both the tutorial and original work 'Design and Implementation of Microkernels,' recognizing individual intellectual authorship.
FW Ratio: 50%
Observable Facts
The author is credited as the creator of both the tutorial and the original book 'Design and Implementation of Microkernels' in Japanese
The page includes a link to the GitHub repository establishing the creator's ongoing stewardship
Inferences
Author attribution acknowledges individual personhood and intellectual agency
Maintaining explicit lineage to the original work respects creator identity and recognizes contribution
The tutorial teaches practical, marketable technical skills (OS development, C programming, RISC-V, disk I/O, file systems) relevant to professional work.
FW Ratio: 50%
Observable Facts
The tutorial teaches practical, marketable technical skills (OS development, C programming, RISC-V architecture, disk I/O, file systems)
All content is provided at no cost with no employment or payment prerequisite
Inferences
Free technical skill development reduces barriers to workforce participation and career advancement
Accessible training enables workers to gain knowledge and capabilities relevant to labor market participation and negotiation
The page expresses community-oriented values toward collaborative technical work ('Happy OS hacking!'), reflecting participation in shared knowledge advancement.
FW Ratio: 60%
Observable Facts
The GitHub repository structure explicitly invites community contributions and collective development through pull requests
The text states 'Happy OS hacking!' expressing community-oriented mindset toward collaborative technical work
Open-source licensing explicitly permits others to contribute, modify, and improve the work
Inferences
Open-source licensing frameworks enable individuals to contribute to collective technical knowledge and advancement
Community-oriented publishing structure reflects participation in shared duties toward global technical knowledge development
The content does not explicitly invoke Preamble themes of dignity, freedom, or justice, though educational accessibility supports these principles implicitly.
FW Ratio: 50%
Observable Facts
The page provides free, unrestricted access to operating system educational content
Inferences
Open and cost-free information access aligns with the Preamble's foundational commitment to enabling human dignity and intellectual freedom
Content is offered without cost, institutional enrollment requirement, or background-based restrictions. Multilingual availability (five languages) extends educational access to international learners. Clear prerequisites establish the educational scope.
Source code is published in a public GitHub repository without paywalls, login requirements, or access restrictions. MIT and CC BY 4.0 licenses explicitly permit sharing and distribution.
Source code examples are provided under MIT license, enabling study, reuse, and derivative works. Open publication structure enables global scientific collaboration.
Multilingual availability (five languages) and free public access ensure equal opportunity to participate in advanced technical education without institutional or economic barriers.
The open-source governance structure on GitHub allows anyone to propose changes via pull requests and participate in code review, enabling democratic input into the learning resource.
The page includes attribution links to GitHub repository and references back to the original Japanese work, establishing clear creator identification and lineage.
The GitHub repository structure and open-source licensing explicitly invite community contributions and collective development through pull requests and derivative works.
Evaluated by llama-4-scout-wai: 0.00 (Neutral) 0.00
reasoning
ED neutral tech tutorial
2026-02-28 13:46
rater_validation_fail
Parse failure for model deepseek-v3.2: Error: Failed to parse OpenRouter JSON: SyntaxError: Expected ',' or ']' after array element in JSON at position 17541 (line 397 column 6). Extracted text starts with: {
"schema_version": "3.7",
"
build 1ad9551+j7zs · deployed 2026-03-02 09:09 UTC · evaluated 2026-03-02 11:31:12 UTC
Support HN HRCB
Each evaluation uses real API credits. HN HRCB runs on donations — no ads, no paywalls.
If you find it useful, please consider helping keep it running.