Device Drivers

KS3 Computer Science

11-14 Years Old

48 modules covering EVERY Computer Science topic needed for KS3 level.

GCSE Computer Science

14-16 Years Old

45 modules covering EVERY Computer Science topic needed for GCSE level.

A-Level Computer Science

16-18 Years Old

66 modules covering EVERY Computer Science topic needed for A-Level.

GCSE Computer Hardware (14-16 years)

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module

A-Level Input Devices Resources (16-18 years)

  • An editable PowerPoint lesson presentation
  • Editable revision handouts
  • A glossary which covers the key terminologies of the module
  • Topic mindmaps for visualising the key concepts
  • Printable flashcards to help students engage active recall and confidence-based repetition
  • A quiz with accompanying answer key to test knowledge and understanding of the module

When a user adds a new component to the computer system, for instance a printer, the device drivers will allow the communication and recognition of the component with the operating system, so that the new piece of hardware can function properly.

In the early days of programming and computers, device drivers would be created using assembly language, which refers to a low level language that can access hardware and CPU instructions quickly and directly.

Though nowadays, most programmers who write code for device drivers work with program languages such as C or C++.

These programming languages offer great access to low level instructions as well as extremely complex program instructions and data structures.

Programmers must not only create program the functionality of device drivers, they must also make sure these drivers incorporate a high leave of security.

This is because such software operates at high levels of privilege, thus leading to system compromise or vulnerabilities from a security point of view, it may also cause operational faults such as crashing or freezing, and therefore decreasing the overall performance of the system.

What are Device Drivers?

In computing a device driver refers to a computer program, which controls or operates a particular type of device that is attached to the computer. A device driver provides a software interface to hardware devices, thus enabling operating systems and computer programs to access and communicate with the hardware functions without requiring to acknowledge details about the hardware that is being used.

This communication occurs through a computer bus, or a communications subsystem to which the hardware connects.

A computer bus refers to a communication system that transfers data between components inside a computer or between computers.

When a device driver calls a program, it invokes a routine in the driver, and thus the driver then will issue commands to the device.

When the device sends data back to the driver, the driver then can invoke routines in the original calling program.

A routine refers to is a sequence of program instructions that perform a specific task, packaged as a unit, moreover, this unit can be used in programs wherever that particular task should be performed. Routines can be defined within programs, or even in libraries that can be used by many programs.

Drivers can be recognised to be hardware dependent and operating system specific, furthermore, device drivers provide the interrupt handling required for any necessary asynchronous time dependent hardware interface.

In an operating system, device drivers are required because some computer components do not use standard commands.

For instance, two video cards from different manufacturers have the same functionality, however each video will have to require its own driver, as different hardware require different commands. Furthermore, operating systems also require different drivers, a driver that is written for Microsoft Windows cannot be used by a driver that is written for macOS.

Many computer components require device drivers, and some common examples are:

Graphic cards, computer printers, scanners, modems, sound cards, network cards etc.

Likewise, there are other computer peripherals, which don’t require device drivers, as driver is already built in the operating system, therefore when those peripherals are required, the operating system recognises them and knows how to use them.

Examples of such parts include:

USB sound cards, USB hubs (a component which turns one USB more to two or more), hard drives, floppy drives, mouse, keyboard, RAM’s, processors, CD, DVD etc.

It is essential that the correct device driver is used, as a wrong device driver can prevent the hardware from working correctly, furthermore, keeping drivers updated can avoid potential problems when using programs with new piece of hardware.

How do Device Drivers Work?

Within the operating system runtime environment, device drivers run at a high level of privilege. As a matter of fact, some device drivers are directly linked to the operating system kernel, which is a portion of an operating system, such as Mac OS, Windows, or Linux that remains memory resident.

Device drivers function by relaying requests for device access and actions from the operating system and any active application to the respective hardware devices. Furthermore, device drivers also deliver outputs or messages/status from the hardware devices to the operating system (and thus to the applications themselves).

In the instance of a scanner or a printer, both of these systems have device drivers, moreover, both of these are accompanied by a compact disk, which includes the software code for losing the device driver.

