This part is from a book named <>,
and I modified it's content for myself boad: Micro2440.
Since the raw flash within your embedded device(the partitions on your flash not
already devoted to a filesystem such as JFFS2) is not structured like a filesystem
and does not contain any sort of file headers, binary images downloaded to the
target must carry headers for U-Boot to recognize their content and understand
how to load thme. The mkimage utility we installed earlier was packaged with
U-Boot for this purpose. It adds the information U-Boot needs to recognize binary
images while also attaching a checksum for verification purposes.
ps: Although the use of image headers in not a technical requirement for a
bootloader, such headers are very convenient both during development and
in the field. Hence U-Boot's use of them.
To see the typical use of mkimage, type the command without any parameters:
$ mkimage
Usage: mkimage -l image
-l ==> list image header information
mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)
mkimage [-D dtc_options] -f fit-image.its fit-image
For example, here is how we create a U-Boot image of the 2.6.32.2 kernel for the
Micro2440 reference hardware:
$mkimage -A arm -O linux -T kernel -C none -a 30008000 -e 30008040 -n uImage -d zImage uImage.
The command takes quite a few options, but their meanings are easily understood
by looking at the usage message provided by mkimage. Note that the name of the
image, provided in th -n option, cannot be more than 32 characters. mkimage will
ignore any excess characters. The rest of the command line tells mkimage that
the input file is a gzip-compressed ARM Linux kernel image that should be loaded
at address 0x30008000, and started from 0x30008040. The image being provided
as input is zImage, and the U-Boot-formatted image will be output to uImage.
阅读(1708) | 评论(0) | 转发(0) |