Use driverstudio to develop drivers-getting started

Source: Internet
Author: User
Http://www.driverdevelop.com/
Subtitle:
Author: Yang Jun Article Source: site original hits:

10975 updated on:

Editor's note: The content of this article is mainly translated by DriverStudio's random documents. We recommend that you use the following software: DriverStudio2.5, Visual Studio6.0, and Windows 2000 DDK. This document assumes that you have installed these software. DriverStudio2.5 can be downloaded to the test version from the driver development network (www.Driverdevelop.com). Windows 2000 DDK can be downloaded free of charge on Microsoft's website. You need to purchase Visual Studio 6.0.
Author: Yang Jun E-mail: y9980@263.net
Use DriverWorks to develop drivers for Windows 98, Windows Me, Windows NT, Windows 2000, and Windows XP
Introduction
DriverWorks simplifies the development of device drivers by providing powerful and advanced code generation wizard-DriverWizard and thousands of lines of strictly tested code in libraries and examples.
Windows NT and WDM driver interfaces provide good conditions for Object-Oriented applications. DriverWorks makes full use of the excellent object-oriented features of the operating system. Compared with Microsoft's DDK, it designs a Driver Design Model Based on Windows NT and WDM) the driver provides a more friendly way. With Driverworks, designers can develop NT and WDM drivers at a faster speed. In most cases, the use of the DriverWorks function library can greatly reduce the length of the driver code. With these well-designed functions, You can do almost all the work. Of course, the C-language API functions of DDK are also available.

Note: The driver of a Windows NT device can run on Windows NT or Windows 2000, while the driver of a WDM device can run on Windows 98, Windows Me, Windows 2000, and Windows XP.

DriverStudio encapsulates the Code required by each driver into a class library. The library code automatically Handles routine operations, which greatly reduces the complexity of the task.
Moreover, the C ++ compiler provides advantages not available in ansi c, including improved type security checks, inner-connection function optimization, and better code organization.
The Code Wizard of DriverWizard -- DriverWorks is closely integrated with Microsoft Visual C ++. The driver source code framework with more than 1500 lines can be completed with just a few clicks. The Code also contains detailed annotations. In addition, DriverWizard can also generate code customized for special devices, such as USB devices, PCI devices, plug-and-play devices, and ISA devices.
DriverStudio's support for Microsoft Developer Studio is far more than simply using DriverWizard to construct a new project. DriverWorks provides a complete development environment similar to Microsoft Developer Studio, including checked and free compiling environments, similar code editors, error code locating, and browser-like.

Compile Library
Before you start working with DriverWorks, you must compile the required library files. You can compile the library files in the Microsoft Visual Studio environment or by using command lines.
The following describes how to compile a library in a VC environment.
1. Start Visual C ++.
2. Select File | Open Workspace. Open the workspace file in DriverStudio \ DriverWorks \ Source \ vdwlibs. dsw.
3. Select menu Build | Batch Build. In the displayed dialog box, select the library you want to compile.
4. Click Build to compile the selected library.
How to Use the command line method to compile the library is omitted here.

 

Test your installation
If you want to use the command line (not in Microsoft Visual Studio) to compile a simple driver example, you must first run two batch files (Suffix. bat files). These two files are in DDk and Visual C ++. You can also simply run the Checked Build Environment or Free Build Enviroment in the Start Menu Program/Development kits/Windows 2000 DDK.
The first batch of files to be processed is SETENV. BAT, and it requires two parameters: the first is the root directory of the DDK, and the second is "free" or "checked ". The second parameter tells the compilation system whether to add debugging information to the driver. The second batch of processing files is VCVARS32.BAT, which creates a path for the compiler.

Compile the example Program
For Windows NT 4.0, the simplest example is in the DriverStudio \ DriverWorks \ Examples \ NT \ HELLO folder. You can compile this example and load it with DriverMonitor.
For WDM drivers (for Windows 98, Windows Me, Windows 2000, and Windows XP), the simplest example is in the DriverStudio \ DriverWorks \ Examples \ WDM \ HELLOWDM folder. You compile it, and then use the control panel, milk bread, and bread, alcohol glaze, and bread?
If you have Microsoft Visual C ++ 5.0 or an updated version, you can open the workspace file % DRIVERWORKS % \ examples \ nt \ hello. dsw, and then compile it in the Visual C ++ environment. Use the HELLOWDM example to compile the WDM driver.
If you want to compile from the command line, set the working directory as follows and run the Build program Compilation:

CD \ ProgramFiles \ num.pdf \ DriverStudio \ driverworks \ examples \ nt \ hello
Build

Check the output file "build. log" (or "buildchk. log" or "bldfre. log") for errors.

Load drivers in Windows 98 and Windows ME
First, copy the hellowdm. inf file to the system folder. Open the control panel and run the Add new hardware wizard. In step 1 of the add hardware wizard, select hardware from the list. Note that hellowdm is in other hardware. When asked about the manufacturer, choose from disk? To locate the directory where the INF file is located. If you run drivermonitor during installation, you will see the driver pop-up message. After the installation is complete, open the System icon in the control panel and the installed devices will appear in the Device Manager.

Load the driver in Windows NT, Windows 2000, and Windows XP
The methods for WDM drivers in Windows 2000 and Windows XP are similar to those described earlier.
For non-WDM drivers on Windows NT, Windows 2000, and Windows XP, running drivermonitor confirms that your driver works properly. Note that hello. sys will be created in the. \ i386 \ * directory. The output * depends on whether your compiling environment is checked or free.
When you load hello. sys from drivermonitor, you should see the confirmation information in the window, and then the Hello message sent by the driver.
Note: to load the device driver in Windows NT, You need to log on as an administrator account.
If you do not have sufficient permissions to install the kernel-mode driver, drivermonitor will prompt an error message.


Http://tenyear.net/Article/ShowArticle.asp? ArticleID = 186

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.