Lably
Skip to content

Device driver

Software interface to attached devices

  • 9 min read
  • 9 chapters

Related on Lably

Through Software, Peripheral and Computer

A driver communicates with the device through the computer bus 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 hardware 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 with 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 a USB-to-serial adapter, but each hardware-specific device driver abstracts these details into the same (or similar) software interface.

Sign in to keep reading

8 more chapters are free with a Lably account.

More in Computing and communication