
Xv6, a simple Unix-like teaching operating system - rspivak
https://pdos.csail.mit.edu/6.828/2019/xv6.html
======
ipnon
Similar teaching operating systems include:

Blog OS, an operating system written in Rust constructed through a series of
independent tutorials.[0]

The CS140E embedded operating system.[1] This OS comes from an experimental
course taught by Dawson Engler at Standford. The instruction is lab-based with
no lectures. The student builds the OS on a Raspberry Pi through the use of
primary-source technical references like datasheets and ARM manuals.

[0] [https://os.phil-opp.com/](https://os.phil-opp.com/) [1]
[https://github.com/dddrrreee/cs140e-20win/](https://github.com/dddrrreee/cs140e-20win/)

~~~
monocasa
The nice thing about xv6 is it gets a lot farther to be a full OS. User mode,
ELF loader, an ascetic but usable system call table, etc.

~~~
pmiller2
If you want an even fuller OS for teaching purposes, early versions of Minix
were designed with teaching in mind, and there’s a book to go along with it.

~~~
monocasa
Yeah, but they used a much more confusing architecture for early Minix (16-bit
protected mode) that I'm of the opinion it obfuscates a lot of the underlying
concepts.

And xv6 has a book that goes along with it as well.

------
ros65536
PintOS is also a nice learning OS that's been used in classes. It is initially
incomplete and there are 4 projects to implement process schedulling, paging,
files. It simplifies the learning process since the hardware related
initialization code is already implemented and is readable enough to be
understood, while allowing you to focus on implementing the main ideas in OSs.
Currently I'm doing project 1 on my own. It would have been really nice if my
university offered me something like this, to have instructor feedback.

------
jeffrallen
Russ Cox was involved in this, and also Go. There are important connections
between them.

~~~
enitihas
Russ cox also wrote re2, an awesome regex library using finite automata, and
providing protection against regex match taking exponential time.

~~~
mesaframe
>regex library using finite automata

Ehh

~~~
dbmueller
>>regex library using finite automata >Ehh

By which you mean?

~~~
russtrotter
I remember learning RE in the context of finite automata so I'm gathering that
they are questioning the novelty of that implementation strategy?

~~~
guerrilla
It's essential to it. Literally computer science 101

------
gnunez
The MIT Operating Systems opencourseware class labs has some great exercises
when learning about operating systems[0]. I've also found older linux kernels,
like v1.0, are easier to follow for learning [1].

[0][https://ocw.mit.edu/courses/electrical-engineering-and-
compu...](https://ocw.mit.edu/courses/electrical-engineering-and-computer-
science/6-828-operating-system-engineering-fall-2012/labs/)

[1][https://mirrors.edge.kernel.org/pub/linux/kernel/v1.0/](https://mirrors.edge.kernel.org/pub/linux/kernel/v1.0/)

------
lcall
For some purposes, I wonder if OpenBSD would also be a strong candidate for
learning about operating systems, given their focus on correctness, openness,
portability, etc., and the fact that everything learned then becomes useful on
a fully general-purpose OS that one could use in the long term (ie, _lots_ of
headroom, less need to start over for learning some things, somewhere else).

The quality and good order of the documentation in particular makes it less or
not necessary to go doing web searches etc to find out how to do things, but
they take one in an orderly progression from installation, via FAQs and
excellent manual pages, all the way along to useful development info.

~~~
Koshkin
OpenBSD is _huge_ (just like any general-purpose OS would be today). It's not
a "teaching OS."

Minix would be a better alternative, IMHO.

~~~
cat199
agree - possibly any of the BSD's might be a good follow up for 'advanced'
study since the codebase & kernel structures have a direct lineage. Maybe
doing the 'base' course on like 4.2BSD which is still smaller and close to v7
might make sense

~~~
beefhash
4.4BSD-Lite2 is the earliest they could do without risking some legal
issues[1].

[1] [https://virtuallyfun.com/wordpress/2018/11/26/why-bsd-os-
is-...](https://virtuallyfun.com/wordpress/2018/11/26/why-bsd-os-is-the-best-
candidate-for-being-the-only-tested-legally-open-unix/)

------
tyingq
Apparently noteworthy because late last year they ported the original x86 to
RISC-V.

------
dang
Previous discussions at
[https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...](https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=comments%3E0%20Xv6&sort=byDate&type=story&storyText=none)

(Reposts are ok after a year or so:
[https://news.ycombinator.com/newsfaq.html](https://news.ycombinator.com/newsfaq.html))

------
johnmarcus
What am I supposed to do with it?

~~~
jmiskovic
The included textbook is _really_ good introduction to systems programming. I
highly recommend taking a look if you are interested in kernel programming or
interaction between OS.

~~~
johnmarcus
thank you, that's useful information of what this is.

