
The Device Driver Philosophy 87
By contrast, the application software in an embedded system can easily access
your hardware. In fact, because all of the software is linked together into a single
binary image, there is rarely even a distinction made between application soft-
ware, operating system, and device drivers. The drawing of these lines and the
enforcement of hardware access restrictions are purely the responsibilities of the
software developers. Both are design decisions that the developers must con-
sciously make. In other words, the implementers of embedded software can more
easily cheat on the software design than their non-embedded peers.
The benefits of good device driver design are threefold. First, because of the mod-
ularization, the structure of the overall software is easier to understand. Second,
because there is only one module that ever interacts directly with the peripheral’s
registers, the state of the hardware can be more accurately tracked. And, last but
not least, software changes that result from hardware changes are localized to the
device driver. Each of these benefits can and will help to reduce the total number
of bugs in your embedded software. But you have to be willing to put in a bit of
extra effort at design time in order to realize such savings.
If you agree with the philosophy of hiding all hardware specifics and interactions
within the device driver, it