yujianru
驱动牛犊
驱动牛犊
  • 注册日期2004-11-24
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1617回复:4

DDK下如何编译?

楼主#
更多 发布于:2005-03-04 16:52
DDK 下 有个passthru 的例子?
如何编译成.sys文件!!!
bmyyyud
驱动老牛
驱动老牛
  • 注册日期2002-02-22
  • 最后登录2010-01-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望130点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2005-03-05 12:16
进入DDK 的Checked 或free环境,cd 到目录,build -eZ
滚滚长江东逝水 浪花淘尽英雄 是非成败转头空 青山依旧在 几度夕阳红 白发渔樵江渚上 惯看秋月春风 一壶浊酒喜相逢 古今多少事 尽付笑谈中
yujianru
驱动牛犊
驱动牛犊
  • 注册日期2004-11-24
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-03-05 14:53
能具体一点吗??

如何进入check和free环境!!!

build -cz 不需要加要编译的文件名吗???
aiwadgj
驱动老牛
驱动老牛
  • 注册日期2004-11-13
  • 最后登录2020-12-24
  • 粉丝0
  • 关注0
  • 积分119分
  • 威望84点
  • 贡献值0点
  • 好评度14点
  • 原创分0分
  • 专家分0分
  • 社区居民
地板#
发布于:2005-03-05 14:57
能具体一点吗??

如何进入check和free环境!!!

build -cz 不需要加要编译的文件名吗???

2.1 Running the BUILD Utility
Before running the BUILD utility, you must install the following software, in the order listed:

Microsoft Visual C++
DDK build environments
For installation information, see the DDK\'s release notes. These can be found in the stand-alone file install.htm, which is located in the root directory of your installed DDK, and in the root directory of the DDK installation CD.

To run BUILD, first click the \"Free Build Environment\" or \"Checked Build Environment\" icon under your \"Windows? 2000 DDK\" program group. This starts a command prompt window and sets some environment variables, using the setenv.bat file supplied with this DDK.

You can invoke BUILD in either the \"checked\" or \"free\" environment. Generally, drivers should first be written, debugged, and tested using the \"checked\" environment. Code built in this environment is not optimized, and extra internal error checking can be implemented. After you determine that your code is working properly in the \"checked\" environment, it should be recompiled and tested in the \"free\" environment. For more information, see Free Build and Checked Build.

Invoking BUILD with the \"-?\" option displays the command-line syntax and options for this utility. Typically, BUILD is invoked using the following command line:

build -cZ

This command line creates a \"clean build\" (by deleting all pre-existing .obj files) and inhibits dependency checking of source and header files.

The term build product is used to identify one or more binary files created by a BUILD operation. In the Windows 2000 DDK, the build product is typically a driver. However, BUILD is used to create every binary file in the Windows NT?/Windows 2000 product.

2.2 Specifying BUILD Product Components
Each subdirectory containing driver source files must also contain a file named sources. This file lists the files to be compiled and linked, using a set of macros. For more information, see Macros for sources Files.

If your driver will consist of more than one build product, or if the source files will be kept in several subdirectories, a file named dirs must reside in each directory node that contains subdirectories This file contains macros that list subdirectories in which source files reside. For more information, see Macros for dirs Files.

Each driver subdirectory containing source files must also contain a file called makefile. BUILD spawns the NMAKE utility for each source file listed in sources, and NMAKE uses the makefile to generate dependency and command lists. A standard makefile in every sample driver\'s source code directory directs NMAKE to the master macro definition file, makefile.def, which is supplied with this DDK. The standard makefile should not be altered.

The file named makefile.def specifies the flags that are passed to the compiler and linker. Using this file simplifies the creation of platform-independent driver projects. The file is similar to the ntwin32.mak file, which is supplied with the Platform SDK and is used to build Win32? applications.

Before running BUILD, use the cd command to set your default directory to one containing a sources or dirs file. When you invoke BUILD, it parses each sources file and spawns NMAKE for each source file. The NMAKE utility evaluates the macros in makefile.def and spawns the C compiler with the proper switches. After compilation operations are completed, BUILD spawns NMAKE again to link the compiled object files.

Running build -cZ compiles and links your driver. For Windows 2000, output files are placed underneath a subdirectory named either \\objfre or \\objchk, depending on whether you are using the free build or checked build environment. Because output files are placed in subdirectories that are specific to the build environment, you can keep your source files in a single directory tree while maintaining both free or checked build products under this tree.

Using BUILD and makefile.def removes the guesswork about which compiler switches are required, which arguments the linker requires, and so on. By adding appropriate macro definitions to the sources file, it is possible to control build options in a platform-independent fashion.


酒也在沉溺,何时麻醉我抑郁。过去了的一切会平息。。。。。。。
yujianru
驱动牛犊
驱动牛犊
  • 注册日期2004-11-24
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2005-03-05 17:59
谢谢1!
游客

返回顶部