Really cool project. Older, simpler, unixes are surprisingly relevant for undergrad-level learning.
It reminds me of my OS class in my undergrad days. We skipped a few bits by using the JVM to get a few things for free, but we still had to write (as groups of 3-5 people) an entire unix-like, complete with user-space programs, messaging systems, etc.
Definitely one of the most valuable classes I took for my degree.
That reminds me, I stumbled upon the website of the
Unix Heritage Society (http://www.tuhs.org/) which has the source code for the early versions of Unix.
I only wish that there was an add-on tcp/ip stack for that version, then one could really have fun with it. Yes, I know, the ip stack add on is called BSD.
Because splatting object files and intermediates all over the same directories as the source drives me nuts, I shuffled things so that it's a bit easier to find things (splitting source into kernel/, user/, ulib/, tools/, and include/ directories) and generated files are collected into kobj/, uobj/, out/, and fs/ directories.
I remember in the pre-Pentium II days people cared rather little about power consumption (TDPs were only a few watts or maybe a dozen at most), and the idle process was basically a very tight infinite loop.
Around the time of the PII people (especially overclockers) started noticing that the CPU would stay cooler when halted, and thus started a little industry of "CPU cooling software"... there's an interesting historical page on that here:
A modern processor, on the other hand, takes a few watts halted and a hundred or more when active, and transitions between these states many many times per second. How much things have changed...
xv6 is a pleasure to hack on and learn from! It's got everything you'd expect from a unix-like OS (multi-processor support, simple scheduler, unix-like FS, many of the standard syscalls, fork/exec based shell, etc).
Linux and *BSD may be the modern standard for unix-like OSes, but they're often too complex and opaque for beginners to learn from. It's super easy to read and toy with xv6's code if you want to learn more about OS internals, though. For example, I was able to implement a simple log structured file system: https://github.com/Jonanin/xv6-lfs
Note: if you're looking for companion reading material, check out this OS book: http://pages.cs.wisc.edu/~remzi/OSTEP/ (IMO it's super approachable and understandable for undergrad-level learning)
Shame this is getting downvoted, probably by people who don't understand the reference. See the second section ("You are not expected to understand this") in: http://cm.bell-labs.com/cm/cs/who/dmr/odd.html
I wonder how this compares to pintos (http://www.stanford.edu/class/cs140/projects/pintos/pintos_1...) which is an i386 unix like OS. In my under grad class we had to build thread scheduling, sys calls, virtual memory, and some file system functionality on top of pintos. It was the most challenging and most interesting set of projects I've ever completed.
At the risk of reigniting an old flame war, it seems to me that a microkernel in which core OS functions such as process management and the virtual file system are in separate servers would be more complicated than a monolithic kernel. Having device drivers and specific file systems in user space may be useful, though.
Awesome! I really hope MIT releases video lectures for 6.828 so I can do the full course on my own. I'm listening to Berkeley's OS lectures right now but I would love a course built around xv6.
For anyone else who is playing with this in OS X Mavericks, I've written a blog post describing how to get things working on it (there are a couple steps that need to be tweaked.) - http://blog.ljs.io/post/71424794630/xv6
Hopefully this is useful to somebody and isn't too blatantly link whorey :)
It's multiboot, so you can just boot it from grub.efi. See sheet 10, xv6/entry.S.
The more annoying thing is likely to be that it's 32-bit only. Are there any common machines that do x86-32 UEFI boot? Alternatively, does a 64-bit grub.efi know how to exit long mode and go into protected mode, to multiboot a 32-bit kernel?
(I was actually talking the other day with some folks about whether a 6.828 project involving a UEFI port of JOS, the other teaching OS, would make sense, but the 64-bit thing seemed to make it less interesting unless you also plan to do a 64-bit port of JOS. Which has been done before in a final project, admittedly...)
Were using the Xv6 kernel for the OS class here at the university of Utah, for the first time. In my opinion an OS class that makes you hack on low level code is significantly more beneficial tha just a theroy class.
If "Xv6's use of the x86 [is intended to make] it more relevant to students' experience," then why use AT&T assembly language syntax rather than Intel?
[+] [-] bane|12 years ago|reply
It reminds me of my OS class in my undergrad days. We skipped a few bits by using the JVM to get a few things for free, but we still had to write (as groups of 3-5 people) an entire unix-like, complete with user-space programs, messaging systems, etc.
Definitely one of the most valuable classes I took for my degree.
[+] [-] btian|12 years ago|reply
[+] [-] csense|12 years ago|reply
[+] [-] kirbyk|12 years ago|reply
[+] [-] luckydude|12 years ago|reply
Also met Doug, he's a great guy, old school C hacker.
[+] [-] n1cked|12 years ago|reply
[+] [-] adamnemecek|12 years ago|reply
Here is the first version
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1
I did not really spend enough time reading the source to understand what's going on but it's interesting regardless.
[+] [-] derekp7|12 years ago|reply
I only wish that there was an add-on tcp/ip stack for that version, then one could really have fun with it. Yes, I know, the ip stack add on is called BSD.
[+] [-] swetland|12 years ago|reply
https://github.com/swetland/xv6
I also tweaked the scheduler to halt if there's nothing to schedule, per tankenmate's suggestion.
A side-effect of this change is the generate-source-code-printout targets were rather severely broken, so they're simply removed for the moment.
[+] [-] tankenmate|12 years ago|reply
http://pastebin.com/BxXDDtTh
[+] [-] userbinator|12 years ago|reply
Around the time of the PII people (especially overclockers) started noticing that the CPU would stay cooler when halted, and thus started a little industry of "CPU cooling software"... there's an interesting historical page on that here:
http://estu.nit.ac.jp/~e982457/other/cpuidle/idle.htm
A modern processor, on the other hand, takes a few watts halted and a hundred or more when active, and transitions between these states many many times per second. How much things have changed...
[+] [-] swetland|12 years ago|reply
if (p == &ptable.proc[NPROC]) hlt();
after the sti() and initializing p to 0;
[+] [-] akkartik|12 years ago|reply
[+] [-] oscargrouch|12 years ago|reply
>Frans Kaashoek ([email protected])
>Robert Morris ([email protected])
sh$%t, this got to be good!
Cloning the repo and surfing at the source code, just for fun, right now :)
[+] [-] Jonanin|12 years ago|reply
Linux and *BSD may be the modern standard for unix-like OSes, but they're often too complex and opaque for beginners to learn from. It's super easy to read and toy with xv6's code if you want to learn more about OS internals, though. For example, I was able to implement a simple log structured file system: https://github.com/Jonanin/xv6-lfs
Note: if you're looking for companion reading material, check out this OS book: http://pages.cs.wisc.edu/~remzi/OSTEP/ (IMO it's super approachable and understandable for undergrad-level learning)
[+] [-] kps|12 years ago|reply
[+] [-] bodyfour|12 years ago|reply
[+] [-] capkutay|12 years ago|reply
[+] [-] merkury7|12 years ago|reply
MINIX (http://www.minix3.org/)
[+] [-] mwcampbell|12 years ago|reply
[+] [-] blt|12 years ago|reply
[+] [-] ash|12 years ago|reply
http://pdos.csail.mit.edu/6.828/2011/schedule.html
[+] [-] __mp|12 years ago|reply
[+] [-] singular|12 years ago|reply
Hopefully this is useful to somebody and isn't too blatantly link whorey :)
[+] [-] mjg59|12 years ago|reply
[+] [-] swetland|12 years ago|reply
Also it looks like they mostly run it in qemu.
[+] [-] geofft|12 years ago|reply
The more annoying thing is likely to be that it's 32-bit only. Are there any common machines that do x86-32 UEFI boot? Alternatively, does a 64-bit grub.efi know how to exit long mode and go into protected mode, to multiboot a 32-bit kernel?
(I was actually talking the other day with some folks about whether a 6.828 project involving a UEFI port of JOS, the other teaching OS, would make sense, but the 64-bit thing seemed to make it less interesting unless you also plan to do a 64-bit port of JOS. Which has been done before in a final project, admittedly...)
[+] [-] userbinator|12 years ago|reply
[+] [-] chris_wot|12 years ago|reply
http://pdos.csail.mit.edu/6.828/schedule.html
It should be:
http://pdos.csail.mit.edu/6.828/2012/schedule.html
[+] [-] Moral_|12 years ago|reply
[+] [-] contingencies|12 years ago|reply
[+] [-] csense|12 years ago|reply
[+] [-] rsc|12 years ago|reply
[+] [-] samograd|12 years ago|reply