Appendix C. Building DriversCHAPTER OBJECTIVES
There is nothing magical about the build process for a driver. Like any piece of "real" (i.e., noninterpreted) code, it must be compiled and linked into a binary file before it can be used. The issues that arise when building drivers concern notifying the build tools (compiler and linker) that the environment for the code being generated is that of kernel mode. Although it sometimes may appear otherwise, Microsoft supplies a single compiler and linker. Whether the tools are invoked from a command-line prompt or from an elaborate Integrated Development Environment (IDE) such as Visual Studio, the resulting binary files are the same. In many ways, Visual Studio is merely a GUI interface for the build and editing tools. Clicking on the menu option for Project, then Settings, provides a convenient dialog-based interface to the tool switches. The DDK provides a utility, BUILD, that is convenient for batch and production builds of device drivers (as well as other production-level binaries). With proper environment settings, however, the driver author may successfully use Visual Studio. Indeed, it may be appropriate to use Visual Studio throughout the development phase and introduce BUILD during the later release stages of the project. The purpose of this appendix is to provide background material on the BUILD utility, as well as provide the Visual Studio settings necessary for successful driver builds.
|