c语言程序的入口是哪部分,uboot中C语言代码入口函数(start_armboot)的注释.docx

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

uboot中C语言代码入口函数(start_armboot)的注释在介绍该函数之前,我们需要看一看几个数据结构,这些是u-boot中几个重要的数据结构:1)、gd_t该数据结构保存了u-boot需要的配置信息(我暂时称它为全局信息表),typedefstructglobal_data {bd_t *bd; //与板子相关的结构,见下面unsigned long flags;unsigned long baudrate; //波特率unsigned long have_console; /* serial_init() was called */unsigned long reloc_off; /* Relocation Offset,重定位偏移 */unsigned long env_addr; /* Address of Environment struct ,存放环境变量结构的地址*/unsigned long env_valid; /* Checksum of Environment valid? */#ifdef CONFIG_VFD //我们一般没有配置这个,这个是frame buffer的首地址unsigned long fb_base; /* base address of frame buffer,显存缓存区基址*/#endif#if 0unsigned long cpu_clk; /* CPU clock in Hz! CPU的时钟频率*/unsigned long bus_clk; //总线的时钟频率unsigned long ram_size; /* RAM size, RAM的大小*/unsigned long reset_status; /* reset status register at boot */#endifvoid **jt; /* jump table ,保存着些函数的入口地址,在common/Exports.c中进行填充*/} gd_t;2)、bd_t保存与板子相关的配置参数typedefstructbd_info {intbi_baudrate; /* serial console baudrate ,串口波特率 */unsigned long bi_ip_addr; /* IP Address ,IP地址*/unsigned char bi_enetaddr[6]; /* Ethernet adress ,以太网地址*/structenvironment_s *bi_env; //环境变量地址指针ulongbi_arch_number; /* unique id for this board 架构号码*/ulongbi_boot_params; /* where this board expects params */struct /* RAM configuration */{ ulong start; //RAM的起始地址ulong size; //RAM的大小} bi_dram[CONFIG_NR_DRAM_BANKS];} bd_t;3). 初始化函数列表(以数组的形式)init_fnc_t *init_sequence[] = {cpu_init, /* basic cpu dependent setup || cpu/arm920t/cpu.c ,cpu的初始化,有待于分析*///这个是对板子的初始化,board_init, /* basic board dependent setup|| board/smdk2440/smdk2440.c */interrupt_init, /* set up exceptions || cpu/arm920t,s3c24x0/interrupts.c */env_init, /* initialize environment */init_baudrate, /* initialzebaudrate settings */serial_init, /* serial communications setup || cpu/arm920t/s3c24x0/serial.c *///串口初始化后我们就可以打印信息了console_init_f, /* stage 1 init of console */display_banner, /* say that we are here */#if defined(CONFIG_DISPLAY_CPUINFO)print_cpuinfo, /* display cpu info (and speed) */#endif#if defined(CONFIG_DISPLAY_BOARDINFO)c

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值