I completely agree.  Studying and >>learning<< from V6 allows you to consider the basics of what any good OS, no just a UNIX-like system, has to do provide simple but complete services.  Examining V6 not most of the things you find today removes a lot of the noise, like threading, parallel execution, vm, networking, which are fine topics for later, but Warner is right - get a solid understanding first.  It also helps to understand what makes 'UNIX-ness' and why it was different from anything before it came on the scene.

BTW: It' why I still like Pascal (Delphi) over C or C++ as a first language (I admit, I'm leaning towards Go these days, but Go lacks a good teaching text).  This is what I heard Doug saying.   IMO:  Lion's book and the V6, can be considered 'old' by contemporary standards, but they are still 100% appropriate and because the book and code is so simple, the teacher and the student can focus on what really matters (i.e. learning to walk carefully in a directed manner and get to your destination before you are forced to run with the bulls and avoid getting run over).

On Fri, Jan 17, 2020 at 11:01 AM Warner Losh <imp@bsdimp.com> wrote:


On Fri, Jan 17, 2020 at 8:24 AM Larry McVoy <lm@mcvoy.com> wrote:
On Fri, Jan 17, 2020 at 09:50:24AM -0500, Clem Cole wrote:
> 6th Edition is clear and if you want to understand what it takes and how it
> works, John's commentary it difficult to beat.

It's a good starting point but it's pretty outdated.  I like to go on and
on about how much I love the SunOS 4.x kernel but it is outdated as well.

I wish there was a v6/SunOS like kernel that was as clean but had good
support for SMP and NUMA and TCP offload (and probably a long list of
other useful stuff I've forgotten).

Teaching kids how a single threaded kernel works is cool but it's
also misleading, the world has gotten a lot more complex.  And while
the kernels of decades ago were clean and simple, I don't know of
a kernel to point people to that has the clean code that SunOS had.
Solaris isn't it, though it has some bright spots.  Linux is meh, it's
better than nothing by a lot but I would not point to it as "read this,
kid, you'll see the architecture".  It's not clear there is a good
answer.

It's but the first step on the road to understanding. I'd been working on the FreeBSD kernel for years when I re-read the Lions book. The stark simplicity of the v6 kernel helped everything suddenly 'click' into place in the code I was reading in the FreeBSD kernel, even with 30ish years of changes to the v6 code base that lead to the FreeBSD kernel...

Newer systems are a lot more complicated. And they need to be to get the full performance out of the system. Yet understanding the basics without the extra clutter has great value.

Warner