Dulranga's Notes
Semester 3Operating Systems

Device Drivers

A device driver is a special piece of adapter software that runs at kernel level and provide a common interface for the kernel to talk to hardware. Without a device driver, kernel would have to know specific implementation details of each and everyone of hardware.

Device drivers make the kernel support extensible for any hardware and make it future proof.

device-driver.png

This is why we can swap a Samsung Hard-drive for a Sandisk one. Also your printer might not work until you update the driver.

Categories of Device Drivers

  • Character Drivers: Handle data as an unbuffered stream of individual bytes (e.g., serial ports, keyboards, mice).
  • Block Drivers: Handle data in fixed-size blocks (e.g., SSDs, hard drives, USB drives). They support random access and caching via the OS buffer cache.
  • Network Drivers: Manage packet-based communication interfaces (e.g., Ethernet controllers, Wi-Fi chips) to transmit and receive data frames.

On this page