DFC Information
DriverGen Wizard
The DFC DriverGen wizard gets you started quickly by providing a complete driver project
based on your desired driver name, types of resources used by your device, and other
parameters. The project includes skeleton routines for device initialization and
dispatching of application requests. The project also includes Visual C++ 4.2 makefiles
for an NT driver build of your project and a VxD build. With DFC, you are always just a
few clicks away from a new NT driver and/or Windows 95 VxD which you can build and load
with no source additions required.
Click here to see
example DriverGen source for a device using a port range and an interrupt.
Driver Classes Manage Initialization
The DFC CIsaDriver and CPciDriver classes completely manage the tedious tasks of
device creation and driver initialization for NT drivers and VxDs. The CIsaDriver::OnEntry
routine (used in the above example) creates device objects based on registry
configurations containing resource settings. This implementation is the same for both the
NT and Windows 95 versions of the DFC library.
So how difficult is it to change a DFC driver to support a PCI bus
device? Simple. Just change the driver class from CIsaDriver to CPciDriver. On NT, the
CPciDriver::OnEntry routine iterates PCI slots searching for your vendor and device ID
values. The CPciDriver class configures device resources using assigned slot
configurations. In VxD builds, the CPciDriver::OnEntry routine actually doesn't do
anything. In VxD builds, PCI devices are created in a Plug & Play event handler inside
the DFC library.
Automatic Resource Configuration, Initialization, and Reservation
The DFC CPortRange, CMemory, CInterrupt, and CDmaAdapter classes work with the rest
of the framework to manage configuration, initialization, and reservation of device
resources. This is another of the many DFC features which free developers to concentrate
more on the details of controlling their hardware -and less on the details of the DDK API.
On Windows 95, device resource configurations can be defined in
registry entries or entered using INF files and the Plug & Play Configuration Manager.
High Performance C++ Interface
The DFC library allows developers to create request handlers, interrupt service routines,
cancel routines, synchronization routines, etc., as member functions of their C++ device
class. However, rather than use virtual functions to interface the C-oriented DDK
interface to the C++ member functions, the DFC library makes extensive use of templates.
The DFC templates generate fast inline calls which minimize the performance impact of
using C++. Of course, DFC also provides the option of creating simple C-style static
member functions if a developer prefers that style and/or wants to eliminate those one or
two extra processor cycles involved in calling an object member function.
Structured Documentation
While the DDK documentation forces a developer to hunt around for the information they
need at each stage of a driver project, the DFC library documentation provides a logical
progression through the steps of creating an NT driver and/or Windows 95 VxD. A developer
will typically generate a new driver project using the DFC DriverGen wizard utility. The
DFC documentation then guides the developer through getting up and running with their new
driver:
- Introduction. What's included in the DFC package and a roadmap for
new users.
- Driver Projects. The purpose of each project file generated by
DriverGen and how to build the driver.
- Driver Setup. How to prepare a kernel-mode driver for execution and
how to define the resource values for non-PCI devices.
- Driver Usage. How to open a handle to a device and send requests from
a user-mode application or DLL.
Remaining chapters provide help on synchronization, interrupt
handling, cancel routines, DFC class reference, troubleshooting and other miscellaneous
topics.
Samples
DFC samples include an A/D converter card driver, digital I/O card driver, and a
driver for a memory-mapped device. The samples illustrate how to handle a range of
resource types and request handling mechanisms. All of the DFC samples can be built as
either a VxD for Windows 95 or a .SYS module for Windows NT.
Click here to see an A/D converter
card DFC sample.
Support
The DFC library includes 90 days of free technical support.
Full Source Code
Both the DFC library for Windows NT and the library for Windows 95 include
full source code.
Back to main DFC page... |