Embedded Linux porting and Uboot (a): Bootloader introduction, Uboot introduction (features, directory structure)

First, what is the Bootloader

In the embedded operating system, BootLoader is run before the operating system kernel to run . Can initialize the hardware devices, the establishment of memory space map , the system hardware and software environment which will bring an appropriate state, in order for the final call to the operating system kernel ready for the right environment. In embedded systems, usually it does not like that kind of BIOS firmware (note, some embedded CPU will be built for a short startup program), so the whole system is fully loaded to start the task done by BootLoader.

Bootloader, different processor architectures have different Bootloader . Bootloader depends not only on the CPU architecture and depending on the configuration embedded board-level device . For two different embedded board, even if they use the same processor, to get Bootloader program run on a board can be run on a separate board, generally requires the modification of the source Bootloader.

In turn, the majority still have a very Bootloader more than common , some Bootloader can also support a variety of embedded system architecture. For example, U-Boot will support both architectures PowerPC, ARM, MIPS and X86, and support the board there are hundreds. Typically, they are able to automatically boot from the storage medium, we are able to boot the operating system startup, and most can support serial and Ethernet interfaces.

For Bootloader can be summarized in the following four points:

  1. Bootloader boot program is executed when a hardware startup, the operating system is running on the premise;
  2. Bootloader piece of code is run before operating system kernel or user application is running;
  3. In embedded systems, initialization and loading of the entire system is generally done by the Bootloader;
  4. Corresponding hardware initialization and settings, the operating system is ready for the final environment.

Two, Bootloader features

Bootloader is not part of the operating system, generally use assembly language and C language development. Need to write for a specific hardware platform. When the porting process, the first board for the development of transplant Bootloader. Bootloader depends not only on the CPU architecture, and depending on the configuration embedded board-level device. It can be summarized as the following three points:

  1. Bootloader run is usually divided into two phases.
  2. Bootloader independent of the operating system.
  3. Bootloader depends not only on the CPU architecture and depending on the configuration embedded board-level device.

Three, Bootloader mode of execution

Self-starting mode:In this mode, Bootloader from a solid-state storage device on the target operating system is loaded into RAM to run, in this mode, Bootloader command according to pre-set to run automatically, and the whole process without user intervention . This model is the Bootloader normal operating mode , so when embedded product release, Bootloader must operate in this mode

Interactive mode:In this mode, Bootloader on the target machine, and downloading the kernel root file system image mapping RAM waiting by a network or serial communication means and the like from the development board (Host). Bootloader can be written to the solid-state mass storage medium on the target machine, or directly into the guidance system. You may also receive a user's instruction through the serial port. In this mode, Bootloader and the PC through the serial communication, the receiving user's command . Boot loader mode is typically used to use when updating the kernel and root file system to a system or solid-state storage medium after the first programming ; multi-mode download for developers during early development, the work in this mode Bootloader usually a simple command line interface for its end-users.

Fourth, the introduction of some bootloader

Here Insert Picture Description

Red Bootloaders

Redboot supported processor architecture have ARM, MIPS, MN10300, PowerPC, Renesas SHx, v850, x86, etc., it is a complete embedded system Boot Loader.

Redboot is stripped out on the basis of ECOS, ECOS inherited the simple, lightweight, flexible configuration, stable and reliable quality advantages. It can use the X-modem or Y-modem protocol via the serial download can be obtained via the Ethernet port IP parameters via BOOTP / DHCP service, use TFTP to download the image file program, commonly used in debugging support, and system initialization (Flash updates and downloads network boot). Redboot through the serial port and an Ethernet port applications are running GDB to communicate with GDB debug applications, and can even break. Redboot to manage FLASH image, image download, configuration and other Redboot such as serial ports, Ethernet port provides an interactive command-line interface, automatically after start, REDBOOT used to direct the script file from the TFTP server or download the image from Flash File System stored on Flash. The current version supports SBC transplant characteristics are:

  • Support ECOS, Linux operating system boot
  • Online reading and writing Flash
  • Serial port kermit, S-record code download
  • Monitoring (by MINITOR) commands: read and write I / O, memory, registers, memory, and other peripheral function test

