Device Driver Layer

Source: Internet
Author: User

The driver layer is generally composed of a hardware abstraction layer (HAL), a board-level support package (BSP), and a driver. It is an indispensable part of embedded systems. It provides the operation interface of the external device for the upper-Layer Program and implements the driver of the device. The upper-layer program can call the driver interface regardless of the internal implementation of the device.

Hardware Abstraction Layer (HAL))

Embedded systems generally include three parts:

Embedded applications

Embedded Operating System

Hardware Platform

Applications run on top of the operating system and use the interfaces provided by the operating system to complete specific functions. The operating system is generally RTOS, which provides core functions such as application task scheduling and control. Based on different applications, the hardware platform has different functions and uses different hardware devices. Therefore, the hardware platform has a complex diversity.

Due to the complexity and diversity of hardware platforms, it is extremely time-consuming to port operating systems for different platforms. As a result, the layer-3 structure of embedded systems has evolved into a layer-4 structure, that is, the hardware abstraction layer (HAL) is added between the operating system layer and the hardware platform ).

The hardware abstraction layer is essentially a set of API interfaces that operate on hardware. It is an abstraction of hardware functions. The hardware abstraction layer provides services for operating systems and applications through APIS. Generally, Hal includes hardware initialization, data input and output operations, and hardware device configuration operations.

With the hardware abstraction layer, the operating system and applications do not need to care about the underlying hardware platform information. the kernel and hardware-related Code do not need to be modified because of the hardware, as long as the hardware abstraction layer can provide necessary services, it can shield the underlying hardware and facilitate system transplantation.

Hal is just an abstraction of hardware. It defines a group of APIS, but does not provide specific implementations. Generally, Hal functions are implemented in the form of BSP to perform operations on specific hardware.

Some elements of Hal design are:

Close correlation with hardware

Unrelated to the Operating System

Interface functions include all functions supported by hardware or required hardware.

Simple and clear interface

Board-level support package (BSP)

The board-level support package is a layer between the system hardware and the driver of the operating system. It is the specific implementation of Hal, so some people also call it the BSP Layer HAL.

BSP mainly supports the operating system and provides upper-layer drivers with the functions required to access the hardware device registers so that they can run better on the hardware motherboard.

BSP features: hardware relevance. BSP programs operate on hardware directly; Operating System relevance. different operating systems have different software hierarchies and different hardware abstraction layer interfaces, therefore, the specific implementation is different. BSP must be implemented according to the interface definition of the operating system. Therefore, most BSP programming processes are modified on a molded BSP template.

The specific functions are embodied in two aspects:

1. During system startup, hardware initialization is completed, such as system memory, registers, and device interruption settings.

2. provide hardware access methods for general device drivers of the operating system, that is, hardware-related device drivers.

Device Driver

A device driver is a driver in an operating system that provides interfaces for upper-layer software to operate a device. If necessary, use the functions provided by BSP to operate a hardware device. The quality of the driver directly affects the system performance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.