What is a driver?
A driver is a program that enables the communication between an operating system (OS) and a hardware component or software application. Every computer uses multiple drivers to control the various installed hardware components and applications. Without these drivers, the hardware and software would not function properly, and in some cases may not be able to function at all. There are two primary types of drivers: device drivers and software drivers.
As its name suggests, device drivers are designed to communicate between an OS and a device. These drives are typically created by the same company that manufactured the device. However, when they are created by a third party, it is designed according to a published hardware standard.
Not all device drivers communicate directly with the device itself. In some cases, there are several drivers layered in a stack that enable communication. The drivers on each end will communicate directly with either the device itself or the OS. The function driver communicates directly with the device. The drivers in between manipulate the communication into different formats that can be understood by the machine. These are called filter drivers.
Common devices for drivers
The vast majority of devices and software that connect to a machine require a driver to operate. Here are some of the most common devices that require drivers:
Unlike device drivers, software drivers are not associated with hardware devices. These programs enable communication between OS and software applications. The main purpose behind software drivers is to enable or disable access to protected data that is only available to programs in kernel mode. As a result, software drivers virtually always run in kernel mode.
Kernel mode vs. user mode
Both device and software drivers have the ability to run in both kernel mode or user mode. User mode is the general-purpose option and is used to carry out most communication. It also has the benefit of offering better stability than kernel mode.
As stated previously, kernel mode is primarily used by core operating system components for accessing protected data. Drivers in kernel mode are implemented as discrete, modular components with well-defined functionalities. It is also preferred for low-latency networking applications.
Virtual device drivers
Virtual device drivers are relatively new technology. They use virtualization technology to emulate a hardware device in virtualized environments on hybrid or cloud networks. They give guest operating systems the illusion of accessing hardware.