HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
mit-pdos
xv6-public
C2015–2025
mit-pdos / xv6-public

xv6-public

xv6 OS

24Distinct people
33Mentions
2Explicit recommenders
9.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

xv6 OS

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Some good resources to start with: - OSDev.org (https://wiki.osdev.org/Expanded_Main_Page) is a great starting point for writing an operating system - Three Easy Pieces…

linguae used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year33 dated mentions

Observed mentions: 2015-11-16 04:16:41 UTC to 2025-03-22 06:00:35 UTC.

0123452015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC413
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC303
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC404
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC404
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC303
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC404
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC505
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC303
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
NOTE: we have stopped maintaining the x86 version of xv6, and switched our efforts to the RISC-V version (https://github.com/mit-pdos/xv6-riscv.git) xv6 is a re-implementation of Dennis Ritchie's and Ken Thompson's Unix Version 6 (v6). xv6 loosely follows the structure and style of v6, but is implemented for a modern x86-based multiprocessor using ANSI C. ACKNOWLEDGMENTS xv6 is inspired by John Lions's Commentary on UNIX 6th Edition (Peer to Peer Communications; ISBN: 1-57398-013-7; 1st edition (June 14, 2000)). See also https://pdos.csail.mit.edu/6.828/, which provides pointers to on-line resources for v6. xv6 borrows code from the following sources: JOS (asm.h, elf.h, mmu.h, bootasm.S, ide.c, console.c, and others) Plan 9 (entryother.S, mp.h, mp.c, lapic.c) FreeBSD (ioapic.c) NetBSD (console.c) The following people have made contributions: Russ Cox (context switching, locking), Cliff Frey (MP), Xiao Yu (MP), Nickolai Zeldovich, and Austin Clements. We are also grateful for the bug reports and patches contributed by Silas Boyd-Wickizer, Anton Burtsev, Cody Cutler, Mike CAT, Tej Chajed, eyalz800, Nelson Elhage, Saar Ettinger, Alice Ferrazzi, Nathaniel Filardo, Peter Froehlich, Yakir Goaron,Shivam Handa, Bryan Henry, Jim Huang, Alexander Kapshuk, Anders Kaseorg, kehao95, Wolfgang Keller, Eddie Kohler, Austin Liew, Imbar Marinescu, Yandong Mao, Matan Shabtay, Hitoshi Mitake, Carmi Merimovich, Mark Morrissey, mtasm, Joel Nider, Greg Price, Ayan Shafqat, Eldar Sehayek, Yongming Shen, Cam Tenny, tyfkda, Rafael Ubal, Warren Toomey, Stephen Tu, Pablo Ventura, Xi Wang, Keiichi Watanabe, Nicolas Wolovick, wxdao, Grant Wu, Jindong Zhang, Icenowy Zheng, and Zou Chang Wei. The code in the files that constitute xv6 is Copyright 2006-2018 Frans Kaashoek, Robert Morris, and Russ Cox. ERROR REPORTS We don't process error reports (see note on top of this file). BUILDING AND RUNNING XV6 To build xv6 on an x86 ELF machine (like Linux or FreeBSD), run "make". On non-x86 or non-ELF machines (like OS X, even on x86), you will need to install a cross-compiler gcc suite capable of producing x86 ELF binaries (see https://pdos.csail.mit.edu/6.828/). Then run "make TOOLPREFIX=i386-jos-elf-". Now install the QEMU PC simulator and run "make qemu".
Read the full README on GitHub

What Hacker News says

33 sources
I still stick with xv6: https://github.com/mit-pdos/xv6-public - It's not only a kernel, but also have user space - Code is pretty compact and well documented, in general can be understood in a few days - No need to spend hours to custom build gcc. Just use the one provided by the distro package manager The x86 version isn't mantained anymore. They switched to RISC-V.
In BareMetal OS
linguae·Jun 6, 2024Recommendation phrase
Some good resources to start with: - OSDev.org (https://wiki.osdev.org/Expanded_Main_Page) is a great starting point for writing an operating system - Three Easy Pieces (https://pages.cs.wisc.edu/~remzi/OSTEP/) is a wonderful free online textbook that teaches the concepts of operating systems. - Modern Operating Systems, 5th Edition by Andrew Tanenbaum (of MINIX fame) and Herbert Bos (https://www.pearson.com/en-us/subject-catalog/p/modern-opera...) is the latest edition of a solid graduate-level textbook on operating system concepts. It may also be beneficial studying the source code of existing operating systems. I recommend starting with smaller, simpler systems, such as MINIX and xv6 (https://github.com/mit-pdos/xv6-public), before moving on to larger, more complex systems such as the Linux kernel (https://kernel.org/) and its user
Read the rest
land (e.g., GNU utilities, systemd, etc.). Another cool thing is to study the designs of non-Unix operating systems, such as the classic Mac OS, VMS, IBM OS/400, Plan 9 (yes, this is "more Unix than Unix" in many ways, but it's quite a departure from Unix) and its successor Inferno, and Symbolics Genera. Bonus points for reading academic papers on OS concepts such as exokernels. Good luck! It's a long but very interesting journey!
In Thinking about building a operating system
xv is, without no doubt, my favourite educational OS. It provides both kernel space and userspace. You can find many people extending various aspects of it (memory management, file system, etc) on Github. I still tinker with the x86 version (which isn't maintained anymore): https://github.com/mit-pdos/xv6-public. Doesn't need much effort to build it on macOS. The codebase is pretty compact that it can be understood in a few days, and also rebuilding it is very quick. Can't say the same thing about Linux, but hey as real world OS, guess some complexities are simply unavoidable.
In A first dip into OS kernel development with xv6 and the 6.1810 labs
+1 for mini operating system. Us, application developers, rely on many OS features: memory management, filesystem, etc. I'm sure eventually we'll ask "how such things are done behind the scene?" That's why I tinker with xv6 (https://github.com/mit-pdos/xv6-public) during sparetime. Learning various process scheduling algorithms from textbook is a thing. Implementing it is another thing. I learn a lot. And it's definitely fun, even though there's almost zero chance the knowledge gained is relevant for my job (I'm a mobile app dev).
In Challenging projects every programmer should try (2019)
xv6 was originally written for 32-bit x86; the RISC-V port is a relatively recent development. See e.g. https://github.com/mit-pdos/xv6-public for some of the earlier history. rxv64 was written for a specific purpose: we had to ramp up professional engineers on both 64-bit x86_64 and kernel development in Rust; we were pointing them to the MIT materials, which at the time still focused on x86, but they were getting tripped up 32-bit-isms and the original PC peripherals (e.g., accessing the IDE disk via programmed IO). Interestingly, the non sequitur about C++ aside, porting to Rust exposed several bugs or omissions in the C original; fixes were contributed back to MIT and applied (and survived into the RISC-V port). Oh, by the way, the use of the term "SMP" predates Intel's usage by decades.
In The rxv64 Operating System: MIT's xv6, in Rust, for SMP x86_64 machines
I'd define an arena as the pattern where the arena itself owns N objects. So you free the arena to free all objects. My first job was at EA working on console games (PS2, GameCube, XBox, no OS or virtual memory on any of them), and while at the time I was too junior to touch the memory allocators themselves, we were definitely not malloc-ing and freeing all the time. It was more like you load data for the level in one stage, which creates a ton of data structures in many arrays. Then you enter a loop to draw every frame quickly, and you avoid any allocation in that loop. There were many global variables. --- Wikipedia calls it a region, zone, arena, area, or memory context, and that seems about right: https://en.wikipedia.org/wiki/Region-based_memory_management It describes history from 1967 (before C was invented!) and has some good e
Read the rest
xamples from the 1990's: Apache web server ("pools") and Postgres database ("memory contexts"). I also just looked at these codebases: https://github.com/mit-pdos/xv6-public (based on code from the 70's) https://github.com/id-Software/DOOM (1997) I looked at allocproc() in xv6, and gives you an object from a fixed global array. This is similar to a lot of C code in the 80's and 90's -- it was essentially "kernel code" in that it didn't have an OS underneath it. Embedded systems didn't run on full-fledges OSes. DOOM tends to use a lot of what I would call "pools" -- dynamically allocated arrays of objects of a fixed size, and that's basically what I remember from EA. Though in g_game.c, there is definitely an arena of size 0x20000 called "demobuffer". It's used with a bump allocator. --- So I'd say - malloc / free of individual objects was NEVER what C code looked like (aside from toy code in college) - arena allocators were used, but global, fixed-size arrays, and dynamic pools were maybe more common. - arenas are more or less wash for memory safety. they help you in some ways, but hurt you in others. The reason C programmers don't malloc/free all the time is for speed, not memory safety. Arenas are still unsafe. When you free an arena, you have no guarantee there's nothing that points to it anymore. Also, something that shouldn't be underestimated is that arena allocators break tools like ASAN, which use the malloc() free() interface. This was underscored to me by writing a garbage collector -- the custom allocator "broke" ASAN, and that was actually a problem: https://www.oilshell.org/blog/2023/01/garbage-collector.html If you want memory safety in your C code, you should be using dynamically instrumented allocators (ASAN, valgrind) and good test coverage. Depending on the app, arenas don't necessarily help, they can hurt. An arena is a simple idea -- the problem is more if that usage pattern actually matches your application, and apps evolve over time.
In Some were meant for C [pdf] (2017)
The original Xv6 code uses the x86 IO ports for example[1][2][3], it would be easy to implement something similar for the soft CPU I imagine. Some good info about IO ports in the answers to this[4] SO question. [1]: https://github.com/mit-pdos/xv6-public/blob/eeb7b415dbcb12cc... [2]: https://github.com/mit-pdos/xv6-public/blob/eeb7b415dbcb12cc... [3]: https://www.felixcloutier.com/x86/out [4]: https://stackoverflow.com/questions/3215878/what-are-in-out-...
In Running a Unix-like OS on a home-built CPU with a home-built C compiler (2020)
What would be the challenge to write OS kernel in Lisp? Just X86, for the sake of umm simplicity, something like xv6: https://github.com/mit-pdos/xv6-public Yes, I've read about Lisp machines. Sounds like a super expensive machine only accessible by big-budgeted research companies. Most of Lisp folks on the net talk about how homoiconic language is elegant, or how REPL makes development faster, or how useful Lisp is for automatic theorem prover etc etc but very rarely I see Lisp folks talk about system programming, unlike C/C++/Rust folks.
In Why Lisp?
* tweetnacl.cr.yp.to Crypto library in the size of a hundred tweets [ https://twitter.com/tweetnacl ] by the only person with a genuine claim to being able to write safe C & company. * https://github.com/mit-pdos/xv6-public & * https://github.com/mit-pdos/xv6-riscv UNIX v6 clone in ANSI C by influential Plan 9-era Bell Laboratories employee and now influential Google employee Russ Cox, along with influential computer virus author and son of one of the original UNIX authors Robert T. Morrison; entire source code fits in under a hundred pages of well-typeset documents [ warning, old copy, you should generate a modern one: https://pdos.csail.mit.edu/6.828/2011/xv6/xv6-rev6.pdf ].
In Ask HN: How do I learn C properly?

Showing the 15 most recent of 33 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.