阅读:1167回复:1
Win2000 device driver Tutorial 2
The Windows DDK
The acronym \"DDK\" stands for Driver Development Kit. This is a hierarchy of directories supplied by Microsoft (at the time of this writing you can download it free from http://www.microsoft.com/ddk. But watch out, it\'s very large, tens of megabytes!). It contains environments and samples that allow us to compile and build drivers, and to install them. The DDK is a necessary component of Device Driver development, it is not feasible to undertake the development of a driver without having the DDK installed in the development system. Once you install the DDK, you will have a driver development environment at your fingertips. For example, if you install the Windows 2000 DDK you will get a \"Development Kits\" entry in your submenu when you click on \"Start\" and then \"Programs\" in your desktop. If you click on \"Windows 2000 DDK\" and then on \"Developent Kits\" and will get a number of choices. Among those, you will find the \"Checked Build Environment\" and the \"Free Build Environment\". The Checked Build Environment provides you with a Dos Box with a number of environment variables and paths preset so that you can proceed with compiling and building your driver. It is called \"checked\" build because it sets your compiling and linking environment to generate a fair amount of debugging information. Once in the Checked Build Environment, you use the build utility to compile and build your driver. The outputs of this build process will be the driver executable (a .sys file), the debug symbols file (a .pdb file) and a log file with detail information about the build. On the other hand, the Free Build Environment gives you a Dos Box where options are set for a healthy amount of optimization, and zero debugging. This is to allow you to build the production version of your driver. You use the Checked Build Environment to develop and debug the driver, and the Free Build Environment to create a production version. Here, again, the main output is the .sys driver executable file. Note however that even within the Free Build Environment you are able to ask the DDK to generate a .pdb symbols file: this is helpful, for example, to debug problems from users of your driver, after the driver hits the open market in its Free Build form. The DDK also includes a large set of DDK Documentation. This documentation is managed by a help engine that is very similar to the MSDN Help you find inside your MSVC++ Integrated Development Shell. The Search facility is particularly helpful, you can enter API function names or other keywords, and get lists of documents. You also have a \"Favorites\" page where you can keep a listing of those entries you find useful on a longer term. The DDK Documentation also includes a Design Guide and a Reference to write Kernel Mode drivers such as those we\'re learning here. There you will find all of the techniques and APIs described in this document, and more ! Spare some time to investigate and read. You will also find a large amount of source driver samples in the DDK. They come in the src subdirectory of the DDK. You should take some time to explore the sample source code. A good start is the toaster sample device driver which you can find at the src\\general\\toaster subdirectory of the DDK. Understanding the Toaster driver is a rite of passage to aspiring driver writing professionals - for example, if you submit a naive question to one of the several professional mailing lists or newsgroups that deal with driver writing, seasoned professionals will often refer you to the Toaster driver and tell you to learn it well. So, heed the advice of your elders ! |
|
最新喜欢:![]() |
沙发#
发布于:2002-06-27 14:14
感谢!帮你推一下。
|
|
|