[Linux transplant] ——2. Transplanting u-boot-2012.04.01 refers to analyzing the boot process

Publisher:幸福时光Latest update time:2022-04-20 Source: eefocusKeywords:Linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Transplanting u-boot-2012.04.01 refers to analyzing the boot process


a. Get the source code:


Download u-boot-2012.04.01.tar.bz2 from ftp://ftp.denx.de/pub/u-boot/ and download the cross-compilation chain arm-linux-gcc-4.3.2.tar.bz2.




b. Unzip u-boot-2012.04.01.tar.bz2 to your PC and create a Source Insight project.


Put u-boot-2012.04.01.tar.bz2 on Ubuntu and decompress it, and install arm-linux-gcc-4.3.2.tar.bz2 at the same time.




c. After building the Source Insight project, add the corresponding files to analyze the startup process of u-boot-2012.04.01:


According to the linking process, open start.S for code analysis:


1. Set the CPU to management mode set the cpu to SVC32 mode


2. Turn off the watchdog


3. Mask all IRQs by setting all bits in the INTMR


4. Set the frequency division clock ratio


5. Set up the memory control controller (CPU bottom layer initialization)


6. Set up the stack and call the C function board_init_f


7. Call each function in the function array init_sequence


7.1 board_early_init_f: Set system clock, set GPIO


... ...


8. Relocation code


8.1 Copy code from NOR FLASH to SDRAM


8.2 The link address of the program is 0. When accessing global variables, static variables, and calling functions, the "address compiled based on address 0" is used.

      Now copy the program to SDRAM

      The code needs to be modified to change the "address compiled based on address 0" to the new address


8.3 Some addresses in the program cannot be determined at link time and can only be determined before running: fixabs

9. clear_bss


10. Calling C function board_init_r: Stage 2 code


Keywords:Linux Reference address:[Linux transplant] ——2. Transplanting u-boot-2012.04.01 refers to analyzing the boot process

Previous article:[Linux porting] —— 3. Porting the modified code of u-boot-2012.04.01 (clock, SDRAM, UART)
Next article:【Linux transplant】——1. Software and hardware platform and target

Recommended ReadingLatest update time:2024-11-15 17:55

Analysis and Design of BootLoader for ARM-Linux Embedded System
0 Preface The boot loader of an embedded system is composed of the Boot Loader and the Boot code (optional) solidified in the firmware. Its role and function are like a ROM chip program BIOS (basic input output system) solidified on the motherboard of the computer. However, it is generally not configured with a firmwa
[Microcontroller]
Analysis and Design of BootLoader for ARM-Linux Embedded System
ARM Study Notes 001 arm-linux-gcc 4.3.2 Download and Installation
Download arm-linux-gcc-4.3.2.tgz (84MB) Install the cross-compilation toolchain: 1. First log in as root user 2. Copy arm-linux-gcc-4.3.2.tgz to the tmp folder in the root directory 3. Decompression command     tar xvzf arm-linux-gcc-4.3.2.tgz -C /     Note that there is a space between tgz and -C, -C is upperca
[Microcontroller]
ARM Study Notes 001 arm-linux-gcc 4.3.2 Download and Installation
Linux system learning 1-8: The first ARM bare board program and extension
Section 001: Auxiliary Line 1_Hardware Knowledge_LED Schematic Diagram Steps to light up the LED:  1. Look at the schematic diagram and determine the pins that control the LED  Use the pin output through the main chip: 3.3V lights up the LED; 0V turns off the LED.  -Connection:  Insufficient pin drive capability: Us
[Microcontroller]
Linux system learning 1-8: The first ARM bare board program and extension
OK6410A Development Board (VIII) 31 linux-5.11 OK6410A Perception of Linux Memory Management
Linux memory management, we perceive three types of memory management System Memory ManagementA Kernel thread memory management A User process memory management Kernel state A User Mode B These should be divided into two categories, AB Class A shares the same memory (virtual and physical) Class B has o
[Microcontroller]
ARM-Linux driver related header file knowledge points
#include Look for source files under linux-2.6.31/include/linux #include asm/***.h Find the source file under linux-2.6.31/arch/arm/include/asm #include mach/***.h Find the source file under linux-2.6.31/arch/arm/mach-s3c2410/include/mach #include plat/regs-adc.h Find the source file under linux-2.6.31/arch/arm/p
[Microcontroller]
How to establish a cross-compilation environment for the Linux operating system
        The application development environment based on the Linux operating system is generally composed of the target system hardware (development board) and the host PC. The target hardware development board is used to run the operating system and system application software, while the kernel compilation of the ope
[Power Management]
Memory Mapping of ARM Linux (S3C6410 Architecture/2.6.35 Kernel) (Part 2)
This article describes the mapping of kernel space during Linux system startup. During the Linux system kernel startup process,  the page table will be established in the start_kernel() - setup_arch() - paging_init() function. The following is a detailed record of each important step. (The code demonstrated below has
[Microcontroller]
[Embedded] Porting U-boot to mini2440 from scratch (Part 4) - C runtime configuration
Set up the C runtime environment and code relocate - lib/crt0.S C-runtime startup Code for ARM U-Boot After the CPU completes the most basic initialization, we can't always write code in assembly language, so we need the C runtime environment. At the same time, relocate is often mentioned separately in other places.
[Microcontroller]
[Embedded] Porting U-boot to mini2440 from scratch (Part 4) - C runtime configuration
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号