Tuesday, January 28, 2014

The Case for Free Online Books (FOBs): Experiences with "Operating Systems: Three Easy Pieces"

Abstract: This article is a short (well, not that short) summary of our experiences in writing a free online text book known as Operating Systems: Three Easy Pieces (OSTEP for short, and sometimes pronounced "oh step"). It has been developed by myself (Remzi Arpaci-Dusseau) and my wife (Andrea Arpaci-Dusseau) over the past many years while teaching CS 537, the undergraduate Operating Systems course at the University of Wisconsin-Madison. The chapters of the book have been downloaded over 1/2 million times since 2012, and the web page for the book has been viewed nearly 3 million times in the past year, including a recent burst thanks to Hacker News and Reddit. In discussing our experiences, we make the case for Free Online Books (FOBs) - a now-serious alternative to classic printed textbooks.

In The Beginning: Some Problems

The entire textbook-publishing business has always bothered me, especially when it comes to Computer Science textbooks. Why, you ask? Let me count the ways:
  • Price. Easily the single most common complaint I hear about CS textbooks is that they are simply too expensive. Paying over $100 for a book is painful, especially when compared to "normal" books. For example, you can get Cloud Atlas (one of the most wonderful works of fiction I've ever read) for $10 in softcover, but a textbook on some rarified topic costs more than ten times that?
  • Needless Edition Churn. Textbooks are forced to go through repeated faux updates, leading to an explosion of "new" editions. The reasons for this are clear (hint: it's price again). If book publishers simply let the free market work its magic, the used book market would solve the price problem fairly neatly. By forcing students to get the latest edition, the new book market is artificially propped up. 
  • Quality. Sadly, many CS textbooks are not of particularly high quality. Don't get me wrong, there are some wonderful books out there: I remember falling in love with Hennessy and Patterson's Computer Architecture: A Quantitative Approach (first edition) back when I was an undergraduate, and some other books - like Bryant and O'Halloran's Computer Systems: A Programmer's Perspective or David Culler's Parallel Computer Architecture - are also awesome and full of information. Unfortunately, not all books in CS are like these gems: there are many books that are just "OK", and many that are worse. 
So let's summarize: Classic printed books cost too much; students can't buy used editions because publishers force needless revisions; many CS books aren't particularly great. Seems like students actually want the opposite: high-quality, low-cost books. Or, failing that, at least one of those!

[credit http://www.ecobabysteps.com/wp-content/uploads/2012/10/at-what-cost-quality.jpg]

When you type "high-quality, low-cost" into Google Image search, this is what you get. Brought to you by the folks at ecobabysteps.com. What in the world are they doing to the dolls at ecobabysteps.com

My Own Story

I first came into contact with this high-cost/low-quality problem as a student (mostly as an undergraduate at Michigan, and somewhat, though less so, in graduate school at Berkeley), but I had little control or choice at that time: I learn better from reading than from attending class, so I bought every book that I could, and sometimes even bought extra books to learn more on my own. And I was lucky: born into a family where I could afford these luxuries.

It was as a professor that the problem came into sharper focus. I started teaching operating systems courses at Wisconsin in January of 2000 and have been doing so nearly non-stop since (my wife does the same, and we co-lead a research group focusing mostly on file and storage systems). For the graduate class (CS 736), there is no problem: students just read papers, and these (thankfully) are generally available on the web at no cost. Where book gouging started to become a problem was in the Introduction to Operating Systems class (CS 537) - a class most undergraduates in Computer Science or Engineering take during their stint at Wisconsin.

During the first so many years of teaching the class, I (and my wife, Andrea) tried many of the classic textbooks. You know which ones they are: Silberschatz, Tannenbaum, Nutt, Dietel & Dietel, etc. We required the students to buy the book, lectured on topics as we saw fit, and pointed students to relevant book chapters. 

I noticed a trend in student feedback about the books: regardless of which book we chose, most students would complain that they didn't like the book very much. In fact, the single most common thing I'd see written on evaluations was "I didn't use the book; in fact, I just came to class and listened, which was good enough."

Of course, part of this feedback was that I simply was getting better at teaching, particularly at the undergraduate level. When you're a new professor trying to build a research group, putting time into undergraduate teaching is tough - while fun, teaching doesn't advance your research career or your tenure case, so you tend to focus on graduate courses where you can both pursue research and (importantly) recruit students. Over time, and after tenure, I found it easier to put a little more time into undergraduate teaching too - a rewarding pursuit, as it turns out!

Note to students: beware of the feedback you give professors - they actually might listen to it! And in this case, we did. I stopped requiring any textbook at all, and in fact just told students to come to class and take notes. The only book I told students to buy for certain was Kernighan and Ritchie, because duh.

[credit http://farm1.staticflickr.com/6/6733187_74b760c72a_o.jpg]

Everyone should have a copy of K+R. And it should look beaten up, like this one does.

A new problem arose due to this course of action, unfortunately, and, perhaps, predictably. Some students, particularly those who were (a) not great at taking notes or (b) not great at waking up, complained (usually in a nice and polite way) that there was no reference material. As a student, you had to come to class and take notes - there was no other material to fall back upon.

Towards a Free Online Book (FOB) - Operating Systems: Three Easy Pieces

I took this student commentary to heart. It probably helped that I personally was a "book learner", as mentioned above - I didn't particularly like listening when I was in class, and rather would read the book later than pay close attention in lecture (in fact, Andrea is always surprised - and sometimes horrified - to hear about how often I used to sleep in classes; where else can a tired student catch up on some Z's?). I knew that some of the classes I had done worst in as an undergraduate were those with bad books, or worse, no books at all; so why was I creating such a situation on my own students? And finally, it was useful that I was past tenure; although our research group was still chugging along full steam, I had a little extra time on my hands for some kind of additional project.

What I did with that time is write. My system was simple (systems being better than goals, right?): give a lecture on a given topic, and then, while it's fresh in my head, go to my office, shut the door, and write down what I just spoke about. The lectures, thanks to years of work by both Andrea and myself, were in good shape - we felt we knew how to teach the material to undergraduates and young graduate students. I just had to get it down into book form. And while the results wouldn't necessarily be pretty, they might be useful to students who had either missed class or just wanted to review what they had heard in written form.

[credit http://julianrockmemorial.org/wp-content/uploads/2011/11/Baby-Typewriter.jpg]

This is not me typing, but it sure is cute. Babies are smart.

I enforced a few rules to make sure that I made progress, knowing that perfect is the enemy of the good. First, I decided to just write plain text - no fancy typesetting. Second, I didn't draw any figures - any pictures that were needed were just done in plain ASCII-art format. Third, I would write until the note was finished - don't leave what can be done now for later.

The results of this first effort can be found here, and they are not particularly pretty - just a bunch of text files. Here is an example of a figure I "drew":

0    |---------------------|
4    |    program code     |              all the instructions
...  |                     |              live up in this part
     |                     |
1K   |---------------------|
     |        heap         |              the heap contains all
     |                     |              malloc'd (new'd) data
     |                     |                   structures
2K   |---------------------|               [it grows downward]
     |          |          |
     |          v          |
     |                     |
     |                     |
     |                     |
     |                     |
     |                     |
     |        free         |
     |                     |
     |                     |
     |                     |
     |                     |
     |                     |
     |                     |
     |          ^          |
     |          |          |                [it grows upward]
15k  |---------------------|             the stack contains local
     |        stack        |            (stack-allocated) variables,
     |                     |             arguments to routines, 
16k  |---------------------|              return variables, etc.

      FIGURE: ADDRESS SPACE

The picture is a conceptual view of a virtual address space, including code, heap, and stack. Not too pretty, and certainly nothing you would think of including in a typical nicely-formatted textbook. But it was effective: students didn't mind the crude nature of the drawings, and appreciated the notes in their rudimentary form. I fondly recall the feedback from the end of year course evaluations: "ZOMG! You should totally write a textbook!" and similar comments got me excited to do more. Positive feedback, however small, is a powerful drug.

Getting Serious About A Free Online Book (FOB)

After that first semester of writing notes for the course, it became rather easy to make progress. Each semester I taught the undergraduate OS course, I would try to write a few more notes. One semester I finally started adding some homeworks (we still have a few more of these to do, which forms the bulk of the work left to be done before version 1.0). Typesetting via LaTeX came soon enough, and pretty soon we had something that resembled a real book. Figures instead of ASCII-art was the last step in the process. A first form of "Operating Systems: Three Easy Pieces" was born, and thus our Free Online Book (FOB) was available to all.  

From Virtual to Physical (And Back to Virtual, Again)

Student feedback led to another step forward in the history of the book. One student simply said: "I love the book. Can I buy a printed form? I really like reading on paper better, and a bound book is something I would buy."

I actually have spoken to a few publishers (names omitted here) about generating a printed copy. This is roughly how those conversations went: 
  • Them: "Will you ever be interested in writing a book?"
  • Me: "Actually, my wife and I have this book. It's about Operating Systems."
  • Them: "Oh, interesting. Why did you do it?"
  • Me: "Well, we thought there was room for another entry in the space. And we have some background that many of the current authors do not, particularly in storage and file systems."
  • Them: "Even more interesting. What would it take to get you to commit to doing it for us?"
  • Me: "Well, it would have to be free online on a chapter-by-chapter basis. You all could make money off the printed copies."
  • Them: "I don't think that's going to work." (discussion ends)
So that ended that.

I started poking around in the burgeoning world of online, on-demand publishing, and stumbled across lulu.com. What a cool site: you upload a PDF, futz around with some settings (like what the cover should look like), and boom, you have your very own book for sale, printed on demand and at reasonable cost. 

Soon enough, we created both a hardcover and softcover version of the "free" operating systems textbook. These basically are printed at cost (we make about $5 per book, mostly as a small and silly incentive to do this) and each semester we teach the course, some subset of students buy the printed copy.


We even finally designed a cover for the printed copy, taking an old picture of Halley's comet and adding a little text around it. Thanks to T. Griebel for the suggestion. To all those with the old black cover, well, sorry.

Also interesting is that Lulu lets you sell a PDF as well, so we started selling the full PDF of all chapters, plus a few other bonus features such as a nice glossary of terms, tips for building systems, etc., for just $10. This remains the most popular purchased form of the book, amazingly (about 55%; softcovers about 35%; hardcovers the remaining 10% or so).

To put it simply: some people will buy your book anyway, even if it is free online. FOBs can make you rich! Well, not rich, or actually anywhere close to rich, but you get the point.

Usage Statistics

Putting a free set of book chapters online turned out to have a great side effect: other people, from all around the world, started using it - sometimes just a few chapters (a new possibility with free books), and sometimes the entire book. I've heard of classes that use the book in the U.S. (at many schools), Canada (at Toronto, Waterloo, and Alberta among others), India, Portugal, Turkey, and elsewhere using OSTEP instead of the more traditional choices for OS class. More people ask about it weekly.

More interestingly, I think, is the casual usage online books make possible. If a random person searches the Googles for multi-level feedback queue scheduling, or virtual memory built via segmentation or paging, or how a TLB works, or what a condition variable or semaphore is, or how a local file system is implemented, or how file-system journaling works, or even how the Sun Network File System protocol truly operates, they might chance across our book.

We've even gotten mild complaints (from professors) about students who were supposed to use some other book but were using ours instead. The student underground, working its magic!

In terms of actual usage, we've been tracking chapter downloads (thanks to our Computer Systems Lab) for the past many years:


The power of the Internet: Eventually your stuff gets discovered, maybe.

As you can see, after a few thousand downloads/year for the first few years, the last two years have seen incredible growth, with nearly 400,000 chapter downloads this past year (2013), and well-over half-a-million in total. We should hit one million chapter downloads sometime in 2014.

The Hacker News/Reddit Effect

We also had the fun experience, just last week (not yet reflected in the chapter download totals above), of making it to the front page of Hacker News and a long discussion on Reddit. We use Google Analytics on the site to get a sense of traction, and thus we could determine just how many people came by as a result. The results were pretty amazing: The main web page received over 1.3 million page views in just a single day! This nearly doubled our total page view count for the year. Web sites with readership (like Hacker News, Reddit, and many other similar sites) can drive eyeballs to your content, if you have content said eyeballs wish to see. I guess I should have put an advertisement across the top of the page. Well, maybe not: it probably would have been for someone else's OS book.

Impact on Teaching Ratings

One other fun impact of the book seemed to be on my teaching ratings. Sure, I was getting better at teaching the more I did it, but students really seemed to dig the fact that we were trying to make a book, and now they had a source of information other than just attending class. At the same time I started working on the book (Class #4 below), my teaching ratings improved notably:


My ratings in 537 over time: Yes, I was getting better - at least at convincing students to give me a higher score. And the book seemed to help. And all the bribes.

To be honest, the book alone wasn't the only factor in ratings going up. It was simply putting a little more into teaching the undergraduates. I had done it reasonably at first; now I was actually trying to do it well. The book was definitely a key part of that, but not the only part.

Why Online Free Books (FOBs) are Better

All of this experience, thus far, has driven me to believe a simple truth: a free online textbook (FOB) is simply superior to the classical textbook. While we stumbled onto this FOB track out of some kind of necessity, the reality is that there are many advantages to this new model. While undoubtedly better explored by others (e.g., Craig Mod), here I'll list some reasons why you should consider writing a free textbook:
  • Linkability. Classic textbooks trap their material inside of expensive volumes, making it difficult to link to or learn from unless you are dedicated enough to buy the entire (expensive) thing. FOBs make their content available to all, enabling linking to chapters from other sites; Google searches will find your materials.
  • Broader Readership. As related to the previous point, classic textbooks are (usually) bought for class. FOBs can be perused by anybody interested in a topic that the book covers, and thus more likely to be read by more people. This type of casual usage broadens the audience. If your goal is to deliver information to as many people as possible, free and online works better.
  • Partial Usage. Classic textbooks almost mandate usage of the entire book; it would be cost prohibitive to require students to buy three different books, much less one. FOBs enable usage of subsets of many books, perhaps pulling together a whole that is better than the sum of the parts. While there are reasons to use just one book (style and tone, for example), there could also be reasons to pull together materials from various different sources.
  • Frequent Micro-Revisions. Classic textbooks are revised with great effort, and often for the wrong reasons (e.g., to force students to buy new books instead of used ones). FOBs evolve as they need to, and when they need to. Indeed, we update chapters regularly thanks to feedback and comments from random people on the Internet.
  • Just Feeling Good. Making a free book simply makes you feel good, like you are doing the world a (small) service. Every email you get saying "good job!" or "thanks!" makes you smile. We've received hundreds of said emails, and appreciate each and every one.
Now you might be asking: but can they make money? I would argue that (a) FOBs can make you some money (by selling printed copies, more fully-featured electronic copies, etc.), but more importantly (b) most authors of textbooks don't write books for the money anyhow. My advisor David Patterson (a hugely successful textbook author) long ago told me that "no one should write for the money" and instead recounted how proud he was to tell his mom what people were saying about his books.

What Should Publishers Do?

I suspect, if they were willing to adapt, that publishers could still serve an important role in the world of FOBs. They could clearly be in charge of advertising and promotion; they could make the printed copies (hopefully at similarly low costs); they could do any number of things to help promote good books, make some money,  while still letting the content be free online. 


Who's that scary man hiding behind a Kindle? Who knows, but watch out for his laugh.

Will publishers adapt? It is hard to know. If you pay attention to classic industries like record labels or movie studios or even academic journals, modernization is glacial, defensive, and often backwards-looking - all reasons to be pessimistic. But there are undoubtedly smart people in publishing, and if they keep their noses to the wind, they will carve themselves a role in our FOB future. Or they will disappear.

Conclusions

Even with our modest success, it seems clear that Free Online Books (FOBs) are coming. Classic printed books are (a) expensive and (b) not of uniform high quality. FOBs, in contrast, are at least not expensive (indeed, they are free!); hopefully, they can be equal to or even greater in quality, and given frequent micro-revisions, may perhaps tend to be better over time. Because FOBs are linkable and can be easily found and then used via Google searches, chapters from FOBs are likely to be read by many more people than the information trapped in classic printed texts.

Are you thinking of writing a book? Do yourself a favor: start writing, and start putting what you write up on your website. Use it in your own classes. Listen to student feedback. And enjoy yourself! The entire process, we've found, can be quite fun and rewarding. Let's use free materials to improve the state of the art of CS education. Shouldn't we, as technologists at major research institutions, be leading the way?

13 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This is a great article. I feel that the extremely high prices of textbooks are indeed hurting education in the US. Most students cannot keep their textbooks after the semester is over as they need to sell them back to get the money back to buy the next expensive textbook. So they don't get a chance to review the very books they used when they were learning the courses, which actually to me is the most effective way of refreshing one's knowledge. And they are afraid of making notes on their textbooks, worrying that they won't be able to sell back at a good price, which is a sacrifice to their learning.
    In short, I totally support your idea of free online book and cheap printed copies. And your OSTEP is a great book!

    ReplyDelete
  3. Excellent write up! I wish I could have learnt OS in your class.

    ReplyDelete
  4. Great to see this type of effort coming from professors themselves, who do not really *need* to do this -- and if they do, do not *need* to push for it or promote this kind of thinking. So, thank you.

    Not sure whether you already know about similarly motivated Green Tree Press and Alan Downey's efforts:
    http://greenteapress.com/manifesto.html
    http://greenteapress.com/wp/

    ReplyDelete
  5. Thank you for your time, effort and for making it freely available online. I stumbled up on the chapter on Semaphores while doing a google search on the subject; and it was very helpful.

    ReplyDelete
  6. No mention of PDFs being eco-friendly? that's one major reason I prefer PDFs and even take notes on my tablet.

    ReplyDelete
  7. I read the first chapter online and decided that i have to buy and put this book under my pillow. Received my hardcopy of OSTEP last Saturday.
    It's a wonderful and inspirational book. I love your side stories. When i read the one at the beginning on chapter 8 about Corbato receiving Turning Award for his MLFQ i was dreaming that if one day i invent a new scheduling i might be like him.
    Thank you professors for the hard work.

    ReplyDelete
  8. Thank you for the educative information
    Www.mensclinicspecial.co.za

    ReplyDelete
  9. Hi Remzi! Glad to be in your 2021 edition of CS537

    ReplyDelete
  10. absolutely brilliant and funny article

    thanks to you and your wife for writing this book and giving it away for free! :D

    ReplyDelete