Uboot学习笔记①---(文件目录结构、README摘要、uImage的64字节头信息)
来源:互联网 发布:周末可以做的兼职知乎 编辑:程序博客网 时间:2024/06/05 20:33
uboot下载地址ftp://ftp.denx.de/pub/u-boot/
1、查看uboot文件目录结构
Directory Hierarchy:====================/archArchitecture specific files /armFiles generic to ARM architecture /cpuCPU specific files /arm720tFiles specific to ARM 720 CPUs /arm920tFiles specific to ARM 920 CPUs /at91Files specific to Atmel AT91RM9200 CPU /imxFiles specific to Freescale MC9328 i.MX CPUs /s3c24x0Files specific to Samsung S3C24X0 CPUs /libArchitecture specific library files /x86Files generic to x86 architecture /cpuCPU specific files /libArchitecture specific library files /mipsFiles generic to MIPS architecture /cpuCPU specific files /mips32Files specific to MIPS32 CPUs /xburstFiles specific to Ingenic XBurst CPUs /libArchitecture specific library files /powerpcFiles generic to PowerPC architecture /cpuCPU specific files /74xx_7xxFiles specific to Freescale MPC74xx and 7xx CPUs /mpc5xxFiles specific to Freescale MPC5xx CPUs /mpc5xxxFiles specific to Freescale MPC5xxx CPUs /libArchitecture specific library files/apiMachine/arch independent API for external apps/boardBoard dependent files/commonMisc architecture independent functions/diskCode for disk drive partition handling/docDocumentation (don't expect too much)/driversCommonly used device drivers/dts Contains Makefile for building internal U-Boot fdt./examplesExample code for standalone applications, etc./fs Filesystem code (cramfs, ext2, jffs2, etc.)/includeHeader Files/libFiles generic to all architectures /libfdtLibrary files to support flattened device trees /lzmaLibrary files to support LZMA decompression /lzoLibrary files to support LZO decompression/netNetworking code/postPower On Self Test/rtcReal Time Clock drivers/toolsTools 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 variablebootm - boot application image from memorybootp - boot image via network using BootP/TFTP protocolbootz - boot zImage from memorytftpboot- boot image via network using TFTP protocol and env variables "ipaddr" and "serverip" (and eventually "gatewayip")tftpput - upload a file via network using TFTP protocolrarpboot- boot image via network using RARP/TFTP protocoldiskboot- boot from IDE devicebootd - boot default, i.e., run 'bootcmd'loads - load S-Record file over serial lineloadb - load binary file over serial line (kermit mode)md - memory displaymm - memory modify (auto-incrementing)nm - memory modify (constant address)mw - memory write (fill)cp - memory copycmp - memory comparecrc32 - checksum calculationi2c - I2C sub-systemsspi - SPI utility commandsbase - print or set address offsetprintenv- print environment variablessetenv - set environment variablessaveenv - save environment variables to persistent storageprotect - enable or disable FLASH write protectionerase - erase FLASH memoryflinfo - print FLASH memory informationbdinfo - print Board Info structureiminfo - print header information for application imageconinfo - print console devices and informationside - IDE sub-systemloop - infinite loop on address rangeloopw - infinite write loop on address rangemtest - simple RAM testicache - enable or disable instruction cachedcache - enable or disable data cachereset - Perform RESET of the CPUecho - echo args to consoleversion - print monitor versionhelp - 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字节头信息)
- Uboot学习笔记①---(文件目录结构、README摘要、uImage的64字节头信息)
- Uboot学习笔记①---(文件目录结构、README摘要、uImage的64字节头信息)
- 读uboot README 摘要
- Uboot中的README的中文解释 目录结构和malkefile分析
- uboot的目录结构
- uboot的目录结构
- [uboot] uboot启动kernel篇(三)——uboot解析uImage的kernel信息
- [uboot] uboot启动kernel篇(三)——uboot解析uImage的kernel信息
- openSSL学习笔记 信息摘要
- thinkPhp学习摘要2--目录结构
- GitHub学习笔记 --- ReadMe.md文件
- 遍历文件目录及bmp位图信息头的读取
- uboot readme
- uboot readme
- uboot目录结构
- uboot目录结构
- Uboot目录结构
- De Bruijn序列的生成及其应用
- 活锁,死锁,饥饿
- 一些推荐,帮助你高效地利用好上网的时间
- Java 并发编程实践
- JAVA设计模式(08):结构型-享元模式(Flyweight)
- Uboot学习笔记①---(文件目录结构、README摘要、uImage的64字节头信息)
- 简单的银行系统框架
- Oracle同义词创建及其作用
- win7 64位 vs2012 vs2010 vmware workstation 去掉菜单栏中的vmware
- 基于角色的访问控制:RBAC模型笔记
- Struts的action实现导入excel表的代码
- 第二章 线性表
- JAVA设计模式(09):结构型-代理模式(Proxy)
- 解决:android:editable is deprecated: Use an <EditText> to make it editable