Dr. Dobb's Journal October 2002
Familiarity with the range of the core development possibilities is the theme of Practical Linux Programming: Device Drivers, Embedded Systems, and the Internet, by Ashfaq Khan. Upon reading Practical Linux Programming, you should acquire enough knowledge to set up a minimal Linux system and create simple Linux-based embedded system applications capable of using device drivers and interprocess communication and of presenting its data on the World Wide Web. Khan's concept of what is core to the Linux programming experience for the average programmer is savvy and tasteful. He starts at the assembly level and stops just short of the programming problems introduced by the X Window system. Java is off somewhere over the horizon.
Practical Linux Programming introduces you to the whole range of the basic Linux development environment, including: Linux installation and minimal system generation; device-driver coding; tasks and process coding; user-mode programming (Shell, Perl, Compiled C, and SQL); mathematical coding; and web presentation of data from program runs.
The book concludes with five sample embedded control applications with web interfaces. Source for all examples is included on the CD-ROM. The CD-ROM contains the example code from all chapters, including scripts to create a minimal bootable Linux system and the source for the five embedded control applications. Also included are third-party evaluation tools. The CD-ROM content is technically impressive but not as meticulously prepared as the book itself, and even preserves in laser-etched immortality one of the author's core dumps. I whole-heartedly suggest that this is the sort of CD-ROM to expect from an embedded systems programmer.
In short, Practical Linux Programming is a goodeven excellentfirst book for your first survey of the panorama of Linux development. Khan is an experienced embedded systems programmer employed by Xerox Corp. Every aspect of his writing shows familiarity with the experience of programmers for whom desktop computers and operating systems are primarily tools for accomplishing the sometimes awkwardly different mission of machine control. The breadth-first presentation is especially well-targeted to readers who are personally responsible for designing and programming a Linux-based embedded systems project.
I don't know why the "program-this-microcontroller" books are almost uniformly so good. As mature technical writing, they surpass the volumes aimed at the latest bleeding edge web foofrah. Maybe it's because embedded control programmers tend towards the prosaic and competent. A bad servlet crashes your browser. A bad control application crashes a spaceship or kills someone.
But even among a field of good books, 68HC12 Microcontroller: Theory and Applications, by Daniel Pack and Steven Barrett, is outstanding. It's all the usual stuff about this extremely attractive 16-bit Motorola controller offering its instruction set, I/O, timing, S/RAM, EEP/ROM, interrupts, and so on. But the authors also teach you how to build a robot (hardware as well as software) that can navigate a maze and a robot that can balance. In the process, they delve deeply into fuzzy logic, which is a good thing, since the 68HC12 has a fairly lavish set of support instructions for fuzzy logic. No dry lectures here: All theory is immediately put into practice. How delightful!
The writing style is clear and crisp. The diagrams are adequate to excellent and attractive. The production values are high. Overall, this is clearly college textbook quality, which is fortunate since it is intended as a college textbook. Nonetheless, it's just the sort of thing you want on your desk if you are actually programming these beasties.
Even the appendices please. Ever alert for shovelware, I found none. There's the instruction set, but you want that. There's the register set, but you want that too, perhaps even more than the instruction set, given the complexity of register mapping on a microcontroller. The appendices on binary arithmetic and number base changing are appropriate: This book may well find itself in the hands of a junior engineer on his first embedded control gig, and your nowadays junior probably spent his comp sci years surfing java.sun.com for new APIs rather than converting hex to octal on his fingers and toes. Along the same lines, the appendix on digital logic fundamentals is quite timely: Try asking your intern to prove on paper that any Boolean equation can be expressed entirely in NANDs and you'll see what I mean. A copious list of 68HC12-related hardware and software products rounds out the appendices.
Still, there is a tiny flaw. The drones who put the CD-ROM content together packed it entirely into a Windows InstallShield .EXE file! Duh. Here I sit at my Solaris workstation behind my OpenBSD firewall and darned if any possibility of Install ain't Shielded completely from me. It's probably true, as we discovered at Cygnus Solutions a decade ago, that most embedded control developers are sitting behind Windows, but not all of us are. An e-mail to customer support for the book generated an autoresponse reassuring my issue would be addressed by a customer-service representative, which two weeks later has not been. I suppose they took me for a crank.
DDJ