In order to establish a connection with the PC, it is mandatory to load the software into your PC, so the PC can identify the new peripheral and communicate with it. Although some of the new systems don’t require the user to go through the process of installing the driver.

Anyhow, when the driver is installed it creates what is referred to is a device object, which is deigned to control the specific component, which was attached to the system. The driver represents the peripheral device and consists of a physical structure of modes that will make up the process of allowing your operating system to control the peripheral device.

The device driver communicates with the computer system (i.e. your PC) through the computer bus which is used to connect the device with computer.

Device drivers operate within the kernel of the operating system. The kernel is a part of the of the operating system that has direct interactions with the physical structure of system.

Rather than interacting and accessing the new device directly, the operating system will load the device drivers and it will call the specific functions within the driver software to execute specific tasks on the device, for instance in our case, printing a sheet of paper or scanning a document, thus meaning that each driver has the device specific content codes which are required to carry out the actions on the device.

Architecture of Device Drivers

At the basic level, device drivers can be split into two layers, logical layer, and a physical layer.

Logical Layer:

Logical layers process data for a class of devices.

Physical Layer:

Physical layers communicate with specific device instances.

In order for them to function together, the logical layer need to communicate with a particular serial port chip, and thus the physical layer will address this.

Every device driver consists of two important data structures: The device information structure and the static structure.

These structures are used to install the device driver as well as to share information among the entry point routines.

Device information structure:

The device information structure is a static file, which is passed to the install entry point, and its functionality is to pass along any information required to install a major device into the install entry point where it is going to be used to initialise the static structure.

Static structure:

The static structure is used to pass along information between the different entry points and is initialised with the information stored in the information structure.

In order for the operating system to communicate with the driver, it uses the entry point routines.

Purpose of Device Drivers

The main purpose and functionality of device drivers is to provide a level of abstraction by acting as a translator between a hardware device (i.e. a printer or a scanner) and the applications or the operating system that use it.

Though programmers can independently write higher-level code of whatever specific hardware the end user is using.

For instance, a high level application, which interacts with a serial port, may have two functions for send data and receive data.

On the contrary, device drivers at low-level applications implement these function with the need to communicate to the specific serial port controller installed on the computer.

Types of Device Drivers

Device drivers are preset in almost every device associated with a computer system, whether it was BIOS (Basic Input Output System) or a virtual machine, they all require device drivers.

These device drivers can be broadly classified into two categories:

Kernel Device Drivers:

A kernel device driver is a generic device driver that will load with the operating system into the memory as part of the operating system, furthermore, as soon as the driver is required, it can be invoked using a pointer.

These drivers are applicable to the motherboard, BIOS, processor, and similar hardware, which are part of the kernel software.

Though one of the problem that arise from kernel device drivers is that when they are required and invoked, thy are loaded into the RAM (Random Access Memory)  thus they cannot manage to move to the page file (i.e. virtual memory like a hard disk SSD). Therefore is there are a number of device drivers which are operating at the same time, they can overall slow down the machine, as they will be heavily relying on the RAM, hence why there is a minimum system requirement for each operating system.

Random Access Memory (RAM): Random Access Memory refers to the computer memory that can be read and changed in any order. This type of memory is used to store working data and machine code. A computer system comes with built in RAM.

User Mode Device Drivers:

User mode device drivers are device drivers that are triggered usually during a users session on a computer.

Drivers for “plug and play” services fall in to this category. User device drivers can be written to the disk in order for it to not strain the resources on the computer.

Though device drivers, which are relating to gaming devices, it is recommended to keep them in the main memory (RAM).

Other types of drivers include

Block Drivers and Character Drivers:

These two device drivers can be categorised to belonging to the data reading and writing category.

Character Drivers:

These drivers are used as serial buses, they write data one character at a time (meaning a byte in a generic terms). Therefore if a device/component is connected to the computer system via a serial port, then they are characterised as being a character driver, for instance a keyboard or a mouse.

Block Drivers:

