Loading editor…
Loading editor…
{| class="wikitable" style="background-color: #fff; border: 2px solid #8a0a0a; text-align: center;" darkstyle="background-color: var(--wiki-surface);"
|-
| style="padding: 10px; color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);" |
<div style="font-size: 1.3em;">'''xv6'''</div>
<div style="font-size: 0.85em;">Unix-like teaching operating system</div>
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Developer'''</span><br>[[MIT]]
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''OS family'''</span><br>[[Unix-like]]
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Written in'''</span><br>[[C (programming language)|C]] and [[assembly language|assembly]]
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Kernel type'''</span><br>[[Monolithic kernel|Monolithic]]
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''License'''</span><br>[[MIT license]]
|-
| style="background-color: #fff;" darkstyle="background-color: var(--wiki-surface);" |{{Collapse|text="'''[ More / Less ]'''"|color="#8a0a0a"|style="background-color: var(--wiki-bg);" darkstyle="background-color: var(--wiki-surface);"}}
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Platforms'''</span><br>[[x86]] (multiprocessor)<br>[[RISC-V]]<br>x86-64
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''UI'''</span><br>[[Command-line interface]]
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Latest (RISC-V)'''</span><br>rev5 <small>(September 2, 2025)</small>
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Latest (x86-32)'''</span><br>rev11 <small>(September 2, 2018 · End of life)</small>
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Latest (x86-64)'''</span><br>rev1 <small>(September 1, 2025)</small>
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Source model'''</span><br>[[Open-source software|Open source]]
|-
| style="text-align: left;" | <span style="color: #8a0a0a;" darkstyle="color: color-mix(in srgb, #8a0a0a 55%, #f5f5f7);">'''Website'''</span><br>[https://pdos.csail.mit.edu/6.1810/xv6 pdos.csail.mit.edu]
{{Endcollapse}}
|}
{{Version 6 Unix Navbox}}
{{Teaching operating systems Navbox}}
= Overview =
'''xv6''' is a modern reimplementation of [[Version 6 Unix|Sixth Edition Unix]] in [[ANSI C]] for [[multiprocessing|multiprocessor]] [[x86]] and [[RISC-V]] systems. It was created in 2006 for [[MIT]]'s Operating System Engineering course (6.1810, formerly 6.828) as a teaching tool.{{Note|MIT PDOS Group, "Xv6, a simple Unix-like teaching operating system." [https://pdos.csail.mit.edu/6.1810/ pdos.csail.mit.edu/6.1810].}}
MIT's OS course formerly used the original [[Version 6 Unix|V6]] source code, but [[PDP-11]] machines are no longer widely available and the original code was written in archaic pre-ANSI C. xv6 was created as a modern replacement — simple enough to cover in a single semester, yet containing the important concepts and organizational structure of [[Unix]]. Unlike [[Linux]] or [[BSD]], whose codebases are vast and complex, xv6's entire source listing fits in 99 pages including cross-references, making it practical for line-by-line study.
The system is released under the [[MIT license]] and its source code is hosted on [[GitHub]]. Active development focuses on the RISC-V port (current version: rev5, September 2025), while the original x86-32 version (rev11, September 2018) is no longer maintained. A separate x86-64 port is maintained by the [[University of Strasbourg]].
= Purpose =
xv6 exists to give students a complete, readable, working Unix-like kernel they can study, modify, and extend in a single-semester course. Its design preserves the core abstractions of Unix — processes, files, pipes, system calls, a file system, and a shell — without the decades of accumulated complexity found in production systems. Students typically complete assignments that involve modifying or adding features to xv6, such as implementing new system calls, adding virtual memory features, or changing the scheduler.
= Self-documentation =
A notable feature of xv6's [[Makefile]] is the option to produce a [[PDF]] of the entire source code listing in a readable, formatted layout. The complete printout is only 99 pages, including cross-references. This echoes the tradition established by the original V6 source code, which was published in a similar form in ''[[Lions' Commentary on UNIX 6th Edition, with Source Code]]'' — one of the most influential works in operating systems education.
= The xv6 book =
The xv6 source code is paired with a companion commentary book that explains key operating systems concepts using xv6 as a concrete example. The book also identifies areas where the OS could be improved, providing a roadmap for student projects. The RISC-V rev5 edition covers the following topics: OS interfaces, OS organization, [[page table]]s, traps and [[system call]]s, [[page fault]]s, [[interrupt]]s and [[device driver]]s, [[lock (computer science)|locking]], [[scheduling (computing)|scheduling]], sleep and wakeup mechanisms, and the [[file system]].{{Note|Cox, Russ; Kaashoek, Frans; Morris, Robert. ''xv6: A Simple, Unix-like Teaching Operating System.'' MIT EECS. [https://pdos.csail.mit.edu/6.1810/2025/xv6/book-riscv-rev5.pdf Rev5 PDF].}}
= Comparison with other teaching operating systems =
xv6 differs from other educational operating systems in several ways. It is significantly smaller than [[MINIX]] or [[Pintos]], making it feasible to cover in a single semester. Its [[monolithic kernel]] architecture contrasts with MINIX's [[microkernel]] design and [[Nachos]]' user-space simulation approach. Compared to [[Xinu]], xv6 includes modern features such as [[memory paging|paging]] and [[virtual memory]] that Xinu lacks. The combination of small size, real hardware support, and faithful Unix design makes xv6 a popular choice for courses that want students to work with actual kernel code rather than simulations.
= Educational use =
xv6 is used in operating systems courses at universities around the world. In addition to MIT, institutions that have adopted xv6 include [[Columbia University]], [[Georgia Tech]], [[Johns Hopkins University]], [[Yale University]], [[University of Wisconsin–Madison]], [[University of Virginia]], [[Northwestern University]], [[Rutgers University]], [[University of Texas at Austin]], [[Tsinghua University]], [[RWTH Aachen University]], [[Karlsruhe Institute of Technology]], [[IIT Bombay]], [[IIT Delhi]], [[IIT Madras]], [[National Taiwan University]], [[Nanyang Technological University]], [[Ben-Gurion University]], [[Technion]], [[University of Tehran]], [[University of Strasbourg]], and many others.
= External links =
* [https://pdos.csail.mit.edu/6.1810/ MIT 6.1810: Operating Systems Engineering]
* [https://github.com/mit-pdos/xv6-riscv xv6 RISC-V source code (GitHub)]
* [https://pdos.csail.mit.edu/6.1810/2025/xv6/book-riscv-rev5.pdf xv6 book (RISC-V rev5, PDF)]
* [https://github.com/mit-pdos/xv6-public xv6 x86-32 source code (GitHub, unmaintained)]
* [https://xv6-64.gitlab.io/xv6-64/ xv6-64 (x86-64 port, University of Strasbourg)]