Book Review : The Design and Implementation of the FreeBSD Operating System

Marshall Kirk McKusick, George V. Neville-Neil

Occasionally one has the joy of reading an IT book which is succinct yet detailed and you know intuitively that this book will be a source of informative material for years to come. This is such a book. The fourteen chapter, circa seven hundred page text doesn’t have a wasted word as it takes the reader step-by-step through the FreeBSD kernel, covering concepts, structures and system-calls. The authors themselves are among the best known of FreeBSD’s developers, although they hardly make much of an issue of it in the introductory pages.

The text operates from the core outward, so even moderately experienced system administrators and UNIX users may find the opening chapters impressive in their capacity to be daunting. It is not a book for beginners by any stretch of the imagination. Just to give one an idea, take this little snippet from page 386: “In the Microsoft family of operating systems, remote filesystem access is provided by the Common Internet File System (CIFS), which runs on top of the Server Message Block (SMB)... In FreeBSD, support for the SMB and CIFS client and server is provided by Samba, which resides in the /usr/ports/net/samba. Since this book deals with the kernel, and Samaba runs mostly external to the kernel, we will not discuss it further.”

Get the picture? This is a book that covers kernel services, process and memory management, i/o and device mapping, network and local filesystems, network sockets and processes. It is not a book for applications, even of the most advanced variety. Because it is written from the inside out, it is probable that the last two or three chapters at the end of the book on network protocols and system operation are a good place for a reader to skim read initially, as they provide a point of familiar territory where user and administrative services interface quite clearly with the kernel.

There is a lack of a Boolean operative in the preface sentence “[t]his book is suitable for use ... in a first-level course in operating systems”. It’s not. As the preface follows, students are expected not only to be very familiar with Unix and have a dash of C programming under their belt as well, they also should be conversant with the concepts described in the proceeding paragraph, as this book does not elaborate on them in a manner that say, Andrew Tanenbaum does in the essential “Modern Operating Systems”. Indeed, it is probably appropriate as a Masters level course in computer science.

That said, the fourteen-chapter design does fit in well with a standard thirteen-week course, as the first two chapters consist of (i) a history of UNIX and BSD and (ii) an overview of the rest of the book. The book is well-referenced and one can be certain that given the fact that this is a no-nonsense sort of text that the referenced articles, chapters, faqs and books are likewise of “no-nonsense” quality.

Also adding to the book’s utility as a study guide are some fifteen or so exercises at the end of each chapter which gradually increase in difficulty. Amazingly, these exercises are interesting, practical and informative and often refer to the developmental history of BSD. For example; “5.16 Port the code from 4.3BSD that would forcibly swap out runnable processes when the paging rates get too high. Run three or more process that each have a working set of 40 percent of the available memory. Compare the performance of this benchmark using the 4.3BSD algorithm and the current algorithm.”

One cannot help but be charmed by the sometimes subtle way that the authors encourage development of FreeBSD by explaining existing problems in the text with several references to “it would be useful if” etc. By the same token they also alert potential developers not to engage in time-consuming projects that are likely to be of marginal utility (e.g., writing code to recreate metadata thus avoiding out of space errors).

Throughout the text there is a liberal supply of pseudo-code, graphics and tables which are always appropriate and provide excellent support to the main body of text. The text itself is “bite-sized” in organization. Each chapter begins with a clear introduction of what it is about to explain and then, piece by piece, it explains it. There are very few examples of the text jumping ahead (or even behind) of itself. One can easily get the feeling of being immersed in a giant jigsaw puzzle that slowly builds itself from the centre outwards.

In a nutshell, this is an excellent book that deserves to be a “should own” for any serious BSD/UNIX computer professional or systems administrator and an absolute “must own” for a BSD/UNIX developer. It is extremely good value for money and people in either of the above categories should be referring to it time and time again over a number of years. Of course, because it is pitched at the level that it is, it probably won’t be making the best-seller lists in the immediate future. But if you fall in any of the above categories, even if you own “too many books” already, clear a little space on your shelf and buy yourself “The Design and Implementation of the FreeBSD Operating System”. You will not be disappointed.

Published in Sage Advice: The Journal of the System Administrator's Guild of Australia, Volume 11, Number 1, 2005, p13