{{Short description|Modern reimplementation of Sixth Edition Unix}} {{Lowercase title}} {{Infobox OS | name = xv6 | logo = | screenshot = Xv6 LS Command Output.png | caption = xv6 startup, and using the "<samp>ls</samp>" command | developer = MIT | family = Unix-like | released = | language = English | ui = Command-line interface | license = MIT license | website = {{URL|pdos.csail.mit.edu/6.1810/xv6}} | source_model = Open source | kernel_type = Monolithic | supported_platforms = multiprocessor Intel x86 and RISC-V | latest_release_version = {{multiple releases | branch1 = RISC-V: | version1 = rev5 | date1 = {{Start date and age|2025|09|02}}

| branch2 = x86-32 (EOL): | version2 = rev11 | date2 = {{Start date and age|2018|09|02}}

| branch3 = x86-64: | version3 = rev1 | date3 = {{Start date and age|2025|09|01}} }} | marketing_target = | programmed_in = C and assembly | prog_language = | updatemodel = | package_manager = | working_state = }} '''xv6''' is a modern reimplementation of Sixth Edition Unix in ANSI C for multiprocessor x86 and RISC-V systems. It was created for educational purposes in MIT's Operating System Engineering course in 2006.<ref name=6.828>{{cite web | url = https://pdos.csail.mit.edu/6.1810/ | title = Xv6, a simple Unix-like teaching operating system | quote = Xv6 is a teaching operating system developed in the summer of 2006 | access-date = 2025-05-06 }}</ref>

==Purpose== MIT's Operating System Engineering course formerly used the original V6 source code. xv6 was created as a modern replacement, because PDP-11 machines are not widely available and the original operating system was written in archaic pre-ANSI C. Unlike Linux or BSD, xv6 is simple enough to cover in a semester, yet still contains the important concepts and organization of Unix.<ref name=6.828 />

