您的位置:首页 > 其它

u-boot,初试牛刀

2015-06-03 16:59 218 查看
手里拿到的uboot是uboot-2012,整个目录和之前的1.3.4没什么太大变化。但是系统启动初始化的流程,以及一些接口函数的定义变化了许多。以及初始化make的流程也变化,另外在nand的ecc校验算法增加了bch校验。

第一步,编译

linux下的编译,基本都是借用了Makefile和脚本以及链接文件协同合作,最后搞出来一个bin。

编译uboot也无外乎这样。只是稍微有些不同。

啥也不懂,啥也不知道怎么办?

那么make help 下吧,不识路,先问路。

#make help
Cleaning targets:
clean - Remove most generated files but keep the config and
necessities for testing u-boot //除config配置文件,.o什么的统统删除
clobber - Remove most generated files but keep the config//同上,差不多
mrproper - Remove all generated files + config + various backup files//更进一步
distclean - mrproper + remove editor backup and patch files//更进一步,包括补丁

Other generic targets:
all - Build all necessary images depending on configuration//大白话,都统一来一遍
u-boot - Build the bare u-boot//编译个裸u-boot
dir/ - Build all files in dir and below//把dir目录下的文件统统来一遍
dir/file.[oisS] - Build specified target only
dir/file.lst - Build specified mixed source/assembly target only
(requires a recent binutils and recent build (System.map))
tags/TAGS - Generate tags file for editors
cscope - Generate cscope index
ubootrelease - Output the release version string
ubootversion - Output the version stored in Makefile

Static analysers
checkstack - Generate a list of stack hogs //编译后,从裸uboot里,dump出一些栈大小信息

Documentation targets:
U-Boot bootloader internal documentation in different formats:
htmldocs - HTML
pdfdocs - PDF
psdocs - Postscript
xmldocs - XML DocBook
mandocs - man pages
installmandocs - install man pages generated by mandocs
cleandocs - clean all generated DocBook files

make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
make V=2 [targets] 2 => give reason for rebuild of target
make O=dir [targets] Locate all output files in "dir", including .config
make C=1 [targets] Check all c source with $CHECK (sparse by default)
make C=2 [targets] Force check of all c source with $CHECK
make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections
make W=n [targets] Enable extra gcc checks, n=1,2,3 where
1: warnings which may be relevant and do not occur too often
2: warnings which occur quite often but may still be relevant
3: more obscure warnings, can most likely be ignored
Multiple levels can be combined with W=12 or W=123

Execute "make" or "make all" to build all targets marked with [*]
For further info see the ./README file
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  u-boot