Text and supporting code for Think OS: A Brief Introduction to Operating Systems, by Allen Downey.