Device Drivers Development – Introduction

Have you ever wondered, what might be the reason for, when you connect a device with USB to a computer and the computer doesn’t detect it? Why is it instructed not to delete the folder C: Windows\System32\drivers? The answer to that is Device Drivers.

What are device drivers?

As the name says, they help in driving the device, i.e. most of the embedded hardware requires initialization and software management system. Device Drivers refer to the software code that directly controls and interacts with the peripherals of the hardware. They form an abstraction layer between the user interface and the hardware. It forms a connecting bridge between the operating system and the hardware, without the OS having any knowledge about the configuration of the hardware. These files are usually with the extension .dll or .sys.

 

Device driver models

Fig.1. Embedded Systems Model and device drivers

Types of Device Drivers 

Device drivers are typically considered either architecture-specific or generic drivers.

  • A device that is architecture-specific manages the hardware that is integrated into the master processor (the architecture). Examples include on-chip memory, integrated Memory Managing Units (MMUs) and floating-point hardware. 
  • A generic device driver manages hardware that is located on the board and not integrated into the master processor. This contains architecture-specific portions of source code. It manages hardware that is not particular to the processor. This allows it to run on a variety of architectures. Examples include board buses like I2C, PCI, off-chip memory, off-chip I/O’s.

Functions performed by the Device Drivers

Regardless of the type of device driver, it performs functions like:

  • Startup/ Shutdown of Hardware allows the initialization of the hardware upon power-on or reset or configuring hardware into its power-off state.
  • Disable/Enable of Hardware allows other software to disable or enable the hardware. 
  • Release/Aquire of Hardware allows other software to free (unlock) the hardware or to gain singular (locking) access to hardware.
  • Read/Write of Hardware allows other software to read/write data from the hardware.
  • Install/Uninstall of Hardware allows other software to install new hardware or to remove hardware.

 

But after all this information regarding device drivers, do you think these are complicated? Yes, the code file may be of considerable size, but the principal fact lies in understanding the functionality of the interface you are working with, with this thorough knowledge you can code it comfortably. Not to worry, this tutorial here will help to write device drivers o for a development board from scratch. This will help you to kick start your journey as a developer in embedded systems.

 

Find out all about What is Embedded Systems.

Find out the next post on Introduction to STM boards.

 

 

Sharing is Caring!!

Leave a Reply

Your email address will not be published.