Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple mirror for xv6 tested on every Ubuntu version.
C Assembly Shell Perl Other
branch: master

Make fetchint and fetchstr use proc instead of taking a struct proc

Previously, these were inconsistent: they used their struct proc
argument for bounds checking, but always copied the argument from the
current address space (and hence the current process).  Drop the
struct proc argument and always use the current proc.

Suggested by Carmi Merimovich.
latest commit 9d59eb0151
@aclements aclements authored
Failed to load latest commit information.
.cvsignore update .cvsignore
.dir-locals.el Setting indent-tabs-mode nil everywhere is dangerous
.gdbinit.tmpl Use the symbol file
.gitignore Sync up clean and gitignore better
BUGS sh
LICENSE Add MIT license file; update xv6-rev2.tar.gz with LICENSE.
Makefile Re-alphabetize OBJS
Notes nit in console interrupts
README Update year in URL
TRICKS more doc tweaks
asm.h add some comments
bio.c don't let dirty blocks be evicted from cache!
bootasm.S comment nits
bootmain.c Make the ELF entry point a physical address
buf.h Revert "Introduce and use sleeplocks instead of BUSY flags"
cat.c more consistent spacing
console.c Remove unused 'state' variable that broke the build in recent gcc's
cuth delete unnecessary #include lines
defs.h Make fetchint and fetchstr use proc instead of taking a struct proc
dot-bochsrc make bochsrc work for bochs 2.2.6
echo.c Remove puts in favor of printf.
elf.h Make elf proghdr fields match what objdump prints
entry.S more regular kmap[] and description
entryother.S Fix stale comments in entryother.S
exec.c I can't do math; fix bug introduced in 5a9761
fcntl.h nit
file.c don't let dirty blocks be evicted from cache!
file.h clarify some FS comments
forktest.c Initial version of single-cpu xv6 with page tables
fs.c more FS comment clarification
fs.h clarify some FS comments
gdbutil GDB utilities
grep.c add grep; add lost echo
ide.c clarify some FS comments
init.c group locks into structs they protect.
initcode.S Remove sys_init syscall
ioapic.c trap cleanup
kalloc.c eliminate enter_alloc -- use kalloc for everything
kbd.c be consistent: no underscores in function names
kbd.h formatting; split kbd constants into kbd.h
kernel.ld Nuke data.S, since we do have a custom linker script.
kill.c tab police
lapic.c Fix weird pagebreak bug
ln.c add ln
log.c don't let dirty blocks be evicted from cache!
ls.c Remove puts in favor of printf.
main.c Use | instead of + for entrypgdir. Linker doesn't get in our way here.
memide.c missing file memide.c
memlayout.h more regular kmap[] and description
mkdir.c more consistent spacing
mkfs.c Dirt simple logging
mmu.h Fix layout issues for printed version
mp.c Avoid "boot" in xv6
mp.h Simplify MP hardware code.
param.h log write() data
picirq.c Get rid of the blank page in picirq.c. It misaligs things now.
pipe.c Revert "Introduce and use sleeplocks instead of BUSY flags"
pr.pl remove //DOC in the right place
printf.c spaces around else for rtm
proc.c fix usertests to correctly test what happens when you call
proc.h Avoid "boot" in xv6
rm.c more consistent spacing
runoff Fetch nice font from font branch, if possible
runoff.list Remove data.S from runoff, too
runoff.spec Note about the meaning of sheet1 in runoff.spec
runoff1 xv6: formatting, cleanup, rev5 (take 2)
sh.c move jkstack to main.c
show1 PDF at http://am.lcs.mit.edu/~rsc/xv6.pdf
sign.pl spacing fixes: no tabs, 2-space indents (for rtm)
sleep1.p Model verifying that wakeup really
spinlock.c Revert "Introduce and use sleeplocks instead of BUSY flags"
spinlock.h Revert "Introduce and use sleeplocks instead of BUSY flags"
spinp Model verifying that wakeup really
stat.h move T_DIR etc into stat.h; move type up
stressfs.c Update stressfs to trigger race now the logging code serializes writes
string.c Use stosl in memset; makes boot time bearable
swtch.S move jkstack to main.c
symlink.patch symlink implementation
syscall.c Make fetchint and fetchstr use proc instead of taking a struct proc
syscall.h Remove sys_init syscall
sysfile.c Make fetchint and fetchstr use proc instead of taking a struct proc
sysproc.c Avoid "boot" in xv6
timer.c shuffle and tweak for formatting.
toc.ftr Update index example in TOC footer
toc.hdr nits
trap.c Map kernel high
trapasm.S One definition of several macros and constants
traps.h kill TLB shoot down code
types.h some cleanup
uart.c shuffle and tweak for formatting.
ulib.c make new code like old code
umalloc.c make new code like old code
user.h make new code like old code
usertests.c Fix compile error on newer gcc's
usys.S uptime() sys call for benchmarking
vectors.pl sync with c; .text is implied
vm.c eliminate enter_alloc -- use kalloc for everything
wc.c more consistent spacing
x86.h Remove unused x86.h definitions
zombie.c delete unnecessary #include lines

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/2007/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 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-2011 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/2011/tools.html.
Then run "make TOOLPREFIX=i386-jos-elf-".

To run xv6, you can use Bochs or QEMU, both 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/.
Something went wrong with that request. Please try again.