mirror of the source code of the Xv6 operating system
C Shell C++ Assembly Objective-C Perl Other
Latest commit ff27834 Mar 4, 2013 @stephentu stephentu committed with aclements Correct a security bug in copyuvm()
copyuvm() should not allow new copied pages to inherit more
permissions than the original pages.
Permalink
Failed to load latest commit information.
.cvsignore update .cvsignore Oct 15, 2008
.dir-locals.el Setting indent-tabs-mode nil everywhere is dangerous Sep 5, 2011
.gdbinit.tmpl Use the symbol file Sep 21, 2009
.gitignore Sync up clean and gitignore better Sep 5, 2011
BUGS sh Sep 5, 2007
LICENSE Add MIT license file; update xv6-rev2.tar.gz with LICENSE. May 26, 2009
Makefile Prevent extra rebuild of fs.img by keeping intermediate object files. Oct 24, 2012
Notes nit in console interrupts Sep 7, 2006
README nits Aug 28, 2012
TRICKS more doc tweaks Jul 13, 2009
asm.h add some comments Aug 6, 2010
bio.c don't let dirty blocks be evicted from cache! Oct 14, 2011
bootasm.S comment nits Sep 12, 2011
bootmain.c Make the ELF entry point a physical address Sep 4, 2011
buf.h Revert "Introduce and use sleeplocks instead of BUSY flags" Aug 29, 2011
cat.c more consistent spacing Aug 28, 2007
console.c Remove unused 'state' variable that broke the build in recent gcc's Sep 7, 2011
cuth delete unnecessary #include lines Aug 27, 2007
defs.h Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6… Aug 23, 2012
dot-bochsrc make bochsrc work for bochs 2.2.6 Sep 3, 2008
echo.c Remove puts in favor of printf. Aug 24, 2007
elf.h Make elf proghdr fields match what objdump prints Aug 18, 2011
entry.S more regular kmap[] and description Sep 13, 2011
entryother.S Fix stale comments in entryother.S Sep 4, 2011
exec.c Remove unused argument to setupkvm (thanks to Peter Froehlich) Aug 23, 2012
fcntl.h nit Aug 28, 2007
file.c don't let dirty blocks be evicted from cache! Oct 14, 2011
file.h clarify some FS comments Oct 11, 2011
forktest.c Initial version of single-cpu xv6 with page tables Jul 2, 2010
fs.c more FS comment clarification Oct 11, 2011
fs.h clarify some FS comments Oct 11, 2011
gdbutil GDB utilities Nov 23, 2009
grep.c add grep; add lost echo Aug 28, 2007
ide.c make the book happy Aug 28, 2012
init.c group locks into structs they protect. May 31, 2009
initcode.S Remove sys_init syscall Aug 23, 2011
ioapic.c trap cleanup Jul 12, 2009
kalloc.c eliminate enter_alloc -- use kalloc for everything Sep 13, 2011
kbd.c be consistent: no underscores in function names Mar 8, 2009
kbd.h formatting; split kbd constants into kbd.h Aug 14, 2007
kernel.ld Nuke data.S, since we do have a custom linker script. Sep 2, 2011
kill.c tab police May 31, 2009
lapic.c Remove unused argument from lapicinit (thanks to Peter Froehlich) Aug 23, 2012
ln.c add ln Aug 22, 2007
log.c don't let dirty blocks be evicted from cache! Oct 14, 2011
ls.c Remove puts in favor of printf. Aug 24, 2007
main.c Remove unused argument from lapicinit (thanks to Peter Froehlich) Aug 23, 2012
memide.c missing file memide.c Jan 11, 2011
memlayout.h more regular kmap[] and description Sep 13, 2011
mkdir.c more consistent spacing Aug 28, 2007
mkfs.c Use static assert instead of _LP64 (thanks Eddie!) Sep 11, 2012
mmu.h Correct a security bug in copyuvm() Mar 4, 2013
mp.c Avoid "boot" in xv6 Aug 16, 2011
mp.h Simplify MP hardware code. Aug 27, 2007
param.h log write() data Aug 12, 2011
picirq.c Get rid of the blank page in picirq.c. It misaligs things now. Sep 2, 2010
pipe.c Revert "Introduce and use sleeplocks instead of BUSY flags" Aug 29, 2011
pr.pl remove //DOC in the right place Jul 13, 2009
printf.c spaces around else for rtm Aug 28, 2007
printpcs Various fixes and improvements to printpcs Aug 24, 2012
proc.c Remove unused argument to setupkvm (thanks to Peter Froehlich) Aug 23, 2012
proc.h junk Aug 28, 2012
rm.c more consistent spacing Aug 28, 2007
runoff Fetch nice font from font branch, if possible Sep 7, 2011
runoff.list Remove data.S from runoff, too Sep 2, 2011
runoff.spec Note about the meaning of sheet1 in runoff.spec Sep 6, 2011
runoff1 xv6: formatting, cleanup, rev5 (take 2) Feb 20, 2011
sh.c move jkstack to main.c Aug 5, 2010
show1 PDF at http://am.lcs.mit.edu/~rsc/xv6.pdf Aug 22, 2007
sign.pl spacing fixes: no tabs, 2-space indents (for rtm) Sep 6, 2006
sleep1.p Model verifying that wakeup really Oct 12, 2007
spinlock.c Revert "Introduce and use sleeplocks instead of BUSY flags" Aug 29, 2011
spinlock.h Revert "Introduce and use sleeplocks instead of BUSY flags" Aug 29, 2011
spinp Model verifying that wakeup really Oct 12, 2007
stat.h junk Aug 28, 2012
stressfs.c Update stressfs to trigger race now the logging code serializes writes Sep 27, 2011
string.c Use stosl in memset; makes boot time bearable Sep 1, 2011
swtch.S move jkstack to main.c Aug 5, 2010
symlink.patch symlink implementation Aug 30, 2007
syscall.c Remove left-over from some logging plan making complete syscalls atomic Aug 23, 2012
syscall.h Remove left-over from some logging plan making complete syscalls atomic Aug 23, 2012
sysfile.c Make fetchint and fetchstr use proc instead of taking a struct proc Feb 18, 2012
sysproc.c Avoid "boot" in xv6 Aug 16, 2011
timer.c shuffle and tweak for formatting. Aug 8, 2009
toc.ftr Update index example in TOC footer Sep 2, 2011
toc.hdr nits Aug 28, 2007
trap.c Map kernel high Jul 29, 2011
trapasm.S One definition of several macros and constants Aug 8, 2011
traps.h kill TLB shoot down code Jul 28, 2010
types.h some cleanup Jul 26, 2010
uart.c shuffle and tweak for formatting. Aug 8, 2009
ulib.c make new code like old code Jan 11, 2011
umalloc.c make new code like old code Jan 11, 2011
user.h make new code like old code Jan 11, 2011
usertests.c Fix compile error on newer gcc's Sep 30, 2011
usys.S uptime() sys call for benchmarking Aug 11, 2010
vectors.pl sync with c; .text is implied May 31, 2009
vm.c Correct a security bug in copyuvm() Mar 4, 2013
wc.c junk Aug 28, 2012
x86.h Remove unused x86.h definitions Sep 2, 2011
zombie.c delete unnecessary #include lines Aug 27, 2007

README

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 http://pdos.csail.mit.edu/6.828/2012/v6.html, 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
    Austin Clements

In addition, we are grateful for the patches contributed by Greg
Price, Yandong Mao, and Hitoshi Mitake.

The code in the files that constitute xv6 is
Copyright 2006-2012 Frans Kaashoek, Robert Morris, and Russ Cox.

ERROR REPORTS

If you spot errors or have suggestions for improvement, please send
email to Frans Kaashoek and Robert Morris (kaashoek,rtm@csail.mit.edu). 

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 http://pdos.csail.mit.edu/6.828/2012/tools.html.
Then run "make TOOLPREFIX=i386-jos-elf-".

To run xv6, you can use the Bochs or QEMU PC simulators. Bochs makes
debugging easier, but QEMU is much faster. To run in Bochs, run "make
bochs" and then type "c" at the bochs prompt. To run in QEMU, run
"make qemu".

To create a typeset version of the code, run "make xv6.pdf".  This
requires the "mpage" utility.  See http://www.mesa.nl/pub/mpage/.