Most programmers consider device drivers the darkest of the dark computer arts, but to write a good device driver what's needed is a decent template and some good documentation. The FreeBSD Operating Systems has plenty of templates, in the form of already working drivers, and with the publication of Joseph Kong's latest book, _FreeBSD Device Drivers_, now there is good documentation as well.
The book takes the reader from the simplest types of drivers, such as those used to do serial communication, up through disk, usb and network drivers, which are far more complex and require the programmer to have a greater understanding about the operating system in which they're working. The introductory chapters give enough of the required background information for writing a driver, covering areas such as memory allocation, and synchronization primitives, without preventing the reader from, very quickly, getting down to working on real code.
One of the beauties of this book is that it covers running code in a real world operating system, making it far more relevant for both students and working programmers. Many books on programming create neat and easy problems that the authors think will take the reader through the necessary steps to understanding a concept, but this book doesn't shy away from the nitty gritty details of low level code.
The book has an easy to read, narrative style which makes reading it an enjoyable experience, a seeming rarity in technical books.
I'd recommend this book to anyone who wants to truly understand what goes on, under the hood, in an operating system.