Windows NT Device Driver Development Basis (8)

zhaozj2021-02-11  189

1.4 Driver compiling links, debugging, installation, and start.

The environment written under Windows NT is called DDK (Device Driver Kit) for Micro

Soft Windows NT, this is a working environment in a command line. But you need to install Win32 before installing DDK.

SDK (Software Development Kit) and Microsoft Visual C .

The compile link is build.exe, and he reads the configuration of the program to be compiled from the configuration file Sources.

Source files, target files, etc., get the address of the reference file from the environment variable include, and then call Visual

C compile linker nmake.exe performs actual compilation link work. Log file build.log, build.wrn

The build line executed in the compiled link is recorded in Build.err, and the error encountered is encountered. Compile

The completed file suffix is ​​.sys

Installation procedure is divided into two steps: First, copy to the System32 / Dri of Windows NT

VERS / under; second, HKEY_LOCAL_MACHINE / SESTEM / CURRENTCONTROLSET / SERVICE in the registry

S / Create the key with the .sys file, then create the three named Start, Type, ErrorControl

Numeric key of a REG_DWORD type. Which phase of the Start's key value is controlled by the driver

start up. The number of less than 3 settings is automatically started at a certain phase of the system started; 3 means a manager

Manual startup; 4 indicates that the program is disabled. Restart the system after setting up.

Manually start and stop a driver requires the device in the ControlPanel (Device)

)icon.

Due to the complex structure of the driver, and the code of debug kernel mode requires two installations with Windows NT.

The computer is more troublesome, so it should be tested in the process of writing a more complex driver.

Testing should be tested after any part of the work is completed so as soon as possible. According to my own experience, drive

Most errors in the program are caused by incorrect access to memory. For example, using a pointer that is not initialized,

Release the memory that has been released, references the paging memory at the DISPATCH_LEVEL or the above run level.

-

转载请注明原文地址:https://www.9cbs.com/read-3782.html

New Post(0)