How to Debug a Device Driver

By eHow Computers Editor

Rate: (0 Ratings)

Perhaps your device is not working properly, and you suspect it is because of the device driver rather than the device itself. Try to debug the device driver before tearing out your hair. This eHow can help.

Instructions

Difficulty: Challenging
Step1
Open the driver for the device and set a "breakpoint" in the "DLLENTRY" or "DllMain" entry point of the driver. In order to do this, you may have to reboot the device you are targeting, and reload the driver to make sure the breakpoint is executed.
Step2
Run the debugger to see if the driver loads as it should. It should reach the breakpoint you created in Step 1. If it works, go on to the next step. If this does not happen, the driver didn't load as it should. Go to troubleshooting for the driver when this happens, as you try to debug a device driver.
Step3
Set another breakpoint, but this time in the "XXX_Init (Device Manager)" entry point for the driver. Go through the initialization process of your driver as you try to debug the device driver. Run the debugger again, attempting to confirm that the driver is recognized by the device manager, and is working properly.
Step4
Add more breakpoints as you attempt to debug a device driver. Add breakpoints at the entry point of various interface functions such as "XXX_Close (Device Manager)", XXX_IOControl (Device Manager), XXX_Read (Device Manager), and more.
Step5
Try implementing stream interface by replacing "XXX" with something that matches specific implementation, such as DEVFLAGS_NAKEDENTRIES.
Test what you have done by running the debugger again.
Step6
Test what you have done by running the debugger again.
Step7
Verify that the "interrupt service thread" is functioning by setting breakpoints in the IST of the driver. Run the debugger again to see it the driver is working properly as you attempt to debug a device driver. If this runs properly, then you have successfully debugged the device manager.

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article: How to Debug a Device Driver

eHow Computers Editor

eHow Computers Editor

Category: Computers

Articles: See my other articles

Related Ads