HOME

TheInfoList



OR:

In computing, a device driver is a computer program that operates or controls a particular type of
device A device is usually a constructed tool. Device may also refer to: Technology Computing * Device, a colloquial term encompassing desktops, laptops, tablets, smartphones, etc. * Device file, an interface of a device driver * Peripheral, any devi ...
that is attached to a
computer A computer is a machine that can be programmed to Execution (computing), carry out sequences of arithmetic or logical operations (computation) automatically. Modern digital electronic computers can perform generic sets of operations known as C ...
or automaton. A driver provides a software interface to hardware devices, enabling operating systems and other computer programs to access hardware functions without needing to know precise details about the hardware being used. A driver communicates with the device through the
computer bus In computer architecture, a bus (shortened form of the Latin '' omnibus'', and historically also called data highway or databus) is a communication system that transfers data between components inside a computer, or between computers. This ex ...
or communications subsystem to which the hardware connects. When a calling program invokes a routine in the driver, the driver issues commands to the device (drives it). 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

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 The 16550 UART (universal asynchronous receiver/transmitter) is an integrated circuit designed for implementing the interface for serial communications. The corrected -A version was released in 1987 by National Semiconductor. It is frequently u ...
are much different from the commands needed to control an
FTDI Future Technology Devices International Limited, commonly known by its acronym FTDI, is a Scottish privately held semiconductor device company, specialising in Universal Serial Bus (USB) technology. It develops, manufactures, and supports devi ...
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
privilege Privilege may refer to: Arts and entertainment * ''Privilege'' (film), a 1967 film directed by Peter Watkins * ''Privilege'' (Ivor Cutler album), 1983 * ''Privilege'' (Television Personalities album), 1990 * ''Privilege (Abridged)'', an alb ...
d 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 Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of logical truths. It is a formal science investigating how conclusions follow from premises ...
(LDD) is written by the operating system vendor, while the
Physical Device Driver Physical may refer to: *Physical examination In a physical examination, medical examination, or clinical examination, a medical practitioner examines a patient for any possible medical signs or symptoms of a medical condition. It generally cons ...
(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 Reverse engineering (also known as backwards engineering or back engineering) is a process or method through which one attempts to understand through deductive reasoning how a previously made device, process, system, or piece of software accompli ...
, 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 Windows Driver Frameworks (WDF, formerly Windows Driver Foundation), is a set of Microsoft tools and libraries that aid in the creation of device drivers for Windows 2000 and later versions of Windows. It complements Windows Driver Model, abstract ...
(WDF). This includes User-Mode Driver Framework (UMDF) that encourages development of certain types of drivers—primarily those that implement a
message-based protocol In computer science, message passing is a technique for invoking behavior (i.e., running a program) on a computer. The invoking program sends a message to a process (which may be an actor or object) and relies on that process and its supporting i ...
for communicating with their devices—as user-mode drivers. If such drivers malfunction, they do not cause system instability. The
Kernel-Mode Driver Framework The Kernel-Mode Driver Framework (KMDF) is a driver framework developed by Microsoft as a tool to aid driver developers create and maintain kernel mode device drivers for Windows 2000 and later releases. It is one of the frameworks included in th ...
(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
module Module, modular and modularity may refer to the concept of modularity. They may also refer to: Computing and engineering * Modular design, the engineering discipline of designing complex devices using separately designed sub-components * Modul ...
s, or as user-mode drivers (for certain types of devices where kernel interfaces exist, such as for USB devices).
Makedev In Unix-like operating systems, a device file or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow a ...
includes a list of the devices in Linux, including ttyS (terminal), lp (
parallel port In computing, a parallel port is a type of interface found on early computers (personal and otherwise) for connecting peripherals. The name refers to the way the data is sent; parallel ports send multiple bits of data at once ( parallel ...
), hd (disk), loop, and sound (these include mixer,
sequencer Sequencer may refer to: Technology * Drum sequencer (controller), an electromechanical system for controlling a sequence of events automatically * DNA sequencer, a machine used to automatically produce a sequence readout from a biological DNA sam ...
, dsp, and audio).
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
.sys .sys is a filename extension used in MS-DOS applications and Microsoft Windows operating systems. They are system files that contain device drivers or hardware configurations for the system. Most DOS files are real mode device drivers. Certain ...
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.


Kernel mode vs. user mode

Device drivers, particularly on
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
platforms, can run in
kernel-mode In computer science, hierarchical protection domains, often called protection rings, are mechanisms to protect data and functionality from faults (by improving fault tolerance) and malicious behavior (by providing computer security). Computer ...
( Ring 0 on x86 CPUs) or in user-mode (Ring 3 on x86 CPUs). The primary benefit of running a driver in user mode is improved stability, since a poorly written user-mode device driver cannot crash the system by overwriting kernel memory. On the other hand, user/kernel-mode transitions usually impose a considerable performance overhead, thus making kernel-mode drivers preferred for low-latency networking. Kernel space can be accessed by user module only through the use of system calls. End user programs like the UNIX shell or other GUI-based applications are part of user space. These applications interact with hardware through kernel supported functions.


Applications

Because of the diversity of hardware and operating systems, drivers operate in many different environments. Drivers may interface with: * Printers *
Video adapters A graphics card (also called a video card, display card, graphics adapter, VGA card/VGA, video adapter, display adapter, or mistakenly GPU) is an expansion card which generates a feed of output images to a display device, such as a computer moni ...
* Network cards * Sound cards * Local
buses A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a road vehicle that carries significantly more passengers than an average car or van. It is most commonly used in public transport, but is also in use for cha ...
of various sorts—in particular, for bus mastering on modern systems * Low- bandwidth I/O buses of various sorts (for pointing devices such as
mice A mouse ( : mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus' ...
,
keyboard Keyboard may refer to: Text input * Keyboard, part of a typewriter * Computer keyboard ** Keyboard layout, the software control of computer keyboards and their mapping ** Keyboard technology, computer keyboard hardware and firmware Music * Musi ...
s, etc.) *
Computer storage Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. The central processing unit (CPU) of a compute ...
devices such as
hard disk A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
,
CD-ROM A CD-ROM (, compact disc read-only memory) is a type of read-only memory consisting of a pre-pressed optical compact disc that contains data. Computers can read—but not write or erase—CD-ROMs. Some CDs, called enhanced CDs, hold both comput ...
, and
floppy disk A floppy disk or floppy diskette (casually referred to as a floppy, or a diskette) is an obsolescent type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined w ...
buses ( ATA, SATA,
SCSI Small Computer System Interface (SCSI, ) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The SCSI standards define commands, protocols, electrical, optical and logical interface ...
,
SAS SAS or Sas may refer to: Arts, entertainment, and media * ''SAS'' (novel series), a French book series by Gérard de Villiers * ''Shimmer and Shine'', an American animated children's television series * Southern All Stars, a Japanese rock ba ...
) * Implementing support for different
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
s * Image scanners * Digital cameras * Digital terrestrial television tuners * Radio frequency communication transceiver adapters for wireless personal area networks as used for short-distance and low-rate wireless communication in home automation, (such as example Bluetooth Low Energy (BLE),
Thread Thread may refer to: Objects * Thread (yarn), a kind of thin yarn used for sewing ** Thread (unit of measurement), a cotton yarn measure * Screw thread, a helical ridge on a cylindrical fastener Arts and entertainment * ''Thread'' (film), 2016 ...
, ZigBee, and Z-Wave). * IrDA adapters Common levels of abstraction for device drivers include: * For hardware: ** Interfacing directly ** Writing to or reading from a
device control register In computing, a device control register is a hardware register that controls some computer hardware device, for example a peripheral or an expansion card. Specific technologies use this terminology with a narrower meaning: * The ISA PNP specificat ...
** Using some higher-level interface (e.g.
Video BIOS Video BIOS is the BIOS of a graphics card in a (usually IBM PC-derived) computer. It initializes the graphics card at the computer's boot time. It also implements INT 10h interrupt and VESA BIOS Extensions (VBE) for basic text and videomode output ...
) ** Using another lower-level device driver (e.g. file system drivers using disk drivers) ** Simulating work with hardware, while doing something entirely different * For software: ** Allowing the operating system direct access to hardware resources ** Implementing only primitives ** Implementing an interface for non-driver software (e.g. TWAIN) ** Implementing a language, sometimes quite high-level (e.g.
PostScript PostScript (PS) is a page description language in the electronic publishing and desktop publishing realm. It is a dynamically typed, concatenative programming language. It was created at Adobe Systems by John Warnock, Charles Geschke, Doug Br ...
) So choosing and installing the correct device drivers for given hardware is often a key component of computer system configuration.


Virtual device drivers

Virtual device drivers represent a particular variant of 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 Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
computer or when a guest operating system is run on, for example, a
Xen Xen (pronounced ) is a type-1 hypervisor, providing services that allow multiple computer operating systems to execute on the same computer hardware concurrently. It was originally developed by the University of Cambridge Computer Laboratory an ...
host. Instead of enabling the guest operating system to dialog with hardware, virtual device drivers take the opposite role and emulates 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 may also operate in a non-virtualized environment. For example, a virtual network adapter is used with a
virtual private network A virtual private network (VPN) extends a private network across a public network and enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network. The be ...
, while a virtual
disk Disk or disc may refer to: * Disk (mathematics), a geometric shape * Disk storage Music * Disc (band), an American experimental music band * ''Disk'' (album), a 1995 EP by Moby Other uses * Disk (functional analysis), a subset of a vector sp ...
device is used with iSCSI. A good example for virtual device drivers can be Daemon Tools. There are several variants of virtual device drivers, such as
VxD VxD is the device driver model used in Microsoft Windows/386 2.x, the 386 enhanced mode of Windows 3.x, Windows 9x, and to some extent also by the Novell DOS 7, OpenDOS 7.01, and DR-DOS 7.02 (and higher) multitasker (TASKMGR). VxDs have access t ...
s, VLMs, and VDDs.


Open source drivers

* Graphics device driver * Printers:
CUPS CUPS (formerly an acronym for Common UNIX Printing System) is a modular computer printer, printing system for Unix-like computer operating systems which allows a computer to act as a print server. A computer running CUPS is a Server (computi ...
* RAIDs: CCISS (Compaq Command Interface for SCSI-3 Support) * Scanners: SANE * Video:
Vidix VIDIX (video interface for *nix) is a portable programming interface for Unix-like operating systems that allows video card drivers running in user space to directly access the framebuffer through Direct Graphics Access extension to the X Wind ...
, Direct Rendering Infrastructure
Solaris Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
descriptions of commonly used device drivers: * fas: Fast/wide SCSI controller * hme: Fast (10/100 Mbit/s) Ethernet * isp: Differential SCSI controllers and the SunSwift card * glm: (Gigabaud Link Module) UltraSCSI controllers * scsi: Small Computer Serial Interface (SCSI) devices * sf: soc+ or social Fiber Channel Arbitrated Loop (FCAL) * soc: SPARC Storage Array (SSA) controllers and the control device * social: Serial optical controllers for FCAL (soc+)


APIs

*
Windows Display Driver Model Windows Display Driver Model (WDDM) is the graphic driver architecture for video card drivers running Microsoft Windows versions beginning with Windows Vista. It is a replacement for the previous Windows 2000 and Windows XP display driver model X ...
(WDDM) – the graphic display driver architecture for Windows Vista and later. * Unified Audio Model (UAM) *
Windows Driver Foundation Windows Driver Frameworks (WDF, formerly Windows Driver Foundation), is a set of Microsoft tools and libraries that aid in the creation of device drivers for Windows 2000 and later versions of Windows. It complements Windows Driver Model, abstract ...
(WDF) * Declarative Componentized Hardware (DCH) - Universal Windows Platform driver * Windows Driver Model (WDM) * Network Driver Interface Specification (NDIS) – a standard network card driver API *
Advanced Linux Sound Architecture Advanced Linux Sound Architecture (ALSA) is a software framework and part of the Linux kernel that provides an application programming interface (API) for sound card device drivers. Some of the goals of the ALSA project at its inception were ...
(ALSA) – the standard Linux sound-driver interface *
Scanner Access Now Easy Scanner Access Now Easy (SANE) is an open-source application programming interface (API) that provides standardized access to any raster image scanner hardware ( flatbed scanner, handheld scanner, video- and still-cameras, frame grabbers, etc.). T ...
(SANE) – a public-domain interface to raster-image scanner-hardware * Installable File System (IFS) – a
filesystem API A file system API is an application programming interface through which a utility or user program requests services of a file system. An operating system may provide abstractions for accessing different file systems transparently. Some file syst ...
for IBM OS/2 and Microsoft Windows NT *
Open Data-Link Interface The Open Data-Link Interface (ODI), developed by Apple and Novell, serves the same function as Microsoft and 3COM's Network Driver Interface Specification (NDIS). Originally, ODI was written for NetWare and Macintosh environments. Like NDIS, ODI ...
(ODI) – network card API similar to NDIS *
Uniform Driver Interface The Uniform Driver Interface (UDI) is a defunct project developed by several companies to define a portable interface for device drivers. The Uniform Driver Interface (UDI) allowed device drivers to be portable across both hardware platforms and op ...
(UDI) – a cross-platform driver interface project * Dynax Driver Framework (dxd) – C++ open source cross-platform driver framework for KMDF and IOKit


Identifiers

A device on the PCI bus or USB is identified by two IDs which consist of 4
hexadecimal In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, hexa ...
numbers each. The vendor ID identifies the vendor of the device. The device ID identifies a specific device from that manufacturer/vendor. A PCI device has often an ID pair for the main chip of the device, and also a subsystem ID pair which identifies the vendor, which may be different from the chip manufacturer.


Security

Devices often have a large number of diverse and customized device drivers running in their operating system (OS) kernel and often contain various
bugs Bugs may refer to: * Plural of bug Arts, entertainment and media Fictional characters * Bugs Bunny, a character * Bugs Meany, a character in the ''Encyclopedia Brown'' books Films * ''Bugs'' (2003 film), a science-fiction-horror film * ''Bugs ...
and
vulnerabilities Vulnerability refers to "the quality or state of being exposed to the possibility of being attacked or harmed, either physically or emotionally." A window of vulnerability (WOV) is a time frame within which defensive measures are diminished, com ...
, making them a target for exploits. ''Bring Your Own Vulnerable Driver'' (BYOVD) uses signed, old drivers that contain flaws that allow hackers to insert malicious code into the kernel. There is a lack of effective kernel vulnerability detection tools, especially for closed-source OSes such as Microsoft Windows where the source code of the device drivers is mostly not public (open source) and the drivers often also have many privileges. Such vulnerabilities also exist in drivers in laptops, drivers for WiFi and bluetooth, gaming/graphics drivers, and drivers in printers. A group of security researchers considers the lack of isolation as one of the main factors undermining kernel security, and published a isolation framework to protect operating system kernels, primarily the
monolithic A monolith is a monument or natural feature consisting of a single massive stone or rock. Monolith or monolithic may also refer to: Architecture * Monolithic architecture, a style of construction in which a building is carved, cast or excavated ...
Linux kernel The Linux kernel is a free and open-source, monolithic, modular, multitasking, Unix-like operating system kernel. It was originally authored in 1991 by Linus Torvalds for his i386-based PC, and it was soon adopted as the kernel for the GNU ope ...
which, according to them, gets ~80,000 commits/year to its drivers.


See also

*
Driver (software) A driver in software provides a programming interface to control and manage specific lower level interfaces that are often linked to a specific type of hardware, or other low-level service. In the case of hardware, the specific subclass of driver ...
*
Class driver {{inline, date=May 2015 In computing, a class driver is a type of hardware device driver that can operate a large number of different devices of a broadly similar type. Class drivers are very often used with USB based devices, which share the essent ...
*
Device driver synthesis and verification Device drivers are programs which allow software or higher-level computer programs to interact with a computer hardware, hardware device. These software components act as a link between the devices and the operating systems, communicating with ea ...
* Driver wrapper * Free software *
Firmware In computing, firmware is a specific class of computer software that provides the low-level control for a device's specific hardware. Firmware, such as the BIOS of a personal computer, may contain basic functions of a device, and may provide h ...
*
Loadable kernel module In computing, a loadable kernel module (LKM) is an object file that contains code to extend the running kernel, or so-called ''base kernel'', of an operating system. LKMs are typically used to add support for new hardware (as device drivers) and/ ...
*
Makedev In Unix-like operating systems, a device file or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow a ...
*
Microcontroller A microcontroller (MCU for ''microcontroller unit'', often also MC, UC, or μC) is a small computer on a single VLSI integrated circuit (IC) chip. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable i ...
*
Open-source hardware Open-source hardware (OSH) consists of physical artifacts of technology designed and offered by the open-design movement. Both free and open-source software (FOSS) and open-source hardware are created by this open-source culture movement and a ...
* Printer driver *
Replicant (operating system) Replicant 6.0 on Samsung Galaxy Note II. An example of phone information in Replicant, including a brief hardware description Replicant is a free operating system (OS) based on the Android mobile platform that aims to replace all proprieta ...
* udev (userspace /dev)


References


External links


Windows Hardware Dev Center

Linux Hardware Compatibility Lists and Linux Drivers

Understanding Modern Device Drivers(Linux)

BinaryDriverHowto, Ubuntu.

Linux Drivers Source
{{DEFAULTSORT:Device Driver Linux drivers Computing terminology Windows NT kernel