Block drivers are drivers that refer to writing and reading of more than one character at a time. These drivers create blocks and retrieve as much information as the block can withstand.

Generic and OEM (Original Equipment Manufacturer) Drivers:

Generic device drivers are can be generic or even OEM related.

If the device driver comes with its own operating software, then it is categorised as being generic.

Generic drivers can be utilised with a number of different brands of a particular device type.

For instance, Windows 10 works with a number of generic drivers that function without having the need to install any other software manually.

On the other original equipment manufacturers (OEM) create their own device drivers. These drivers have to be installed separately after installing the operating system.

Virtual Drivers:

Virtual drivers refer to software that is used to emulate hardware and other devices so that multiple applications running in protected mode can have access hardware interrupt channels, hardware resources, and memory without causing conflicts.

Summary and Facts

What are Device Drivers?

In computing a device driver refers to a computer program, which controls or operates a particular type of device that is attached to the computer. A device driver provides a software interface to hardware devices, thus enabling operating systems and computer programs to access and communicate with the hardware functions without requiring to acknowledge prices details about the hardware that is being used.

Many computer components require device drivers, and some common examples are:

Graphic cards, computer printers, scanners, modems, sound cards, network cards etc.

Likewise, there are other computer peripherals, which don’t require device drivers, as driver is already built in the operating system, therefore when those peripherals are required, the operating system recognises them and knows how to use them.

Examples of such parts include:

USB sound cards, USB hubs (a component which turns one USB more to two or more), hard drives, floppy drives, mouse, keyboard, RAM’s, processors, CD, DVD etc.

How do Device Drivers Work?

Device drivers function by relaying requests for device access and actions from the operating system and any active application to the respective hardware devices. Furthermore, device drivers also deliver outputs or messages/status from the hardware devices to the operating system (and thus to the applications themselves).

Device drivers operate within the kernel of the operating system. The kernel is a part of the of the operating system that has direct interactions with the physical structure of system.

Rather than interacting and accessing the new device directly, the operating system will load the device drivers and it will call the specific functions within the driver software to execute specific tasks on the device, for instance in our case, printing a sheet of paper or scanning a document, thus meaning that each driver has the device specific content codes which are required to carry out the actions on the device.

Architecture of Device Drivers:

  • Logical layer
  • Physical layer
  • Every device driver consists of two important data structures: The device information structure and the static structure.
  • These structures are used to install the device driver as well as to share information among the entry point routines.
  • Device information structure
  • Static structure

Purpose of Device Drivers:

  • Operate and control a device attached to a computer
  • Provide an interface between the operating system (or application) and the device
  • To tell the operating system how to communicate with the hardware component
  • Translate requests between the device and the computer

Types of Device Drivers:

  • Device drivers can be broadly classified into two categories:
    • Kernel Device Drivers
    • User Mode Device Drivers

Other types of drivers include-

  • Block Drivers and Character Drivers
  • Character Drivers
  • Block Drivers
  • Generic and OEM (Original Equipment Manufacturer) Drivers
  • Virtual Drivers

References:

  1. https://www.sciencedirect.com/topics/engineering/device-driver
  2. spamlaws.com/how-device-drivers-work.html
  3. https://www.engineersgarage.com/how_to/how-device-drivers-work/
  4. https://en.wikipedia.org/wiki/Subroutine
  5. https://searchenterprisedesktop.techtarget.com/definition/device-driver
  6. spamlaws.com/how-device-drivers-work.html
  7. https://www.thewindowsclub.com/what-is-device-driver/
  8. https://www.slideshare.net/suhassr/device-drivers
  9. https://www.techopedia.com/definition/6824/device-driver
  10. https://simple.wikipedia.org/wiki/Device_driver
  11. https://www.computerhope.com/jargon/d/driver.htm#:~:text=More%20commonly%20known%20as%20a,devices%2C%20such%20as%20a%20printer.
  12. https://www.techwalla.com/articles/device-driver-examples
  13. https://www.computerscience.gcse.guru/theory/software-device-drivers