4 ms·
As abecedarius says, there's a good commentary on it in the Lions book (https://en.wikipedia.org/wiki/Lions'_Commentary_on_UNIX_6th_Edition,_with_Source_Code ht
by pm215 10y ago
As abecedarius says, there's a good commentary on it in the Lions book (https://en.wikipedia.org/wiki/Lions'_Commentary_on_UNIX_6th_Edition,_with_Source_Code https://en.wikipedia.org/wiki/Lions'_Commentary_on_UNIX_6th_...). That was reprinted in the late 90s when I was at university and I read through it then. I think it is worthwhile still, with caveats. The C dialect is ancient (pre-K&R), some of the algorithms are rather naive, and the whole thing is "oriented towards a machine that is little more than a memory", to quote the reprint's introduction. That said, the commentary is excellent (giving enough hints to enlighten but often requiring you to work through the detail yourself as a teaching mechanism), and the whole thing is real production code that gives you a feel for how a complete Unix-ish kernel is structured (which still applies to modern kernels, much as a housecat and an elephant have clear skeletal similarities despite massive differences in scale and features).
xv6 (https://en.wikipedia.org/wiki/Xv6 https://en.wikipedia.org/wiki/Xv6) is a modern (x86/ANSI C) but similarly sized kernel designed for teaching purposes and to avoid the awkward obsolete-architecture-and-compiler aspects of the original 6th Ed code. If you can live with the PDP-11 assembly and ancient C (and not being able to run the code) I'd recommend the original, though.
- aap_ 10y agoWho says you can't run the code? Sure, few people have a real PDP-11/{40,45,70} these days but if you only care about the software using an emulator is perfectly acceptable.