--BSP analysis of embedded Linux system transplantation

Source: Internet
Author: User

embedded Linux System Migration--BSP analysis I. introduction ofBSP

Embedded system consists of hardware environment, embedded operating system and application, hardware environment is the hardware platform of operating system and application, it has different requirements depending on the application. The diversity of hardware platform is the main feature of embedded system, how to make the embedded operating system run effectively on different hardware platform is the key problem in the development of embedded system. The solution is to provide a hardware-related layer between the hardware platform and the operating system to shield the differences of these hardware, to provide a unified operating environment, the hardware-related layer is embedded system board-level support Packages BSP (Board supporting package, referred to as BSP).

BSP is the middle-tier software between hardware platform and operating system in embedded system, the main purpose is to shield the diversity of the underlying hardware, complete the direct operation to the hardware according to the requirements of the operating system, provide the operating system with the underlying hardware information and finally start the operating system. BSP has the characteristics of hardware correlation and operating system affinity,BSP main function is to shield the hardware, provide operating system and hardware driver , Specific features include:

A, single-board hardware initialization, primarily CPU initialization, provides the underlying hardware support for the entire software system

B. provide device drivers and systems for the operating system Interrupt Service Program

C, Customizing the operating system function , and provides a real-time multitasking for software systems. Operating Environment

D , initialize operating system

BSP is relative to the operating system, different operating systems have different definitions of the BSP, It is required to Implement the functions of the BSP is different. In the embedded Linux System, the primary is to initialize the underlying hardware and boot the operating system, and theBSP is hardware-related, but also to consider the initialization of the hardware operation. These initialization operations are mainly related to CPU, memory, interrupt and other relevant registers and the coprocessor is properly configured. In different stages of development,the work done by BSP varies depending on the location of the core and the file system.;during the development debugging phase,BSP to be able to communicate with the host and download the core from the host, in the target product,theBSP to be able to load the core from the nonvolatile storage device.

For Development Board providers,BSP is a material and resource bundle provided by the manufacturer of the Development Board.
Typically include :

Hardware-related :
A, Development Board schematic diagram
B, Development Board components list
C, interface definition
D, address distribution

Software related :

    a, some operating systems bootloader and source code  
    b, some operating system cropped image files ( if linux as wince may have CEC file

Service related :
After-Sales technical support

Second, buildroot Introduction

BuildRoot is a Collection of Makefile and patches that enable Building Cross-tool chains, root file systems, and Linux kernel images. BuildRoot is a powerful tool in the development of embedded systems .

Official website: https://www.buildroot.org

1. BuildRoot Engineering Catalogue Analysis

/DL Store the downloaded source package

/toolchain placing the configuration file and source code of the compilation Cross tool

/fs/ mainly stores the source code of various file systems

/fs/skeleton storage skeleton, where the file system image is generated for the first time

/linux Linux source Storage Place

/configs Pre-positioned some Development Board configuration reference, arm,X86 and MIPS , etc.

/board found the friendly arm configuration file

/boot bootloader configuration, can be configured to download the source code

/package mainly store application software configuration files, the future development of the main battlefield, you can configure their files, add source packages or deletions, using buildroot to achieve cross-compilation

/output compiled build directory

/output/images Store all image files generated after compilation

/output/build compiled source package,buildroot from the DL Package Extract to build inside, and then compile

/output/staging This directory is very important, it provides a cross-compilation of dependent libraries, generally when make , will use the staging library file to link

/output/target Embedded Device root file system, which is the root file system image we actually burned

/output/host cross-compiler tool locations such as ARM-LINUX-GC

/output/toolchain third-party cross-compiler tool location, my directory is empty.

three,BSP case Analysis

Jiuding Technology releases the Qt_x210v3 BSPbased on the X210 Development Board . The structure is as follows:

BuildRoot, building the root file system

Kernel,Kernel kernel

Uboot,xboot,uboot Transplant Section

Mk: Management, compilation scripts for the entire BSP,

1. BuildRoot

BuildRootis a tool integration package that integrates the creation of a cross-compilation tool chain, as well as the entireRootfsthe configuration compilation process. Meanwhile,BuildRootwill integrate thebootloaderand theKernelof theMake xxx_defconfig+make menuconfigconfiguration process, all withbootloader,Kernel,RootfsThe configuration is available in theBuildRootcompleted in. BuildRootitself is also usedMake xxxconfigthe interface options are configured.

2.mk script

MkThe main function of the script is to compileBSPall of the source code (includingbootloader,Kernel,Rootfsetc.), is actually the wholeBSPof theMakefile. Mkscripts can specifyBSPor compile all of the targets (bootloader,Kernel,Rootfs). Here's how to use it:

-j=n using n threads when building source project (example:-J=16)

-X,--xboot build bootloader xboot from source file

-ui,--Uboot_inand build uboot for eMMC

-un,--Uboot_nand build uboot for NAND flash

-K,--kernel build kernel from source file and using default Config file

-R,--rootfs build root file system

-re,--rootfs_ext3 build rootfs for emmc,used with Uboot

-RJ,--ROOTFS_JFFS2 build rootfs for nand,used with Uboot

-U,--update gen update package update.bin,used with Xboot

-A,--all build all, include anything

-H,--help display this help and exit


This article from "Endless life, Struggle not only" blog, reprint please contact the author!

--BSP analysis of embedded Linux system transplantation

Related Article

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.