Actions

Device Driver

A device driver is a particular form of software Application that is designed to enable interaction with hardware devices. Without the required device driver, the corresponding hardware device fails to work. A device driver usually communicates with the hardware by means of the communications subsystem or computer bus to which the hardware is connected. Device drivers are operating system-specific and hardware-dependent. A device driver acts as a translator between the hardware device and the programs or operating systems that use it. A device driver may also be called a software driver.[1]


How Device Drivers Work[2]
Think of device drivers like translators between a program you're using and a device that that program wants to utilize somehow. The software and the hardware were created by different people or companies and speak two completely different languages, so a translator (the driver) allows them to communicate. In other words, a software program can provide information to a driver to explain what it wants a piece of hardware to do, information the device driver understands and then can fulfill with the hardware.


Purpose and Development of Device Drivers[3]

Purpose
The main purpose of device drivers is to provide abstraction by acting as a translator between a hardware device and the applications or operating systems that use it. Programmers can write higher-level application code independently of whatever specific hardware the end-user is using. For example, a high-level application for interacting with a serial port may simply have two functions for "send data" and "receive data". At a lower level, a device driver implementing these functions would communicate to the particular serial port controller installed on a user's computer. The commands needed to control a 16550 UART are much different from the commands needed to control an FTDI serial port converter, but each hardware-specific device driver abstracts these details into the same (or similar) software interface.

Development Writing a device driver requires an in-depth understanding of how the hardware and the software works for a given platform function. Because drivers require low-level access to hardware functions in order to operate, drivers typically operate in a highly privileged environment and can cause system operational issues if something goes 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.

The task of writing drivers thus usually falls to software engineers or computer engineers who work for hardware-development companies. 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. Typically, the Logical Device Driver (LDD) is written by the operating system vendor, while the Physical Device Driver (PDD) is implemented by the device vendor. However, in recent years, non-vendors have written numerous device drivers for proprietary devices, mainly for use with free and open source operating systems. In such cases, it is important that the hardware manufacturer provide information on how the device communicates. Although this information can instead be learned by reverse engineering, this is much more difficult with hardware than it is with software.

Microsoft has attempted to reduce system instability due to poorly written device drivers by creating a new framework for driver development, called Windows Driver Frameworks (WDF). This includes User-Mode Driver Framework (UMDF) that encourages development of certain types of drivers—primarily those that implement a message-based protocol for communicating with their devices—as user-mode drivers. If such drivers malfunction, they do not cause system instability. The Kernel-Mode Driver Framework (KMDF) model continues to allow development of kernel-mode device drivers, but attempts to provide standard implementations of functions that are known to cause problems, including cancellation of I/O operations, power management, and plug and play device support.

Apple has an open-source framework for developing drivers on macOS, called I/O Kit.

In Linux environments, programmers can build device drivers as parts of the kernel, separately as loadable modules, or as user-mode drivers (for certain types of devices where kernel interfaces exist, such as for USB devices). Makedev includes a list of the devices in Linux, including ttyS (terminal), lp (parallel port), hd (disk), loop, and sound (these include mixer, sequencer, dsp, and audio).

Microsoft Windows .sys files and Linux .ko files can contain loadable device drivers. The advantage of loadable device drivers is that they can be loaded only when necessary and then unloaded, thus saving kernel memory.


Devices that Do and Do Not Need Drivers[4]

Devices that Need Drivers
Hardware devices that are unknown by the operating system or have features unknown by the operating system all require drivers. Below is a list of hardware devices and peripherals that require drivers.

  • Card reader
  • Controller
  • Modem
  • Motherboard chipset
  • Network card
  • Printer
  • Scanner
  • Sound card
  • Tape drive
  • USB devices
  • Video card

Devices that may not need Drivers
Today's operating systems have many generic drivers that allow hardware to work at a basic level without needing drivers or software. However, if that device has features unknown to the operating system, it will not work without drivers. For example, you could plug any keyboard into a computer and expect it to work. However, if that keyboard has any special keys or features, they will not work until the drivers are installed.

  • CPU
  • Disc drive
  • Fan
  • Hard drive
  • Heat sink
  • Joystick
  • Keyboard
  • Mouse
  • Monitor
  • Power supply
  • RAM
  • Speakers
  • Thumb drive
  • UPS


See Also

A device driver is a software component that allows an operating system to interact with hardware devices. It acts as an intermediary between the operating system and the hardware, translating high-level commands from the operating system into low-level commands that the hardware can understand.

  • Hardware Abstraction Layer (HAL): The hardware abstraction layer is a layer of software that provides a consistent interface for interacting with hardware devices, regardless of their specific implementation details. Device drivers often interact with the HAL to access hardware resources in a platform-independent manner.
  • Kernel Mode: Kernel mode is a privileged execution mode in which device drivers operate within an operating system. Device drivers run in kernel mode to access hardware directly and perform privileged operations that are not accessible to user-mode applications.
  • Plug and Play (PnP): Plug and Play is a technology that allows hardware devices to be automatically detected and configured by the operating system without the need for manual intervention. Device drivers play a crucial role in the Plug and Play process by facilitating device detection, enumeration, and initialization.
  • Device Manager: The Device Manager is a component of the operating system that allows users to view and manage installed hardware devices and their associated device drivers. Users can use the Device Manager to update, uninstall, or disable device drivers as needed.
  • Driver Development Kit (DDK): A Driver Development Kit is a set of tools and documentation provided by operating system vendors to assist developers in creating device drivers for their platforms. The DDK typically includes libraries, header files, sample code, and debugging tools to aid in driver development.


References

  1. Definition - What Does Device Driver Mean? Techopedia
  2. How Do Device Drivers Work? Lifewire
  3. Purpose and Development of Device Drivers Wikipedia
  4. Devices that Do and Do Not Need Drivers Computerhope