天天看點

Uboot啟動流程(圖+代碼)

Uboot是嵌入式系統中最常用的bootloader,這裡我們以s3c2410為例分析一下uboot的啟動流程。首先通過uboot的連結檔案,我們可以看到uboot運作是執行的第一段代碼在start.S中。

ENTRY(_start)

        SECTIONS

        {

                . = 0x00000000;

        . = ALIGN(4);

                .text :

                {

                        cpu/arm920t/start.o (.text)

                        *(.text)

                }

        . = ALIGN(4);

                .rodata : { *(.rodata) }

        . = ALIGN(4);

                .data : { *(.data) }

        . = ALIGN(4);

                .got : { *(.got) }

        . = .;

                __u_boot_cmd_start = .;

                .u_boot_cmd : { *(.u_boot_cmd) }

                __u_boot_cmd_end = .;

        . = ALIGN(4);

                 __bss_start = .;

                .bss : { *(.bss) }

                _end = .;

        }

我們找到這個檔案,以這個檔案為起點看uboot的啟動流程。這裡我們通過一個圖來說明這個過程。

Uboot啟動流程(圖+代碼)

最後我們把整個uboot在執行過程中,代碼的搬移籍記憶體的使用情況通過一個圖,來說明一下。

Uboot啟動流程(圖+代碼)