Configure the development environment of the WINDOWS Driver-Step 1

Source: Internet
Author: User
A week ago, the teacher assigned me a task: develop a self-designed PCI device driver for a board and point out the direction for me, specifically the "three-step" strategy:

(1) getting started. Familiar with the development of Device Drivers Based on the DriverStudio development environment, and learn about PCI device drivers. (2) advanced. Use DDK for driver development, focus on learning other people's instances, and be proficient in debugging and modification. (3) practice. In-depth research on PCI Bus Standards, combined with specific circuit board characteristics to develop a set of their own device drivers. At the beginning of the Getting Started stage, I would like to sum up my experience in WINDOWS driver development and learning in the last week: the development environment I currently use is: WINDDK/2600 + Visual Studio 6.0 + Compuware/DriverStudio 3.2) wu an river compiled by ----------------------------------------- learning problems and solutions: (1) Get the appendix code and run the first driver CharSample. The steps are as follows: double-click the Registry import file Windows2K-XP.reg provided by the code CD, and then run the EzDriverInstaller tool that comes with DriverStudio to open the Driver Installation configuration file CharSample under the sys directory. inf, and then Add New Device. sys Driver System File, find sys The CharSample. sys file under The/objchk/i386 directory. After confirmation, The Driver Loaded Successfully will be prompted! (If an error is reported, and the device comes with it! (Because you forgot to import the Registry) after installing the driver, you can run the application test_charsample.exe In the exe/objchk/i386directory to test it! (2) After the operation is successful, errors always occur during re-compilation, and compilation is not successful! Error: fatal error LNK1181: Cannot Open Input File"...... /DriverStudio/driverworks/lib/i386/checked/vdw_wdm.lib "find the answer through online learning and communication: It turns out that the following step is missing When configuring the development environment: compile ...... the project under the/compuware/DriverStudio/driverworks/source directory gets the vdw_wdm.lib file! During compilation, note that after opening the project file with VC, there are two projects. You must first set the vdwlibs project as the current active project, and then right-click on the toolbar and choose "build ", in the pop-up compilation toolbar, configure the compilation platform settings: select the Win32 WDM checked platform (because we use XP), and then compile it, but there may be compilation errors: fatal error c1083: Cannot OpenInclude File: 'Warning. H': no such FileOr directory why? Because the DDK environment is not selected, you should go to DriverStudio menu-> DDK build setting... select the previously installed DDK directory. The directory I installed is C:/winddk/2600, so that the compilation is successful! After compilation "...... the vdw_wdm.lib file is generated in the/DriverStudio/driverworks/lib/i386/checked/"directory. After compiling the driver project, no errors listed above will be found! Of course, this compilation error may also occur: Fatal error c1051: Program database File,'...... /Compuware/driverstudio/driverworks/source/obj/i386/wdmchecked/vdw_wdm.pdb ', has an obsolete format, delete it and recompile but the compiler prompts should be clear enough, you just need to delete the file in the connection directory and compile it again! (3) using the Wizard to create a new driver project and compile it will produce the following error: Linking with DDK linker... LINK: fatal error LNK1181: Cannot Open Input File' Ntstrsafe. lib'Error executing link.exe. Because this file does not exist in xpddk, it is available in 2003 ddk. Copy one, or in the project-> Settings-> connection selection box Ntstrsafe. libWhen this connection item is removed from the result point, only one project can be clicked, or ntstrsafe cannot be found in the connection set of the project. click the driver project and then delete the connection to the database that cannot be found. This is mainly because:

Don't know how to make 'd:/WINDDK/2600/lib/wxp/i386/ntstrsafe. lib 'Solution
Drivers generated by driverstudio are connected to ntstrsafe. lib library, but this library does not actually exist. Remove this library from the Link item in the Settings item of the Project, and find the following line in the sources file of the Project:

TARGETLIBS = $ (DDK_LIB_PATH)/ntstrsafe. lib $ (DDK_LIB_PATH)/csq. lib

Delete the file directly.

The program reports automatically generated by DS 3.2 are not a valid solution for win32 applications: Use the bulid (dirverstudio-> Build with BUILD.exe) provided by driverstudio for compilation, do not use the build in VC to compile the driver. It seems that it is okay to use the build in VC to compile the driver. But it is better to use the build in driverstudio to compile the driver, I think.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.