Device Driver

Dennis Faas's picture

In computing, a device driver or software driver is a computer program allowing higher-level computer programs to interact with a hardware device.

How it Works

A driver typically communicates with the device through the computer bus or communications subsystem to which the hardware is connected. When a calling program invokes a routine in the driver, the driver issues commands to the device. Once the device sends data back to the driver, the driver may invoke routines in the original calling program.

Drivers are hardware-dependent and operating-system-specific. They usually provide the interrupt handling required for any necessary asynchronous time-dependent hardware interface.

Purpose

A device driver simplifies programming by acting as an abstraction layer between a hardware device and the applications or operating systems that use it. The higher-level application code can be written independently of whatever specific hardware device it will ultimately control, as it can interface with it in a standard way, regardless of the underlying hardware.

Development

Writing a device driver requires an in-depth understanding of how the hardware and the software of a given platform function. Drivers operate in a highly privileged environment and can cause disaster if they get things wrong.

In contrast, most user-level software on modern operating systems can be stopped without greatly affecting the rest of the system. Even drivers executing in user mode can crash a system if the device is erroneously programmed. These factors make it more difficult and dangerous to diagnose problems.

Thus drivers are usually written by software engineers who come from the companies that develop the hardware. This is because they have better information than most outsiders about the design of their hardware. Moreover, it was traditionally considered in the hardware manufacturer's interest to guarantee that their clients can use their hardware in an optimum way.

Device Driver Applications

Because of the diversity of modern hardware and operating systems, many ways exist in which drivers can be used. Drivers are used for interfacing with Printers, Video adapters, Network cards, Sound cards, and the like.

Virtual Device Drivers

A particular variant of device drivers are virtual device drivers. They are used to emulate a hardware device, particularly in virtualization environments, for example when a DOS program is run on a Microsoft Windows computer.

Instead of enabling the guest operating system to dialog with hardware, virtual device drivers take the opposite role and emulate a piece of hardware, so that the guest operating system and its drivers running inside a virtual machine can have the illusion of accessing real hardware.

Attempts by the guest operating system to access the hardware are routed to the virtual device driver in the host operating system as e.g. function calls. The virtual device driver can also send simulated processor-level events like interrupts into the virtual machine.

Virtual devices are also used in a non-virtualized environment. For example a virtual network adapter is used with a virtual private network.

Rate this article: 
No votes yet