"Finishing" BIOS, BootLoader, uboot contrast __ios

Source: Internet
Author: User
Tags prepare

BIOS

The BIOS is the English "basic Input Output system" abbreviation, after literal translation after the Chinese name is "the basic input to export systems". In fact, it is a group of curing to the computer motherboard on the previous ROM chip program, it holds the computer's most important basic input and output of the program, system settings information, post-boot self-test program and system from the start program. Its main function is to provide the lowest, most direct hardware setup and control for the computer.


BootLoader

Bootloader is a small program that can be imagined as a PC Linux on the Grub/lilo boot program, but in embedded Linux, there is no bios, but directly from the flash to run, to load the kernel. It can initialize hardware devices to bring the system's hardware and software environment to a suitable state to prepare for the eventual invocation of the operating system.


An embedded system is divided into three levels from the software point of view:
1. Boot loader
Including curing in the curing of the boot program (optional), and bootloader two parts
2.linux kernel
Embedded platform-specific custom kernels
3. File system
Includes system commands and applications
--------------------------------------------------------------------------------
Bootloader-->boot parameters-->kernel-->root FileSystem
--------------------------------------------------------------------------------
Why you need a bootloader transplant.
Answer: 1. Because each different CPU architecture has different bootloader
2.BootLoader relies on the configuration of embedded board-level devices
--------------------------------------------------------------------------------
The bootloader boot process can be divided into single phase and multi-stage (Stage1, Stage2), where STAGE1 completes initialization hardware, such as CPU registers, memory controllers, and prepares memory space for Stage2. The general Stage1 can be run directly in nor flash, and the stage2 is copied into RAM, the stack is set, and then jumps to Stage2 (from this you can see that Stage2 is running in RAM, unlike Stage1)

The bootloader Stage1 typically includes the following steps:
1. Hardware device initialization such as CPU registers, memory controller
2. Prepare RAM space for the Stage2 loaded bootloader
3. Copy bootloader stage2 to ram space
4. Set a good stack why. In order to jump to the entrance of the Stage2, because Stage2 mostly written in C language
5. Jump to the C entry point of Stage2

The bootloader Stage2 typically includes the following steps:
1. Initialization of the hardware devices to be used at this stage, such as network adapters
2. Read the kernel image and root file system image from Flash to ram
3. Call the kernel
--------------------------------------------------------------------------------


Uboot


Uboot bootloader Program for multiple embedded CPUs
Support multiple embedded operating system guidance
UBOOT directory Structure
1.Borad files related to the Development Board. The first development Board appears in the current directory as a subdirectory
2.Common command to implement Uboot support
3.CPU code related to a specific CPU architecture, supported CPU corresponding to a subdirectory (note the difference between the CPU and the Development Board)
3.Disk Support for disk
4.Doc Document Directory
5.Drivers Uboot supported device drivers such as a variety of network adapters, serial products, USB, support for CFI Flash
6.Fs File System Support
7.Iclude uboot the header file used. The Configs directory has a configuration header associated with the Development Board. The ASM directory in this directory has header files related to CPU architecture
Implementation of 8.NET code-related protocols for network protocols
9.Tools generation of uboot tools, such as: MKIMAGE,CRC, etc.

Uboot compilation is divided into two steps
1. Perform each type of board related configuration such as: Make amdk_2420
2. Compile and generate Uboot.bin files such as: Make cross_compile=arm-linux-(Specify the correct path)
--------------------------------------------------------------------------------

Uboot provides rich command set operations based on a single board
Uboot command
PRINTENV View environment variables (fairly global variables.) )
setenv Add, modify, and delete environment variables
1.setenv Name Value
Set environment variable ' name ' to ' Value ... '
2.setenv Name
Delete environment variable ' name '
SAVEENV Save Environment variables
Save all currently defined variables and their values in flash
--------------------------------------------------------------------------------
---------------------File Download------------------------------------
TFTP configure the network before downloading the file using the network
Configuration network: 1.setenv ethaddr 12:34:56:78:8A:BC
2.setenv ipaddr 192.168.1.1
3.setenv ServerIP 192.168.1.254 (address of the TFTP server)
Connection download: TFTP 32000000 uimage
Read the uimage in the server (ip= environment variable ServerIP) service directory through TFTP to 0x32000000

MD Displays the contents of the memory area
Md[.b,.w,.l]address such as: MD.W 1000000

Mm[.b,.w,.l]address such as: MM.W 100000
MM modified memory, address automatic increment provides an interactive way to modify the contents of the memory, if you do not enter any value, press the return content remains unchanged, enter a space and then press ENTER, end the input

Flinfo View Flash Sector information
--------------------------------------------------------------------------------
Protect flash write protection turn sector write protection on or off
Usage:
Protect off the write protection of all sectors
Protect on all opens write protection for all sectors
Protect off the write protection from start to end sector-----"protect off 0 1ffff (previous sector minus 1?)
Protect on start to open write protection from start to end sector

--------------------------------------------------------------------------------

Erase Erase Flash Sector
Usage: Erase start end such as: Erase 30000 1EFFF
You must use the erase command to erase Flash before using the CP command to write data to nor flash

CP Data Copy
CP [. b,.w,.l]saddress daddress Len
CP provides a way to copy data between memory and memory, memory and Flash
such as: cp.b 31000000 50000 d0000 that is the memory address 0x31000000 data (length is 0xd0000) copy to the address 0x50000 (Flash)

--------------------------------------------------------------------------------
Execution procedure
Go executes the binary code in memory, a simple jump to the specified address
Go Addr[arg ...]
Start application at address ' addr ',
Passing ' arg ' as arguments

BOOTM execute in-memory binary code
BOOTM [Addr[arg ...]] Requires a file header with a fixed format for the binary code
Boot application image stored in memory passing arguments ' arg ... ';
When booting a Linux kernel, ' arg ' Can is the address of a INITRD image
Bdinfo Display Development Board information (can be used to start the Linux kernel)
The Bdinfo command displays information such as memory address and size, clock frequency, MAC address, etc. at the terminal.
This information may be used when passing some parameters to the Liunx kernel

Set Auto Start
setenv bootcmd tftp 31000000 uimage \;bootm 31000000
Saveenv

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.