How to Write a Simple PCI Device Driver

Written by katherine johnson
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Write a Simple PCI Device Driver
Writing your own PCI device drivers requires knowledge of the C or C++ programming language. (Comstock/Comstock/Getty Images)

Device drivers are programs that allow your operating system to interact with your computer's hardware. Drivers are necessary for your computer's hardware to function properly. Writing device drivers for your PCI devices requires you to have an understanding of your operating system and your hardware.

Device drivers must be written in the C or C++ programming language. The most appropriate driver module for PCI drivers is the Kernel-Mode Driver Framework (KMDF). Much of the KMDF code resides in the framework requiring very minimal common code for PCI drivers.

Skill level:
Moderate

Other People Are Reading

Things you need

  • Windows Driver Kit
  • Windows debugging tools
  • C or C++ compiler

Show MoreHide

Instructions

  1. 1

    Download and install the Windows Drivers Kit (WDK) from Microsoft. A link is provided in the Resources section. The WDK will allow you to develop, compile and debug your drivers before deployment.

  2. 2

    Search through the sample code provided with WDK for a driver that is similar to your PCI device. If possible, modify the sample code provided by WDK to your PCI device's specific needs. Modifying the existing sample code will save a lot of time and will prevent you from making numerous coding errors. The sample code can also serve as an educational tool to help you understand what is required to write drivers for Windows.

  3. 3

    Compile and build your driver using the build utility that is included with the WDK.

  4. 4

    Install a checked system build of Windows for testing and debugging. A checked build is slower than a free build, but it is easy to use and will generate extensive debugging information.

  5. 5

    Create an INF file. The INF file contains most of the central information your computer uses to install the driver on your computer.

  6. 6

    Test your new driver by installing it on your computer. Check to see if your new driver functions properly or if it causes any system errors.

  7. 7

    Debug your new driver using the Driver Verifier. The Driver Verifier will test your driver to see how it performs in extreme and stressful situations.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.