==Self-documentation== One feature of the Makefile for xv6 is the option to produce a PDF of the entire source code listing in a readable format. The entire printout is only 99 pages, including cross references.<ref>{{cite web | url = https://pdos.csail.mit.edu/6.1810/2018/xv6/xv6-rev11.pdf | title = xv6 source listing (x86 only, not available for RISC-V) | format = pdf | access-date = 2018-01-10 }}</ref> This is reminiscent of the original V6 source code, which was published in a similar form in ''Lions' Commentary on UNIX 6th Edition, with Source Code.''

== xv6 book == xv6 source code is paired with a commentary book that explains key concepts of operating systems using xv6 as an example. It also mentions which parts of the OS can be improved further, and how. For example, version 5 of RISC-V xv6<ref>Cox, Russ; Kaashoek, Frans; Morris, Robert. ''xv6: A Simple, Unix-like Teaching Operating System.'' MIT Department of Electrical Engineering and Computer Science. [https://pdos.csail.mit.edu/6.1810/2025/xv6/book-riscv-rev5.pdf]</ref> book, among others, introduces the following topics:

* OS Interfaces * OS organization * Page tables * Traps and system calls * Page faults * Interrupts and device drivers * Locking * Scheduling * Sleep and Wakeup * File system

== Compared to other teaching operating systems == xv6 differs from other operating systems being very small to be covered in a semester (especially compared to Minix or Pintos), by kernel type (xv6 monolithic vs Minix microkernel vs Nachos user-space simulated), and by having more of modern techniques (for example, Xinu lacking paging and virtual memory).

{{Teaching OS}}

==Educational use== xv6 has been used in operating systems courses at many universities, including: * Adolfo Ibanez University * University of the Andes (Colombia) * Ben-Gurion University<ref>{{cite web | url = http://www.cs.bgu.ac.il/~os122/Main | title = Operating Systems – 2012/Spring – Main | access-date = 2012-03-26 }}</ref> * Binghamton University * Boston College * CentraleSupélec * College of Engineering Pune (COEP, Now COEP Technological University) * Columbia University<ref>{{cite web | url = https://www.cs.columbia.edu/~junfeng/13fa-w4118/index.html | title = COMS W4118: Operating Systems I, Fall 2013 | access-date = 2013-09-09 }}</ref> * Ghulam Ishaq Khan Institute<ref>{{cite web | url = https://giki.edu.pk/ | title = Operating Systems, Fall 2022 | access-date = 2022-12-09 }}</ref> * Federico Santa María Technical University * George Washington University<ref>{{cite web | url = https://www2.seas.gwu.edu/~gparmer/classes/2018-08-01-Operating-Systems.html | title = CSCI 3411 – Operating Systems, Fall 2018 | access-date = 2018-09-27}}</ref> * Nile University<ref>{{cite web | url = http://www.nu.edu.eg/ | title = ECEN427 - Operating Systems, Fall 2023 | access-date = 2023-09-27}}</ref> * Georgia Tech<ref>{{Cite web|title=General Information — CS-3210, Fall 2017 1 documentation|url=https://cs3210.cc.gatech.edu/info.html|access-date=2019-06-21|website=cs3210.cc.gatech.edu}}</ref> * IIIT Allahabad * IIT Bhubaneswar and PEC Chandigarh * IIT Bombay<ref>{{Cite web|title=Lecture Notes on Operating Systems|url=https://www.cse.iitb.ac.in/~mythili/os/|access-date=2020-09-28|website=www.cse.iitb.ac.in}}</ref> * IIT Delhi * IIT Madras * IIT Gandhinagar * IIIT Delhi * IIIT Bangalore * IIIT Hyderabad * Iran University of Science and Technology<ref>{{Cite web|title=iust os|url=http://os-course.github.io/fall19/|access-date=2020-11-14|website=os-course.github.io}}</ref> * Johns Hopkins University<ref>{{cite web | url = http://gaming.jhu.edu/~phf/2015/fall/cs318/ | title = 600.318/418: Operating Systems | access-date = 2015-11-07 | archive-date = 2015-11-04 | archive-url = https://web.archive.org/web/20151104145926/http://gaming.jhu.edu/~phf/2015/fall/cs318/ | url-status = dead }}</ref> * Karlsruhe Institute of Technology<ref>{{cite web | url = https://os.itec.kit.edu/3942.php | title = Basispraktikum Betriebssystementwicklung, ST 2024 | access-date = 2024-11-13 | archive-date = 2024-10-04 | archive-url = https://web.archive.org/web/20241004060408/https://os.itec.kit.edu/3942.php | url-status = dead }}</ref> * Linnaeus University<ref>{{cite web | url = https://coursepress.lnu.se/kurs/operativsystem/ | title = 1DV201: Operating system | access-date = 2013-03-14 }}</ref> * Milwaukee School of Engineering * Motilal Nehru National Institute of Technology Allahabad * Nanyang Technological University<ref>{{Citation |title=CPS-research-group/ntu-sc2005-xv6 |date=2026-02-08 |url=https://github.com/CPS-research-group/ntu-sc2005-xv6 |access-date=2026-02-27 |publisher=CPS@NTU}}</ref> * National Taiwan University<ref>{{cite web |title=課程大綱 |url=https://nol.ntu.edu.tw/nol/coursesearch/print_table.php?course_id=902%2036700&class=01&dpt_code=9020&ser_no=86710&semester=109-2}}</ref> * National University of Córdoba<ref>{{cite web | url = http://www.famaf.proed.unc.edu.ar/course/view.php?id=171 | title = SistOp14: Operating Systems | access-date = 2015-08-06 }}</ref> * National University of Río Cuarto<ref>{{cite web | url = http://dc.exa.unrc.edu.ar/moodle/course/view.php?id=4 | title = Operating Systems | access-date = 2015-08-06 }}</ref> * New York University * Northeastern University<ref>{{cite web | url = http://www.ccs.neu.edu/course/cs3650/ | title = CS 3650: Computer Systems, Fall 2014 | access-date = 2014-12-09 }}</ref> * Northwestern University<ref>{{cite web | url = http://www.aqualab.cs.northwestern.edu/class/333-eecs343-xv6 | title = EECS 343: Operating System, Fall 2016–17 | access-date = 2018-11-11 | archive-date = 2018-10-24 | archive-url = https://web.archive.org/web/20181024043126/http://www.aqualab.cs.northwestern.edu/class/333-eecs343-xv6 | url-status = dead }}</ref> * Portland State University<ref>{{cite web | url = https://www.pdx.edu/computer-science/cs333 | title = CS 333 Introduction to Operating Systems | access-date = 2018-04-10 | archive-date = 2018-10-25 | archive-url = https://web.archive.org/web/20181025214315/https://www.pdx.edu/computer-science/cs333 | url-status = dead }}</ref> * Rutgers University<ref>{{cite web | url = http://www.cs.rutgers.edu/~iftode/cs416_2008.html | title = 01:198:416: Operating Systems Design | access-date = 2010-02-05 | archive-date = 2012-09-11 | archive-url = https://web.archive.org/web/20120911021940/http://www.cs.rutgers.edu/~iftode/cs416_2008.html | url-status = dead }}</ref> * RWTH Aachen University<ref>{{Cite web |title=Advanced Operating Systems – Operating Systems Teaching and Research Unit |url=https://www.os.rwth-aachen.de/teaching/aos.html |access-date=2025-10-13 |website=www.os.rwth-aachen.de}}</ref> * Slovak University of Technology in Bratislava<ref>{{Cite web|url=https://uim.fei.stuba.sk/predmet/b-os/|title=Operačné systémy|website=UIM|language=sk-SK|access-date=2019-10-28}}</ref> * Southern Adventist University<ref>{{cite web | url = http://www.southern.edu/academics/academic-sites/computing/ | title = School of Computing at Southern Adventist University | access-date = 2017-12-10 | archive-date = 2018-10-20 | archive-url = https://web.archive.org/web/20181020050115/http://www.southern.edu/academics/academic-sites/computing/ | url-status = dead }}</ref> * Stony Brook University<ref>{{Cite web|title=CSE 306 -- Course Information|url=https://bsd7.cs.stonybrook.edu/~cse306/syllabus.html|access-date=2021-04-14|archive-date=2023-04-13|archive-url=https://web.archive.org/web/20230413220114/https://bsd7.cs.stonybrook.edu/~cse306/syllabus.html|url-status=dead}}</ref> * Technion – Israel Institute of Technology<ref>{{cite web | url = https://moodle.technion.ac.il/course/view.php?id=642 | title = 094210 Computer Organization and Operating System, Spring 2020 | access-date = 2020-05-14}}</ref> * Télécom SudParis<ref>{{cite web | url = https://www-inf.telecom-sudparis.eu/COURS/CSC4508/Supports/ | title = CSC 4508 - Operating Systems | access-date = 2024-06-26}}</ref> * Tsinghua University<ref>{{cite web | url = http://os.cs.tsinghua.edu.cn/oscourse | title = FrontPage – OS Teaching Wiki | access-date = 2010-03-18 }}</ref> * Federal University of Minas Gerais<ref>{{cite web | url = http://homepages.dcc.ufmg.br/~cunha/teaching/20132/os.html | title = DCC605: Sistemas Operacionais | access-date = 2015-11-16}}</ref> * University College Dublin<ref>{{cite web | url = https://hub.ucd.ie/usis/!W_HU_MENU.P_PUBLISH?p_tag=MODULE&MODULE=COMP20180 | title = COMP20180 Intro to Operating Systems | access-date = 2023-04-04}}</ref> * University of Belgrade School of Electrical Engineering<ref>{{cite web | url = http://os.etf.bg.ac.rs/OS2/projekat/ | title = Operativni sistemi 2 - Projektni zadatak | language = sr-RS | access-date = 2021-11-20 | quote = Zadatak studenta je da izmeni deo operativnog sistem xv6 tako da podrži raspoređivače čije je opis dat u ovom projektu. | url-status = live | archive-url = https://web.archive.org/web/20200922143449/http://os.etf.bg.ac.rs/OS2/projekat/ | archive-date = September 22, 2020 }}</ref> * University of California, Irvine * University of California, Riverside<ref>{{cite web | url = http://www.cs.ucr.edu/~heng/teaching/cs202-fall17/ | title = CS 202: Advanced Operating System | access-date = 2017-12-02 }}</ref> * University of Delaware<ref>{{cite web | url = https://www.eecis.udel.edu/~cshen/361/ | title = CISC361: Operating Systems | access-date = 2025-03-31 }}</ref> * University of Hyderabad * University of Illinois at Chicago<ref>{{cite web | url = http://www.cs.uic.edu/CS385 | title = CS385 – Operating Systems Concepts and Design | access-date = 2015-03-18 | archive-date = 2021-09-21 | archive-url = https://web.archive.org/web/20210921113544/https://www.cs.uic.edu/CS385 | url-status = dead }}</ref> * University of Leeds<ref>{{Cite web|title=Module and Programme Catalogue|url=http://webprod3.leeds.ac.uk/catalogue/dynmodules.asp?Y=201718&M=COMP-2211|access-date=2020-10-14|website=webprod3.leeds.ac.uk}}</ref> * University of Modena and Reggio Emilia<ref>{{cite web | url = http://www.ingmo.unimore.it/site/home/didattica/insegnamento.html?P0_cds_cod=20-262&P0_aa_ord_id=2009&P0_pds_cod=20-262-1&P0_aa_off_id=2017&P0_lang=ita&P0_ad_cod=IIM-36&P0_aa_corso=1&P0_fac_id=10005&P0_coorte=2017&P0_pagpre=880010930 | title = Progettazione di Sistemi Operativi | access-date = 2017-10-09 | archive-date = 2021-09-21 | archive-url = https://web.archive.org/web/20210921112113/https://www.ingmo.unimore.it/site/home/didattica/insegnamento.html?P0_cds_cod=20-262&P0_aa_ord_id=2009&P0_pds_cod=20-262-1&P0_aa_off_id=2017&P0_lang=ita&P0_ad_cod=IIM-36&P0_aa_corso=1&P0_fac_id=10005&P0_coorte=2017&P0_pagpre=880010930 | url-status = dead }}</ref> * University of Otago<ref>{{cite web | url = http://www.cs.otago.ac.nz/cosc440/ | title = COSC440: Advanced Operating system | access-date = 2015-07-14 | archive-date = 2022-02-09 | archive-url = https://web.archive.org/web/20220209173604/http://www.cs.otago.ac.nz/cosc440/ | url-status = dead }}</ref> * University of Palermo<ref>{{cite web | url = https://classroom.google.com/c/MjQyMjM4ODM5 | title = Sistemi Operativi |access-date= 2015-10-18 }}</ref> * University of Pittsburgh<ref>{{Cite web|title=CS 1550 Introduction to Operating Systems (COE 1550) -Fall 2020|url=https://people.cs.pitt.edu/~skhattab/cs1550/|access-date=2020-09-28|website=people.cs.pitt.edu}}</ref> * University of Strasbourg<ref>{{cite web | title= Conception des Systèmes d'Exploitation | url=https://mathinfo.unistra.fr/formations/master/master-informatique/odf-parcours-science-et-ingenierie-des-reseaux-de-linternet-et-des-systemes-siris-PR12-18105/odf-cours-EN655-18105-PR12/}}</ref> * University of South Florida<ref>{{cite web | url= https://cse.usf.edu/~lohall/cop6611/ | title = COP6611 Operating Systems - Fall 2023}}</ref> * University of Tehran<ref>{{cite web | url = https://cecm.ut.ac.ir/course/view.php?id=2475 | title = Operating Systems instructed by Dr. Mehdi Kargahi }}{{Dead link|date=July 2025 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> * University of Texas at Austin<ref>{{Cite web |title=Master’s in Computer Science {{!}} Computer & Data Science Online |url=https://cdso.utexas.edu/mscs |access-date=2025-05-10 |website=cdso.utexas.edu}}</ref> * University of Utah<ref>{{cite web | url = https://utah.instructure.com/courses/272234 | title = CS 6460: Operating Systems | access-date = 2014-01-20 }}</ref><ref>{{cite web | url = http://blog.regehr.org/archives/1114 | title = Embedded in Academia : Xv6 | access-date = 2014-04-08 }}</ref> * University of Virginia<ref>{{cite web | url = https://www.cs.virginia.edu/~cr4bd/4414/S2022/xv6intro.html | title = CS4414: XV6 introduction | access-date = 2022-02-27}}</ref> * University of Wisconsin–Madison<ref>{{cite web | url = http://pages.cs.wisc.edu/~remzi/Classes/537/Fall2011/ | title = CS-537: Introduction to Operating Systems | access-date = 2011-11-04 }}</ref> * University of Kassel * Western University * Yale University<ref>{{cite web | url = http://zoo.cs.yale.edu/classes/cs422/2010/info | title = CS422/522: Operating Systems, Spring 2010 — Overview | access-date = 2010-02-05 | archive-date = 2012-07-23 | archive-url = https://web.archive.org/web/20120723215711/http://zoo.cs.yale.edu/classes/cs422/2010/info | url-status = dead }}</ref>

== References == {{reflist}}

== External links == * [https://pdos.csail.mit.edu/6.1810/ 6.1810: Operating Systems Engineering]

RISC-V: * [https://github.com/mit-pdos/xv6-riscv xv6 source code] * [https://github.com/mit-pdos/xv6-riscv-book xv6 book source code] * [https://pdos.csail.mit.edu/6.1810/2025/xv6/book-riscv-rev5.pdf xv6: a simple, Unix-like teaching operating system], xv6 book rev5. * [https://pdos.csail.mit.edu/6.1810/2025/xv6/xv6-src-booklet-rev5.pdf Printable version of the xv6 source code], rev5.

x86-32 ('''unmaintained'''): * [https://github.com/mit-pdos/xv6-public xv6 source code] * [https://github.com/mit-pdos/xv6-book xv6 book source code] * [https://pdos.csail.mit.edu/6.1810/2018/xv6/book-rev11.pdf xv6: a simple, Unix-like teaching operating system], xv6 book rev11. * [https://pdos.csail.mit.edu/6.1810/2018/xv6/xv6-rev11.pdf Printable version of the xv6 source code], rev11.

[https://xv6-64.gitlab.io/xv6-64/ x86-64] (maintained by University of Strasbourg): * [https://gitlab.com/xv6-64/xv6-64 xv6-64 source code] * [https://gitlab.com/xv6-64/xv6-64-book xv6-64 book source code (EN)] * [https://gitlab.com/xv6-64/xv6-64-book-fr xv6-64 book source code (FR)] * [https://xv6-64.gitlab.io/xv6-64-book/xv6-64-book.pdf xv6-64: a simple, Unix-like teaching operating system], xv6-64 EN book. * [https://xv6-64.gitlab.io/xv6-64-book-fr/xv6-64-book-fr.pdf xv6-64: un système d’exploitation simple, proche d’Unix, pour l’enseignement], xv6-64 FR book. * [https://xv6-64.gitlab.io/xv6-64/xv6-64.pdf Printable version of the xv6-64 source code]

{{Portal|Free and open-source software}} {{FLOSS}} {{unix-like}}

Category:Educational operating systems Category:Free software operating systems Category:Massachusetts Institute of Technology software Category:Software using the MIT license Category:Unix variants Category:X86 operating systems