ArticleslgStudy

computer science

Device driver

Device driver is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Device driver rather than just read about it. In short: A device driver is software that operates and controls a device attached to a computer. The purpose of device drivers is to provide hardware abstraction, i.e., to provide a standardized interface over which other software can take advantage of hardware without possessing intricate, specialized knowledge of each piece of hardware.

Device driver — main illustration
Device driver — illustration

Key takeaways

  • Device driver belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Device driver to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Device driver from memory before moving on to harder problems.

Reference excerpt

A device driver is software that operates and controls a device attached to a computer. The purpose of device drivers is to provide hardware abstraction, i.e., to provide a standardized interface over which other software can take advantage of hardware without possessing intricate, specialized knowledge of each piece of hardware. A driver communicates with the device through the computer bus or communications subsystem to which the hardware connects. A calling app can invoke a routine within the driver, which issues commands to the device and returns the resulting data to the calling app. 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 app or operating systems using it. Software developers can write higher-level code independently of whatever specific hardware the end-user is using. For example, an app for interacting with a serial port may have two routines to send data and receive data. At a lower level, a device driver implementing these functions would communicate with the computer's serial port controller. This driver knows the appropriate commands. For instance, the commands needed to control a 16550 UART are different from those of a USB-to-serial adapter, but the device driver abstracts these details into the same (or similar) software interface. Therefore, the same app on different computers uses the same routines to communicate with device drivers and gets the same results, without getting concerned with how drivers get said results. Because of the diversity of modern hardware and operating systems, drivers operate in many different environments. Drivers may interface with printers, video adapters, network interface controllers (NICs), sound cards, PC chipsets, power- and battery management features, local buses (in particular, for bus mastering on modern systems), computer storage devices (such as hard disk, CD-ROM, and floppy disk drives), image scanners, digital cameras, digital terrestrial television tuners, IrDA adapters, wireless personal area networks (such as Bluetooth Low Energy, Thread, Zigbee, and Z-Wave), and even file systems. Choosing and installing the correct device drivers for the given hardware is often a key component of computer system configuration.

Development Writing a device driver requires an in-depth understanding of how the hardware and the software work 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, misbehavior in 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 developers or computer engineers who work for hardware vendors because they possess the necessary information at hand. It is in the manufacturer's interest to guarantee that their clients can use their hardware optimally. However, with the growth of the Linux operating systems, non-vendors have written numerous free and open-source device drivers for proprietary devices, including free and open-source graphics device drivers. In such cases, the necessary information on how device works must be obtained either from the hardware vendor (as is the case with open-source hardware) or via reverse engineering. Operating systems support device drivers implemented as loadable kernel modules, which can be loaded into memory only when necessary and then unloaded, thus saving kernel memory. Each OS, however, has a different term for these modules, including "kernel loadable module" in FreeBSD, "kernel extension module" in AIX, "dynamically loadable kernel module" in HP-UX, and "downloadable kernel module" in VxWorks. They don't have a particular name in Microsoft Windows because all device drivers are loadable modules.

In Microsoft Windows Device drivers in Microsoft Windows bear use the .sys filename extension. Kernel-mode device drivers interface with the OS through the Hardware Abstraction Layer (HAL), in implemented in hal.dll. Windows uses a combination of full drivers and "minidrivers" (more specifically "miniclass" and "miniport" drivers), where the full driver is provided with the operating system while vendors develop minidrivers to implement or optimize a subset of the full driver stack.

APIs and frameworks The operating system categorizes devices into classes and provides a number of class-specific driver APIs, including:

Windows Driver Model (WDM) for all device classes Network Driver Interface Specification (NDIS) for network devices Windows Display Driver Model (WDDM) for display drivers WaveRT for real-time audio drivers StorPort for storage devices Windows Image Acquisition (WIA) for image scanners and apps that read and write digital pictures Human Interface Device (HID) for keyboards, mice, touchpads, graphics tablets, touchscreens, and other input devices All of the above can have full drivers and minidrivers. Microsoft develops and maintains Windows Driver Frameworks (WDF), a set of libraries and tools that intend to ease the process of creating high-quality drivers. WDF includes User-Mode Driver Framework (UMDF) that encourages development of user-mode drivers for devices that can communicate with the OS via message-based protocols. If such drivers malfunction, they do not cause system instability. The Kernel-Mode Driver Framework (KMDF) caters to the development of traditional 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.

… excerpt ends here. Continue reading the full article.

Illustrations

Device driver illustration

Worked examples

Example 1 — a first encounter with Device driver

Start with the simplest possible case. Write down what Device driver claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Device driver before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Device driver ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Device driver

In research
Device driver appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Device driver in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Device driver is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computing terminology, Device drivers, Linux drivers, so understanding it makes those chapters shorter.
In everyday life
Look for Device driver outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Device driver” →

How to study Device driver in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Device driver means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Device driver out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Device driver in simple terms?

A device driver is software that operates and controls a device attached to a computer. The purpose of device drivers is to provide hardware abstraction, i.e., to provide a standardized interface over which other software can take advantage of hardware without possessing intricate, specialized know…

Why does Device driver matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Device driver?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Device driver.

Tags

  • Computing terminology
  • Device drivers
  • Linux drivers
  • Windows NT kernel

Keep exploring