Uboot学习笔记①---(文件目录结构、README摘要、uImage的64字节头信息)
uboot下载地址ftp://ftp.denx.de/pub/u-boot/
1、查看uboot文件目录结构
Directory Hierarchy:
====================/arch Architecture specific files/arm Files generic to ARM architecture/cpu CPU specific files/arm720t Files specific to ARM 720 CPUs/arm920t Files specific to ARM 920 CPUs/at91 Files specific to Atmel AT91RM9200 CPU/imx Files specific to Freescale MC9328 i.MX CPUs/s3c24x0 Files specific to Samsung S3C24X0 CPUs/lib Architecture specific library files/x86 Files generic to x86 architecture/cpu CPU specific files/lib Architecture specific library files/mips Files generic to MIPS architecture/cpu CPU specific files/mips32 Files specific to MIPS32 CPUs/xburst Files specific to Ingenic XBurst CPUs/lib Architecture specific library files/powerpc Files generic to PowerPC architecture/cpu CPU specific files/74xx_7xx Files specific to Freescale MPC74xx and 7xx CPUs/mpc5xx Files specific to Freescale MPC5xx CPUs/mpc5xxx Files specific to Freescale MPC5xxx CPUs/lib Architecture specific library files
/api Machine/arch independent API for external apps
/board Board dependent files
/common Misc architecture independent functions
/disk Code for disk drive partition handling
/doc Documentation (don't expect too much)
/drivers Commonly used device drivers
/dts Contains Makefile for building internal U-Boot fdt.
/examples Example code for standalone applications, etc.
/fs Filesystem code (cramfs, ext2, jffs2, etc.)
/include Header Files
/lib Files generic to all architectures/libfdt Library files to support flattened device trees/lzma Library files to support LZMA decompression/lzo Library files to support LZO decompression
/net Networking code
/post Power On Self Test
/rtc Real Time Clock drivers
/tools Tools to build S-Record or U-Boot images, etc.
uboot层次结构和调用关系
2、查看解压目录中的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:
# README文件中说明了很多“CONFIG_”和“CONFIG_SYS_”的作用,在看makefile时不懂的话可以查询一下
* 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_".
编译uboot
Selection of Processor Architecture and Board Type:
--------------------------------------------------
For all supported boards there are ready-to-use default
configurations available; just type "make <board_name>_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.
make NAME_config
where "NAME_config" is the name of one of the existing configu-
rations; see boards.cfg for supported names.(NAME_config在uboot根目录中)
Finally, type "make all", and you should get some working U-Boot
images ready for download to / installation on your system:
- "u-boot.bin" is a raw binary image
- "u-boot" is an image in ELF binary format
- "u-boot.srec" is in Motorola S-Record format
#使用命令改变make编译输出uboot.bin的目录 etc.
By default the build is performed locally and the objects are saved
in the source directory. One of the two methods can be used to change
this behavior and build U-Boot to some external directory:
1. Add O= to the make command line invocations:
make O=/tmp/build distclean
make O=/tmp/build NAME_config
make O=/tmp/build all
2. Set environment variable BUILD_DIR to point to the desired location:
export BUILD_DIR=/tmp/build
make distclean
make NAME_config
make all
Note that the command line "O=" setting overrides the BUILD_DIR environment
variable.
#以下这段话还不知道什么时候用的上,先记录一下
Please be aware that the Makefiles assume you are using GNU make, so
for instance on NetBSD you might need to use "gmake" instead of
native "make".
#uboot命令汇总
Monitor Commands - Overview:
============================
go - start application at address 'addr'
run - run commands in an environment variable
bootm - boot application image from memory
bootp - boot image via network using BootP/TFTP protocol
bootz - boot zImage from memory
tftpboot- boot image via network using TFTP protocoland env variables "ipaddr" and "serverip"(and eventually "gatewayip")
tftpput - upload a file via network using TFTP protocol
rarpboot- boot image via network using RARP/TFTP protocol
diskboot- boot from IDE devicebootd - boot default, i.e., run 'bootcmd'
loads - load S-Record file over serial line
loadb - load binary file over serial line (kermit mode)
md - memory display
mm - memory modify (auto-incrementing)
nm - memory modify (constant address)
mw - memory write (fill)
cp - memory copy
cmp - memory compare
crc32 - checksum calculation
i2c - I2C sub-system
sspi - SPI utility commands
base - print or set address offset
printenv- print environment variables
setenv - set environment variables
saveenv - save environment variables to persistent storage
protect - enable or disable FLASH write protection
erase - erase FLASH memory
flinfo - print FLASH memory information
bdinfo - print Board Info structure
iminfo - print header information for application image
coninfo - print console devices and informations
ide - IDE sub-system
loop - infinite loop on address range
loopw - infinite write loop on address range
mtest - simple RAM test
icache - enable or disable instruction cache
dcache - enable or disable data cache
reset - Perform RESET of the CPU
echo - echo args to console
version - print monitor version
help - print online help
? - alias for 'help'
3、uImage的64字节头信息
Image uImage与zImage的区别
这里就解释了uImage比zImage多的64字节是哪些
在include/image.h中的源码为
#define IH_NMLEN 32 /* Image Name Length *//** Legacy format image header,* all data in network byte order (aka natural aka bigendian).*/
typedef struct image_header {uint32_t ih_magic; /* Image Header Magic Number */uint32_t ih_hcrc; /* Image Header CRC Checksum */uint32_t ih_time; /* Image Creation Timestamp */uint32_t ih_size; /* Image Data Size */uint32_t ih_load; /* Data Load Address */uint32_t ih_ep; /* Entry Point Address */uint32_t ih_dcrc; /* Image Data CRC Checksum */uint8_t ih_os; /* Operating System */uint8_t ih_arch; /* CPU architecture */uint8_t ih_type; /* Image Type */uint8_t ih_comp; /* Compression Type */uint8_t ih_name[IH_NMLEN]; /* Image Name */
} image_header_t;
<span style="color:#CC0000;">
</span>
#寄存器使用情况
On ARM, the following registers are used:
R0: function argument word/integer result
R1-R3: function argument word
R9: GOT pointer
R10: stack limit (used only if stack checking if enabled)
R11: argument (frame) pointer
R12: temporary workspace
R13: stack pointer
R14: link register
R15: program counter
==> U-Boot will use R8 to hold a pointer to the global data
Uboot学习笔记①---(文件目录结构、README摘要、uImage的64字节头信息)相关推荐
- c语言学习笔记【结构体02】结构体指针变量与结构体变量的函数参数,C语言学习笔记结构体02结构体指针变量与结构体变量的函数参数.docx...
C 语言学习笔记[结构体02]结构体指针变量与结构体变量 的函数参数 C 语言学习笔记之结构体指针变量一提指针,那可 是 C 语言的核心了,有多少学子曾拜倒在指针的脚下.单纯的说指针,其实并不难,但是 ...
- c语言如何宏定义枚举型结构体,C语言学习笔记--枚举结构体
枚举 枚举是一种用户定义的数据类型,它用关键字enum以如下语法格式来声明: enum 枚举类型名字 {名字0,名字1,...,名字n}: 枚举类型名字通常并不真的使用,要用的是大括号里面的名字,因为 ...
- Ubuntu学习笔记:使用命令查看当前登录系统的用户信息
Ubuntu学习笔记:使用命令查看当前登录系统的用户信息 1 查看当前登录的用户名 2 查看当前登录的用户名.终端类型.时间.IP地址 3 服务器连接的所有用户及正在使用的进程 4 显示系统中有哪些使 ...
- 二、LaTeX学习笔记——基本结构、设置表格、文字变形及符号、插入图片
LaTeX学习笔记 写在最前面:LaTeX的注释符 界面字体放大 一.环境搭建与RUN 二.基本结构 三.设置表格 四.文字变形及符号 五.插入图片 附录.一些小tip LaTeX是一个可以用于文字编 ...
- 算法竞赛入门(2)学习笔记——循环结构程序设计
C语言学习 一:for循环 二:while循环和do-while循环 三:循环的代价 四:算法竞赛中的输入输出框架 五:习题 5.1 水仙花数 5.2 韩信点兵 5.3 倒三角形 5.4 子序列的和 ...
- ElasticSearch学习笔记(二)—结构了解和索引文档增删改
前面学习了ElasticSearch的概况以及一些配套插件的安装.这篇旨在记录对ES结构的了解和一些基本的操作. ElasticSearch结构: 对于ES来说,有几个专有名词.比如索引,类型,id这 ...
- C语言学习笔记(15)——结构体程序设计
前言 C语言的基本数据类型有整数型.实数型及字符型,使用这些基本数据类型可以构造数组类型,并且可以定义相关数据类型的指针.本节介绍的结构体类型区别于以上任何数据类型,它还能把各种不同类型的数据组合成一 ...
- uboot学习笔记之七-第三个函数board_init_r
接上回.在borad_init_f函数执行完成,C语言环境就算完全建立起来了.下面就完全是C的代码了. 返回crt0.S , 执行board_init_r(common/board_r.c), 完成b ...
- SQL学习笔记三——结构化查询语言
数据库系统-结构化查询语言 SQL数据定义 SQL基本数据类型 数值型 INT/INTEGER:整数,取值范围取决于DBMS实现 SMALLINT:整数,取值范围比INT小 BIGINT:整数,取值范 ...
最新文章
- 本地实现ES6转ES5代码——gulpfile配置文件
- 深度学习和目标检测系列教程 21-300:deepsorts测试小车经过的时间和速度
- Spring Boot笔记-自定义配置项默认值设置
- 拓端tecdat|R语言结构方程模型 SEM 多元回归和模型诊断分析学生测试成绩数据与可视化
- 阿里巴巴淘宝用户行为数据集,UserBehavior表实战分析
- CS系统设计与开发——人事档案管理系统的设计与实现
- android底部蒙版,Android实现蒙板效果
- 图像处理-放大和缩小
- 按教师名单分配学生抽签程序
- Matlab简单爬虫-寻宝天行诛仙在售角色信息
- Python 和 Web 前端选择哪个比较合适?哪个前景好?
- ssh密钥-帮助文档
- HIT-ICS大作业-程序人生Hello‘s P2P
- 用python来实现输出 1-1000的素数,并且按照每8个一行输出
- ergonomic计算机专业英语,[听单词] 计算机专业英语词汇音频52,计算机英语单词MP3...
- HDMI 网线延长器
- 【速览】2022年中国光伏逆变器行业市场现状及企业格局分析:行业需求增加,发展迅速[图]
- 传输层协议TCP UCP
- ubuntu /home 分区压缩
- 中国最牛地级市——潍坊
热门文章
- 显卡驱动版本和cuda版本对应
- 程序员心中都有一个“静静”,想起它就能踏实写代码了
- 给大家分享一下从卷烟-电子烟-口含烟的发展过程
- Java SE 059 类型安全的枚举
- SkipList原理及实现
- 微信小程序------1️⃣
- ---排列数字---
- android relativelayout 比例,百分比布局支持库:RelativeLayout 和 FrameLayout 的尺寸用 % 来表示...
- 文件系统(六)—文件系统mount过程
- 使用Jmockit完成static方法的mock