`
izuoyan
  • 浏览: 9129455 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

ARM Linux Boot Sequence

阅读更多

ARM Linux Boot Sequence
The following traces the Linux boot sequence for ARM-based systems in the 2.6.18 kernel. It looks at just the earliest stages of the boot process, until the generic non-processor-specific start_kernel function is called. The line numbers of each statement are in parenthese at the end of the line; the kernel source itself can be conveniently browsed on the Linux Cross-Reference website.
zImage decompression
  • arch/arm/boot/compressed/head.S: start (108)
    • First code executed, jumped to by the bootloader, at label "start" (108)
    • save contents of registers r1 and r2 in r7 and r8 to save off architecture ID and atags pointer passed in by bootloader (118)
    • execute arch-specific code(inserted at 146)
      • arch/arm/boot/compressed/head-xscale.S or other arch-specific code file
      • added to build in arch/arm/boot/compressed/Makefile
      • linked into head.S by linker section declaration: .section “start”
      • flush cache, turn off cache and MMU
    • load registers with stored parameters (152)
      • sp = stack pointer for decompression code (152)
      • r4 = zreladdr = kernel entry point physical address
    • check if running at link address, and fix up global offset table if not (196)
    • zero decompression bss (205)
    • call cache_on to turn on cache (218)
      • defined at arch/arm/boot/compressed/head.S (320)
      • call call_cache_fn to turn on cache as appropriate for processor variant
        • defined at arch/arm/boot/compressed/head.S (505)
        • walk through proc_types list (530) until find corresponding processor
        • call cache-on function in list item corresponding to processor (511)
          • for ARMv5tej core, cache_on function is __armv4_mmu_cache_on (417)
            • call setup_mmu to set up initial page tables since MMU must be on for cache to be on (419)
            • turn on cache and MMU (426)
    • check to make sure won't overwrite image during decompression; assume not for this trace (232)
    • call decompress_kernel to decompress kernel to RAM (277)
    • branch to call_kernel (278)
      • call cache_clean_flush to flush cache contents to RAM (484)
      • call cache_off to turn cache off as expected by kernel initialization routines (485)
      • jump to start of kernel in RAM (489)
        • jump to address in r4 = zreladdr from previous load
          • zreladdr = ZRELADDR = zreladdr-y
          • zreladdr-y specified in arch/arm/mach-vx115/Makefile.boot
ARM-specific kernel code
  • arch/arm/kernel/head.S: stext (72)
    • call __lookup_processor_type (76)
      • defined in arch/arm/kernel/head-common.S (146)
      • search list of supported processor types __proc_info_begin (176)
        • kernel may be built to support more than one processor type
        • list of proc_info_list structs
          • defined in arch/arm/mm/proc-arm926.S (467) and other corresponding proc-*.S files
          • linked into list by section declaration: .section ".proc.info.init"
      • return pointer to proc_info_list struct corresponding to processor if found, or loop in error if not
    • call __lookup_machine_type (79)
      • defined in arch/arm/kernel/head-common.S (194)
      • search list of supported machines (boards)
        • kernel may be built to support more than one board
        • list of machine_desc structs
          • machine_desc struct for boards defined in board-specific file vx115_vep.c
          • linked into list by section declaration that's part of MACHINE_DESC macro
      • return pointer to machine_desc struct corresponding to machine (board)
    • call __create_page_tables to set up initial MMU tables (82)
    • set lr to __enable_mmu, r13 to address of __switch_data (91, 93)
      • lr and r13 used for jumps after the following calls
      • __switch_data defined in arch/arm/kernel/head-common.S (15)
    • call the __cpu_flush function pointer in the previously returned proc_info_list struct (94)
      • offset is #PROCINFO_INITFUNC into struct
      • this function is __arm926_setup for the ARM 926EJ-S, defined in arch/arm/mm/proc-arm926.S (392)
        • initialize caches, writebuffer
        • jump to lr, previously set to address of __enable_mmu
    • __enable_mmu (147)
      • set page table pointer (TTB) in MMU hardware so it knows where to start page-table walks (167)
      • enable MMU so running with virtual addresses (185)
      • jump to r13, previously set to address of __switch_data, whose first field is address of __mmap_switched
        • __switch_data defined in arch/arm/kernel/head-common.S (15)
  • arch/arm/kernel/head-common.S: __mmap_switched (35)
    • copy data segment to RAM (39)
    • zero BSS (45)
    • branch to start_kernel (55)
Processor-independent kernel code
  • init/main.c: start_kernel (456)
分享到:
评论

相关推荐

    BRCM_21553_TBird5x_BootSequence-AE.pdf

    根据给定文件"BRCM_21553_TBird5x_BootSequence-AE.pdf"的标题、描述、标签及部分内容,以下是对Broadcom Thunderbird EDN5x(BCM21553)开机启动顺序及其相关知识点的详细解析。 ### 开机启动流程概述 Broadcom ...

    U-boot的BL2阶段start_armboot解析

    `start_armboot` 函数会遍历一个函数指针数组 `init_sequence` 中的所有初始化函数。这些函数负责不同的初始化任务,如 CPU 设置、中断处理等。 3. **堆管理器初始化** 通过调用 `mem_malloc_init` 函数初始化 U...

    ARM u-boot 初始化流程1

    9. **执行`start_armboot`**:PC指针被设置为"C"代码中的`start_armboot`函数地址,这是u-boot初始化流程的关键部分。 10. **初始化序列**:`init_sequence`函数执行一系列初始化任务,包括: - `cpu_init`:配置...

    1.Initial-Boot-Sequence.pdf

    "1.Initial-Boot-Sequence.pdf"是一个关于Linux操作系统和虚拟化的详细文档,它涵盖了从按下电源按钮到系统运行的整个流程。这个过程可以分为以下几个关键阶段: 1. **硬件预启动**:当按下电源按钮时,CPU不能立即...

    uboot中C语言代码入口函数(start_armboot)的注释.docx

    在U-Boot(通用引导加载程序)中,`start_armboot`函数是C语言代码的入口点,负责启动过程中的核心任务。理解`start_armboot`的运作方式,需要先了解一些关键的数据结构,如`gd_t`和`bd_t`,以及初始化函数列表。 1...

    系统引导程序(Boot-loader)的设计与实现.docx

    2. Boot-loader 在 ARM 嵌入式系统中的作用: Boot-loader 在 ARM 嵌入式系统中负责加载 Linux 内核,将其从存储设备加载到内存中,并初始化系统的硬件。 3. Boot-loader 的实现: Boot-loader 在 ARM 嵌入式系统中...

    booting sequence in linux

    booting sequence in linux, in terms of memory management

    BIOS设置U盘启动的三种类型.doc

    在"Startup"菜单下,有三个启动顺序选项:Primary Boot Sequence、Error Boot Sequence 和 Automatic Boot Sequence。重点在于Primary Boot Sequence,这是默认的启动顺序。用户应选择"1st Boot Device",然后使用...

    U-Boot_startup_sequence.pdf

    1. U-Boot启动序列状态(Status quo):U-Boot的启动序列包含几个主要步骤,无论是对于ARM处理器还是SPL(Secondary Program Loader)模式。首先,启动CPU并设置堆栈,然后初始化内存管理。接着,U-Boot在内存准备好...

    sequence-diagram.zip

    《序列图绘制工具sequence-diagram-js的深度解析与应用》 序列图,作为一种重要的系统建模工具,广泛应用于软件设计和开发中,它清晰地展示了系统内各对象间交互的顺序。sequence-diagram-js是一个基于JavaScript的...

    NumberSequence

    在IT行业中,"Number Sequence"通常指的是在特定系统或应用中用于生成自动递增或递减的数字序列。这些序列可以用于唯一标识记录、订单号、发票号等,确保数据的唯一性和可追踪性。在Microsoft Dynamics AX(现称为...

    sequence等同于序列号

    ### Oracle数据库中的Sequence机制详解 #### 一、概述 在Oracle数据库中,`sequence`机制是一种自动生成唯一数值序列的方法,常用于为主键字段提供连续的整数值。它类似于其他数据库系统中的自动增长字段,但在...

    Oracle sequence 重置(失效恢复)

    ### Oracle Sequence 重置(失效恢复) 在进行Oracle数据库移植或维护时,可能会遇到Sequence失效的问题。这种情况通常发生在数据迁移后,原有的Sequence不再与表中的最大值相匹配,导致新记录插入时出现ID冲突或者...

    Linux引导过程及其服务linux操作系统linux教程pdf

    Boot Sequence Overview 1. BIOS 电脑打开电源时就会进入BIOS,主要监测CPU,Memory,风扇等 2.MBR Boot loader 在磁盘的第1个磁区共512bytes,其中前446bytes用于选择启动的 bootPartition 载入开机的程式码 3. Kernel ...

    Activiti 学习笔记七:连线(SequenceFlow)

    在Activiti中,连线(SequenceFlow)是流程图中的重要元素,用于定义活动之间的转移路径。本篇学习笔记将深入探讨SequenceFlow的概念、作用以及如何在流程设计中使用。 一、SequenceFlow简介 SequenceFlow 是 ...

    u-boot-1.1.4代码阅读

    6. **跳转至第二阶段**:最后一步是从汇编语言切换到 C 语言环境,通过调用 `start_armboot()` 函数来启动 U-Boot 的第二阶段。 #### 第二阶段(Stage 2) 第二阶段主要由 C 语言实现,这使得代码更具可读性和可...

    U-Boot启动过程

    - **跳转到`start_armboot`**:最后,跳转到`start_armboot`函数,该函数是U-Boot执行的第一个C语言函数。 ##### 第二阶段:系统初始化与主循环 此阶段主要包括系统的进一步初始化及进入主循环处理用户输入的命令。...

    SequenceDiagram-3.0.5.zip

    SequenceDiagram-3.0.5.zip 是一个包含 Sequence Diagram 相关工具或资源的压缩包文件,主要用于绘制序列图,这是UML(统一建模语言)中的一种图表,用于描述对象之间的交互和消息传递顺序。在软件开发过程中,序列...

Global site tag (gtag.js) - Google Analytics