Hacker News new | ask | show | jobs
by gamesurgeon 3875 days ago
I'm a student at Johns Hopkins, and we're using xv6 in our OS course this semester: http://gaming.jhu.edu/~phf/2015/fall/cs318/

xv6 is pretty awesome for learning, and lecture is generally spent reading through the source code, some of which is...cute.

Most of us have the source code printed out. If you're interested in reading the source, this document is well-formated: https://pdos.csail.mit.edu/6.828/2014/xv6/xv6-rev8.pdf (and can actually be generated by the Makefile!)

3 comments

I went through my school's version of this class on xv6, and wow, what a trip. After thinking hard and working hard on things I never had a solid grasp on - filesystems, virtual memory, interrupts, multitasking - I now appreciate and understand things going on after a call to fork() or exec().

For my final project I implemented a simple threading library based on the interface that pthread() uses. It's amazing how beautifully simple kernels can be.

So the ls and make and all those tools; where do they come from? Are they straight compiles using GNU gcc tools etc?

I only ask because I have no idea how much is the kernel compared to everything else; and if it has its own custom compiler or whatever.

No, they are minimal versions written for the OS. Here is ls[0] and cat[1]. You can compile with GCC.

[0] http://www.ccs.neu.edu/course/cs3650/unix-xv6/HTML/S/64.html [1] http://www.ccs.neu.edu/course/cs3650/unix-xv6/HTML/S/42.html

I wonder if a suitably minimalist C compiler (along the lines of C4[1] or C4x86[2], although perhaps a bit more featured) and/or assembler to go along with it would be a neat idea too - now you can have a complete self-bootstrapping OS which one person can easily understand.

[1] https://news.ycombinator.com/item?id=8558822

[2] https://news.ycombinator.com/item?id=8746054

By reading `cat`, how come that error messages are printend on standard output and the exit code is always 0? stderr and exit codes are not implemented/used in xv6?
Northeastern (my school, currently...) uses it as well. A quick search leads me to believe many schools do. Wonderful learning tool. Also fun to try to port to non-x86 :)
OP article lists a lot of schools using it as well.