Red Bootloaders related sites: http://sourceware.org/redboot/

ARM Bootloaders

Redboot company with eCos is Redhat released a BOOT scheme, it is an open source project. Support arm720, arm920, arm926, CortexA8, sa1100, xscale.

ARMboot goal is to become versatile, easy to use program guide and portable, very lightweight to be applied on the new platform. ARMboot is a project under the GPL ARM firmware only supports Flash memory, BOOTP, DHCP, TFTP network download, PCMCLA Hunt machines and other types of guidance systems. Characteristics:

  • Support multiple types of FLASH;
  • Allowing the image file via a BOOTP, DHCP, TFTP transmitted from the network;
  • Serial port or the S-record downloaded binary file;
  • Allows the display and modification of memory;
  • Jffs2 file system support

(1) U-Boot is a standard ARM bootloader
(2) armboot added to form a u-boot ppcboot

ARM Bootloaders related sites: http://armboot.sourceforge.net/

Blob

blob bootloader LART is used by the project, ported to multiple ARM platforms .

Blob also provides two modes of operation, in the normal mode when the boot loader, but it will be delayed 10 seconds while waiting for the end user to press any key to download mode switching Blob. If the user does not press a button within 10 seconds, the Blob continues to boot the Linux kernel. The basic functions:
initializing the hardware (CPU speed, memory, interrupts, RS232 serial port)

  • Boot Linux kernel and provides a ramdisk;
  • LART to download a kernel or ramdisk;
  • FLASH update the kernel to the sheet or the ramdisk;
  • Determination of storage configuration and notifies the kernel;
  • To the kernel provides a command line [5].

Blob Related Websites: http://www.lart.tudelft.nl/lartware/blob

U-boot Introduction

u-boot (Universal Boot Loader) is a German DENX team developed a bootloader program for a variety of embedded CPU. GPL terms. 8xxROM, PPCBOOT, Armboot evolved gradually developed.
Here Insert Picture Description

U-Boot Project Description

U-Boot offers two modes of operation: boot loader (Boot loading) mode and download (Downloading) mode , and has all the features of large-scale Boot Loader. The main features are:

  • SCC / FEC Ethernet support;
  • BOOTP / TFTP guide;
  • IP, MAC preset function;
  • Online reading and writing FLASH, DOC, IDE, IIC, EEROM, RTC;
  • Serial port kermit, S-record code download;
  • Identifying binary, ELF32, pImage format of Image, has a special guide for Linux support;
  • Monitoring (by MINITOR) commands: read and write I / O, memory, registers, memory, peripherals and other test functions;
  • Scripting language support (similar BASH script);
  • Support WatchDog, LCD logo, status indication function.
    Now U-Boot has been able to support PowerPC, ARM, X86, hundreds of boards MIPS architecture has become the most versatile, most flexible and most actively developed open source Bootloader. It is still maintained by Wolfgang Denk DENX of.

U-Boot source package can be downloaded from the sourceforge site, you can also subscribe to the active site of U-Boot Users mailing list, e-mail forum for the development and use of U-Boot are very helpful.

U-Boot package download site: http://sourceforge.net/project/u-boot
U-Boot mailing list website: http://lists.sourceforge.net/lists/listinfo/u-boot-users/
DENX related website: http://www.denx.de/re/DPLG.html

U-boot features

  • Clear code structure, easy to transplantation (see program structure)
  • It supports a variety of processor architectures (see program structure cpu directory)
  • Supports numerous reference board (currently more than 200 official package, see the program structure board directory) command rich, monitoring
  • Supported network protocols, USB, SD and other protocols and equipment
  • File System Support
  • Update more active, multi-user, help to solve the problem

U-Boot directory structure

  1. Associated with the platform directory structure
    board, cpu, lib_arm, include…

  2. Platform-independent directory structure
    common, net, fs, drivers…

  3. Tools and documentation
    tools, doc

The following directory structure introduced one by one:
Here Insert Picture Description
Here Insert Picture Description

U-boot command Introduction

Please pay attention later, connected. . . . .

Published 23 original articles · won praise 37 · views 4526

Guess you like

Origin blog.csdn.net/ywsydwsbn/article/details/105156057