1.2. Background

1.2.1. The Challenge

In protected operating systems such as Windows and Linux, a programmer cannot access hardware directly from the application level (user mode), where development work is usually done. Hardware can only be accessed from within the operating system itself (kernel mode or Ring-0), utilizing software modules called device drivers. In order to access a custom hardware device from the application level, a programmer must do the following:

  • Learn the internals of the operating system he is working on.
  • Learn how to write a device driver.
  • Learn new tools for developing/debugging in kernel mode (WDK, ETK, DDI/DKI).
  • Write the kernel-mode device driver that does the basic hardware input/output.
  • Write the application in user mode that accesses the hardware through the device driver written in kernel mode.
  • Repeat the first four steps for each new operating system on which the code should run.

1.2.2. The WinDriver Solution

  • Easy Development — WinDriver enables Windows, and Linux programmers to create PCI/ISA/EISA/CompactPCI/PCI Express based device drivers in an extremely short time. WinDriver allows you to create your driver in the familiar user-mode environment, using MS Visual Studio, C++, GCC, Windows GCC, or any other appropriate compiler or development environment. You do not need to have any device-driver knowledge, nor do you have to be familiar with operating system internals, kernel programming, the WDK, ETK or DDI/DKI.
  • Cross Platform — The driver created with WinDriver will run on Windows 10/8.1/Server 2012 R2/8/Server 2012/7/Server 2008 R2/Server 2008, Embedded Windows 8.1/8/7, and Linux. In other words — write it once, run it on many platforms.
  • Friendly Wizards — DriverWizard (included) is a graphical diagnostics tool that lets you view /define the device's resources and test the communication with the hardware with just a few mouse clicks, before writing a single line of code. Once the device is operating to your satisfaction, DriverWizard creates the skeletal driver source code, giving access-functions to all the resources on the hardware.
  • Kernel-Mode Performance — WinDriver's API is optimized for performance.
    For drivers that need kernel-mode performance, WinDriver offers the Kernel PlugIn. This powerful feature enables you to create and debug your code in user mode and run the performance-critical parts of your code (such as the interrupt handling or access to I/O mapped memory ranges) in kernel mode, thereby achieving kernel-mode performance (zero performance degradation). This unique feature allows the developer to run user-mode code in the OS kernel without having to learn how the kernel works. For a detailed overview of this feature, see Chapter 11.