
Xv6 - Unix V6 rewritten in modern, ANSI C for MIT 6.828 - duaneb
http://pdos.csail.mit.edu/6.828/2011/xv6.html
======
luriel
Another really cool project by Russ Cox, is amazing how prolific he is.

A related project of his that might be of interest to people learning about
kernel programming is the documented history of the Plan 9 kernel:
<http://swtch.com/plan9history/>

This post is going to seem a bit fanboyis, but over the years I had some
(rather violent) disagreements with Russ and is easy to forget how much stuff
he has done, so it was time to remember some of his awesome work.

Now he seems to be spending most of his time hacking on Go (
<http://golang.org> ) but just from the last few years some of major projects
where he has been the main driving force:

* Plan 9 from User Space - Port of the Plan 9 User Space to Unix systems. <http://plan9.us>

* vx32 - Virtualization similar to NaCL, and ported the Plan 9 kernel to run on it. <http://pdos.csail.mit.edu/~baford/vm/>

* Google Code Search, now sadly shut down, but he open sourced the core of the engine. <http://code.google.com/p/codesearch/>

* RE2 regexp engine - <http://code.google.com/p/re2/>

And other smaller projects (I'm sure I forget many more):

* libtask coroutines library for C - <http://swtch.com/libtask/>

* Foundation storage system - <http://doc.cat-v.org/plan_9/misc/foundation/>

Before that he was heavily involved with Plan 9 at Bell Labs, being
responsible for much of the graphics system (which later was the model for
Xrender), storage(venti/fossil), auth/security(factotum/secstore), and all
kinds of other work all over the place.

------
Confusion
Link to previous topic [1] and the booklet [2]

[1] <http://news.ycombinator.com/item?id=3212515>

[2] <http://pdos.csail.mit.edu/6.828/2011/xv6/xv6-rev6.pdf>

~~~
mdwrigh2
And the actual book for the course [1]

[1] <http://pdos.csail.mit.edu/6.828/2011/xv6/book-rev6.pdf>

------
duaneb
I managed to get it compiled entirely with clang, but for the fact that clang
doesn't have 16-bit assembler support (yet).

I really like it for the fact that it's the bare essentials of a complete
kernel. When wondering how, for example, scheduling works, this is a much
better idea on how the mechanics work. Obviously, the algorithms used might be
far more sophisticated in a modern, production kernel, but that's not why you
would use X6v.

~~~
lubutu
It's "Xv6", not "X6v", btw. It's a kind of portmanteau of x86 and V6.

Edit: (For context, the submission title was originally "X6v".)

~~~
duaneb
Yes, thank you.

------
jgn
I came across this in my intro to systems class and thanked the stars. For
someone who loves C and systems programming, the Linux kernel can still be
overwhelming. This is an awesome way for a kernel newbie to tackle a code base
they can handle and see the real effects of their code.

------
H_E_Pennypacker
This was posted not to long ago, but I think it's absolutely fantastic. It's
like restoring a classic ford pickup, but tossing in an AC unit and some new
brakes.

------
andresdouglas
Do students at MIT actually write an OS or do they just do bedtime source code
reading?

~~~
sciurus
I was wondering the same thing. At Emory we were handed a few M68K assembly
routines but hand to crank out the rest of the OS ourselves.

It looks like MIT does something similar. They study xv6 but have to implement
an OS with different specifications. See
<http://pdos.csail.mit.edu/6.828/2011/overview.html>

------
cientifico
Will be nice to have a Cross Reference of the code, to be able to give it a
view. Something like:

<http://sourceforge.net/projects/lxr/>

~~~
duaneb
I heartily agree. In the meantime, the PDF print of the code isn't bad:
<http://pdos.csail.mit.edu/6.828/2011/xv6/xv6-rev6.pdf>

------
skibrah
we use this as the basis of our OS course at Columbia. It helps you get an
understanding of how an operating system works without having to wade through
tons of code.

