2014.4 new Uboot START process analysis

Source: Internet
Author: User
[CPP]View Plain Copy # (C) Copyright 2000-2013 # Wolfgang Denk, Denx Software, Engineering wd@denx.de. # spdx-license-identifier:gpl-2.0+ # VERSION = 2014 Patchlevel = sublevel = extraversion = NAME =

Version 2014.4 uboot boot to the command line several important functions are:_start,_main,board_init_f,relocate_code,board_init_r.

a _start

For any program, the entry function is determined at the time of the link, and the Uboot entry is determined by the link script. Uboot the ARMV7 link script default directory is arch/arm/cpu/u-boot.lds. This can be specified in the configuration file with Config_sys_ldscript.

The entry address is also determined by the connector, which can be specified by config_sys_text_base in the configuration file. This will be added to the option-ttext of the LD connector at compile time

View U-boot.lds

[CPP]  View plain copy Output_format ("Elf32-littlearm",  "Elf32-littlearm",  "Elf32-littlearm")     Output_arch (ARM)    ENTRY (_start)    sections   {        . = 0x00000000;          . = align (4);        .text :       {              * (. __image_copy_start)             CPUDIR/start.o  (. text*)             * (. text*)        }              . = align (4);       .rodata : { * (SORT_BY_ Alignment (Sort_by_name (. rodata*)))  }          . = align (4 );  &NBsp     .data : {            * (. data*)       &nbsp}      The definitions of these macros in the link script in the linkage.h, see the literal meaning also understand, the program's entrance is in _ Start., followed by the text segment, the data section, and so on.

_start in Arch/arm/cpu/armv7/start. s, a section of the analysis, as follows:

[CPP] view plain copy globl _start _start:b reset Ldr pc, _undefined_instruction ldr pc, _SOFTW  Are_interrupt Ldr pc, _prefetch_abort ldr pc, _data_abort ldr pc, _not_used ldr pc, _irq LDR  PC, _fiq #ifdef config_spl_build _undefined_instruction:. Word _undefined_instruction _software_interrupt:. Word _software_interrupt _prefetch_abort:. Word _prefetch_abort

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.