
Xv6 – A Simple Unix-Like Teaching Operating System - jcr
http://pdos.csail.mit.edu/6.828/2014/xv6.html
======
userbinator
Combine this with one of those tiny self-compiling C compilers that were the
subject of a few HN articles recently (e.g.
[https://news.ycombinator.com/item?id=8576068](https://news.ycombinator.com/item?id=8576068),
[https://news.ycombinator.com/item?id=8558822](https://news.ycombinator.com/item?id=8558822))
and this could be one of the more interesting minimal self-hosting OSs someone
could understand the entirety of in a relatively short amount of time. I like
how it supports multiprocessing too, and the entire kernel is <100 pages in
the source code PDF.

However, I wish they'd use something other than GAS for the Asm parts... a
minimal self-assembling assembler (and a C-subset compiler written in it, to
bootstrap the whole thing) would be nice.

~~~
webkike
None of the tiny self-compiling C compilers could possibly used to compile
xv6, as none of them implement structures (arguably the hardest part of
compiling C code).

~~~
lamacase
The guy who did the C4 compiler also has a more fully featured one that does
support structures:

[https://github.com/rswier/swieros/blob/master/root/bin/c.c](https://github.com/rswier/swieros/blob/master/root/bin/c.c)

It's part of an OS he's building based on xv6

~~~
webkike
Very cool, although this implementation is significantly less trivial than C4.
The difference is over a thousand lines!

------
lifeisstillgood
I suspect this is a common feeling, but boy did I waste my time at university.
Spent it running a bar, chasing women instead of knuckling down and doing
things like this - I would love to take a year off and go back and just learn
again.

It's probably a case of the grass is greener, I could find more time if I
really wanted. Anyway, I had a helluva great time. Should have attend some
lectures though ...

Hmm, less than 10,000 lines of C (quite a lot less). Has anyone any experience
of this OS/ course ? Could you comment?

~~~
zellyn
You can keep learning, just slowly. But it works: I decided a while ago to go
back and learn the parts of CS that I skipped that felt unreachably wizardly
to me. I'm currently working, _very slowly_ , through the excellent Coursera
compilers class, 25 minutes at a time on the bus to and from work. I say go
for it :-)

~~~
cpach
I recently started to bring my laptop when travelling on the subway. It’s very
nice to see that one can actually make progress (albeit slowly) on a project
even with just 50 minutes a day (or less). 'patio11 inspired me :)

------
6828student
The other part of this class is JOS, which is the other operating system from
6.828. xv6 is provided mostly complete while JOS has holes missing which
students complete. You can find the labs where students complete the operating
system online, and I'm sure you can probably find the source as well (though
it's not officially provided like xv6).

~~~
jbapple
> I'm sure you can probably find the source as well (though it's not
> officially provided like xv6).

Listed on some course webpage was this:

[http://pdos.csail.mit.edu/6.828/2014-jos.git](http://pdos.csail.mit.edu/6.828/2014-jos.git)

~~~
6828student
That's the current repo for the skeleton code for the labs. It might get
deleted when the semester ends (it also won't boot as is).

~~~
jbapple
I see. How is it different from what students in 6828 have access to? Do they
(you?) have access to skeleton code that boots?

~~~
6828student
This the current repo (I pull from this). The skeleton needs code that the
students write in labs in order to boot.

You can find the labs right now under the lab tab of
[http://pdos.csail.mit.edu/6.828/2014/](http://pdos.csail.mit.edu/6.828/2014/)

------
maaku
Why not.. MINIX?

~~~
japr59
It wouldn't be a bad idea to use both. It could be nice to study a monolithic
kernel-based OS (xv6) and a microkernel-based OS (MINIX). In 6.828, we read
xv6, and we implemented parts of JOS, which is exokernel-based. Since
exokernels are kind of like microkernels on steroids, I suppose it makes sense
that we didn't focus on normal microkernels too much.

