top | item 3753216

Xv6 - Unix V6 rewritten in modern, ANSI C for MIT 6.828

86 points| duaneb | 14 years ago |pdos.csail.mit.edu

14 comments

order
[+] luriel|14 years ago|reply
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.

[+] duaneb|14 years ago|reply
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|14 years ago|reply
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".)

[+] jgn|14 years ago|reply
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|14 years ago|reply
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|14 years ago|reply
Do students at MIT actually write an OS or do they just do bedtime source code reading?
[+] sciurus|14 years ago|reply
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|14 years ago|reply
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/

[+] Nate75Sanders|14 years ago|reply
Haven't used LXR. I've used GNU GLOBAL and OpenGrok. I like OpenGrok.

There's a comparison (that includes LXR) on the OpenGrok site.

[+] skibrah|14 years ago|reply
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.