【OK210试用体验】u-boot篇 -- u-boot初体验 - 在线问答 - 电子技术论坛 - 最好最受欢迎电子论坛!

【OK210试用体验】u-boot篇 -- u-boot初体验

【OK210试用体验】u-boot篇 -- u-boot初体验


      u-boot,全称 Universal Boot Loader,是遵循GPL条款的开放源码项目。U-boot 的主要作用是进行内存的初始化、CPU的初始化、串口初始化等一系列的初始化工作,完成这些之后,再将操作系统加载到内存中,从而运行起来。u-boot支持多种CPU架构(ARM,x86,MIPS,PowerPC...),支持多种启动形式,还有一些其他的强大功能,是ARM嵌入式系统bootloader的首选。

    u-boot是开源项目,所以可以在官网下下载,地址:ftp://ftp.denx.de/pub/u-boot/。

   

u-boot文件夹结构


    u-boot的源码文件夹数量太多,但是分类明确,在2008年8月的版本前后的文件夹排放也有区别,2008年8月及以前版号形式为:u-boot-1.3.4.tar.bz2(2008年8月更新)2008年8月以后均按日期命名。

    u-boot目录结构主要经历过2次变化,u-boot版本第一次从u-boot-1.3.2开始发生变化,主要增加了api的内容;变化最大的是第二次,从2010.6版本开始。

    u-boot-2010.03及以前版本:
api 存放u-boot提供的接口函数
board 根据不同开发板定制的代码
common 通用函数
cpu 对应不同的CPU,比如arm920t、arm925t、i386等
disk 硬盘接口程序
doc 说明文档
drivers 各类具体设备驱动程序,基本可以通用
example 示例程序
fs 文件系统
include 头文件和开发板配置文件
lib_arch 与体系结构相关的通用库文件
nand_spl
NAND存储器的相关代码
net 各种网络协议
onenand_ipl
post 上电自检程序
tools 辅助工具


      u-boot-2010.06及以后版本:
api 存放u-boot提供的接口函数
board 根据不同开发板定制的代码
common 通用函数
arch 与体系结构相关的代码,uboot的重头戏
disk 硬盘接口程序
doc 说明文档
drivers 各类具体设备驱动程序,基本可以通用
example 示例程序
fs 文件系统
include 头文件和开发板配置文件
lib通用库文件
nand_spl
NAND存储器的相关代码
net 各种网络协议
onenand_ipl
post 上电自检程序
tools 辅助工具


入门u-boot


      对于刚刚接触u-boot,甚至是刚刚接触bootloader的同学,应该先看一下u-boot根文件夹下的 README,然后用Makefile来逐步分析代码,中间也需要mkconfig。



      README的起步有用信息:

                   Software Configuration:

=======================


Configuration is usually done using C preprocessor defines; the
rationale behind that is to avoid dead code whenever possible.


There are two classes of configuration variables:


* Configuration _OPTIONS_:
  These are selectable by the user and have names beginning with
  "CONFIG_".


* Configuration _SETTINGS_:
  These depend on the hardware etc. and should not be meddled with if
  you don't know what you're doing; they have names beginning with
  "CONFIG_SYS_".


Later we will add a configuration tool - probably similar to or even
identical to what's used for the Linux kernel. Right now, we have to
do the configuration by hand, which means creating some symbolic
links and editing some configuration files. We use the TQM8xxL boards
as an example here.




Selection of Processor Architecture and Board Type:
---------------------------------------------------


For all supported boards there are ready-to-use default
configurations available; just type "make _config".


Example: For a TQM823L module type:


        cd u-boot
        make TQM823L_config


For the Cogent platform, you need to specify the CPU type as well;
e.g. "make cogent_mpc8xx_config". And also configure the cogent
directory according to the instructions in cogent/README.

0个回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则


关闭

站长推荐上一条 /6 下一条

小黑屋|手机版|Archiver|电子发烧友 ( 湘ICP备2023018690号 )

GMT+8, 2024-4-19 07:33 , Processed in 0.437930 second(s), Total 64, Slave 45 queries .

Powered by 电子发烧友网

© 2015 bbs.elecfans.com

微信扫描
快速回复 返回顶部 返回列表