loader.bin, boot.bin, u-boot.bin代码执行流分析
来源:互联网 发布:淘宝国际转运好用吗 编辑:程序博客网 时间:2024/05/16 07:45
.loader.bin, boot.bin, u-boot.bin代码执行流分析.
以上三个文件时at91rm9200启动所需要的三个bin,他们的实现代码并不难。
如果是你是采用at91rm9200的评估版,应该能得到其源码。
2.1 loader.bin 执行流程,这个文件主要在片内启动从串口下载代码时会用到
loader/entry.S init cpu
b main ---> crt0.S
--> copydata --> clearbss --> b boot
main.c --> boot -->
/*Get internel rom service address*/
/* Init of ROM services structure */
pAT91 = AT91C_ROM_BOOT_ADDRESS;
/* Xmodem Initialization */
--> pAT91->OpenSBuffer
--> pAT91->OpenSvcXmodem
/* System Timer initialization */
---> AT91F_AIC_ConfigureIt
/* Enable ST interrupt */
AT91F_AIC_EnableIt
AT91F_DBGU_Printk("XMODEM: Download U-BOOT ");
Jump.S
// Jump to Uboot BaseAddr exec
Jump((unsigned int)AT91C_UBOOT_BASE_ADDRESS)
2.2 boot.bin执行流程 该文件会在从片内启动时被下载到板子上,以后还会被烧写到片外Flash中,以便在片外启动时
用它来引导并解压u-boot.gz,并跳转到u-boot来执行。
boot/entry.S
b main --> crt0.S --> copydata --> clearbss --> b boot
T91F_DBGU_Printk(" ");
AT91F_DBGU_Printk("************************************** ");
AT91F_DBGU_Printk("** Welcome to at91rm9200 ** ");
AT91F_DBGU_Printk("************************************** ");
boot/misc.s /* unzip uboot.bin.gz */
----> decompress_image(SRC,DST,LEN) --> gunzip
//jump to ubootBaseAddr exec 这里跳转到解压u-boot.gz的地址处直接开始执行u-boot
asm("mov pc,%0" : : "r" (DST));
2.3 uboot.bin执行流程
u-boot/cpu/at91rm9200/start.S
start --->reset
---> copyex ---> cpu_init_crit
---> /* set up the stack */ --> start_armboot
u-boot/lib_arm/board.c
init_fnc_t *init_sequence[] = {
cpu_init, /* basic cpu dependent setup */
board_init, /* basic board dependent setup */
interrupt_init, /* set up exceptions */
env_init, /* initialize environment */
init_baudrate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
console_init_f, /* stage 1 init of console */
display_banner, /* say that we are here */
dram_init, /* configure available RAM banks */
display_dram_config,
checkboard,
NULL,
};
---> start_armboot ---> call init_sequence
---> flash_init --> display_flash_config
---> nand_init ---> AT91F_DataflashInit
---> dataflash_print_info --> env_relocate
---> drv_vfd_init --> devices_init --> jumptable_init
---> console_init_r --> misc_init_r --> enable_interrupts
---> cs8900_get_enetaddr --> board_post_init -->
u-boot/common/main.c
for (;;)
{ /* shell parser */
main_loop () --> u_boot_hush_start --> readline
--> abortboot
-->printf("Hit any key to stop autoboot: %2d ", bootdelay);
}
以上是at91rm9200启动并进入u-boot的执行流分析。后面u-boot还会将uImage解压到特定的位置并开始执行内核代码。
http://blog.csdn.net/linda_si/archive/2008/09/26/2984069.aspx
- loader.bin, boot.bin, u-boot.bin代码执行流分析
- loader.bin, boot.bin, u-boot.bin代码执行流分析
- loader.bin, boot.bin, u-boot.bin代码执行流分析
- loader.bin, boot.bin, u-boot.bin代码执行流分析
- 制作u-boot.bin
- 海思u-boot.bin
- u-boot.bin
- android u-boot.bin具体分析
- boot.bin
- u-boot-2016.11移植u-boot.bin
- 反汇编u-boot.bin
- u-boot 之u-boot.img uboot.bin uboot_crc.bin 及 uboot_crc.bin.crc
- 四、烧写u-boot.bin
- 2416烧写u-boot.bin
- u-boot.bin的生成问题
- 生成u-boot.bin 的错误
- 系统启动后更新u-boot.bin zImage
- u-boot-2016.11移植uboot-spl.bin
- 通过 Tomcat Advanced I/O 获得高性能的 Ajax
- XForms 表单预加载数据的几种方法
- DXUTSnapD3D9Screenshot
- OpenSolaris系列文章之----投影仪设置
- Symbian 函数或类与头文件和LIB库对照表
- loader.bin, boot.bin, u-boot.bin代码执行流分析
- 关于java lock的浅论
- SQL SERVER字符集的研究
- Error starting static Resources 错误的解决
- 无法使用基于 Servlet 2.4 且包含空 元素的 web.xml 部署 WAR (6172006)
- WPF里的DependencyProperty(4)
- delphi组件开发2
- IIOP
- 安装VS2005 SP1补丁攻略