最近公司要求做一个驱动程序。以前从来没有做过此程序。后来知道用DDK可以创建。我只有vc+win2000ddk;
我的系统是WIN2000,我安装了一个WIN2000 SP1 ,当然VC是安装了。
安装完了后。在开始菜单就有一个WIN2000 KIT 的项。但现在我根本不知道怎么入手。查了一下,好象说要输入build -cz编译一下。那么编译完了后怎么调试我在ddk文档中找到的例子呢?也就是vc中的环境要怎么配置。还有例子中找到的文件都是.h和.c的还有makefile等文件。根本就没有vc需要的dsw文件啊。。各位要怎么办啊。详细的跟我讲解一下。
谢谢!
我的系统是WIN2000,我安装了一个WIN2000 SP1 ,当然VC是安装了。
安装完了后。在开始菜单就有一个WIN2000 KIT 的项。但现在我根本不知道怎么入手。查了一下,好象说要输入build -cz编译一下。那么编译完了后怎么调试我在ddk文档中找到的例子呢?也就是vc中的环境要怎么配置。还有例子中找到的文件都是.h和.c的还有makefile等文件。根本就没有vc需要的dsw文件啊。。各位要怎么办啊。详细的跟我讲解一下。
谢谢!
http://www.codeproject.com/system/idd.asp?print=true
使用SoftIce调试
完成环境的配置!
再到cmd下,注意要运行Checked Build Environment,而不是直接运行cmd!
然后转到驱动源代码所在的目录下,然后build -cZ,就可以编译了!
在VC下编辑(注意:是编辑),使用Build编译,使用Si调试。当然,也可以配置一下,在VC下编译。
(主要是配置project-settings,使用编译脚本cmd,脚本中调用build)
本质上还是离不开build。
因为现在的DDK已经不能用VC的cl编译器了。
(至少我的WindowsXPsp2DDK是这样,在其releaseNotes中直接告诉你了:As was the case for the Windows XP DDK a complete set of tools is supplied with the Windows XP Service Pack 1 DDK for building drivers. Microsoft Visual C++ is no longer required to be installed to use the DDK.
Please use the included tools to build Windows 2000 or Windows XP device drivers. Do not use compilers, linkers or other build tools from other development products such as Visual Studio .NET to build Windows 2000 or Windows XP device drivers. This version of the Windows DDK does not support using a version of Microsoft Visual C++ other than the one supplied with the DDK. Attempts to use in incorrect version of Visual C++ will result in the following error message from the compiler:
error C1189: #error : Compiler version not supported by Windows DDK
Some Windows Millennium (Me) drivers may require Visual C++ version 6.0 to be installed for use regardless of the platform being used to build the drivers. Later versions of Visual C++ will not work in the Windows Me build environment. )