Chapter 12. Creating a Kernel PlugIn Driver
The easiest way to write a Kernel PlugIn driver
is to use DriverWizard to generate the Kernel PlugIn code for your
hardware (see Sections 11.6.3 and 184.108.40.206). Alternatively, you can use one of the WinDriver
Kernel PlugIn samples as the basis for your Kernel PlugIn development.
You can also develop your code "from scratch", if you wish.
As indicated in Section 11.6.3, the
Kernel PlugIn documentation in this manual focuses on the generated
DriverWizard code, and the generic PCI Kernel PlugIn sample —
KP_PCI, located in the WinDriver/samples/pci_diag/kp_pci directory.|
If you are using the a PCI Express card with the Xilinx Bus Master DMA (BMD) design, you
can also use the KP_BMD Kernel PlugIn sample as the
basis for your development; the WinDriver/xilinx/bmd_design directory
contains all the relevant sample files — see the
Xilinx BMD Kernel PlugIn directory structure note at the end of
The following is a step-by-step guide to creating your Kernel PlugIn driver.
12.1. Determine Whether a Kernel PlugIn is Needed
The Kernel PlugIn should be used only after your driver code has been written
and debugged in the user mode. This way, all of the logical problems of
creating a device driver are solved in the user mode, where development and
debugging are much easier.
Determine whether a Kernel PlugIn should be written by consulting
Chapter 10, which explains how to improve the
performance of your driver. In addition, the Kernel PlugIn affords greater
flexibility, which is not always available when writing the driver in the user
mode (specifically with regard to the interrupt handling).