Uboot Mkimage Use detailed

Source: Internet
Author: User

Mkimage use of the detailed
Uboot source Code tools/directory has mkimage tools, this tool can be used to create non-compression or compression of a variety of bootable image files.
Mkimage when making an image file, it is to precede the original executable image file with a 0x40 byte header, record the information specified by the parameter, so that Uboot can identify which CPU architecture the image is for, which OS, which type, which location to load in memory, Where the entry point is in memory and what the image name is
[email protected]:/tftpboot#./mkimage
Usage:./mkimage-l image
-L ==> List image header information
./mkimage-a arch-o os-t type-c comp-a addr-e ep-n name-d data_file[:d ata_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)
Parameter description:
-a specifies the architecture of the CPU:
Architecture for value representation
Alpha Alpha
Arm A RM
x86 Intel x86
IA64 IA64
MIPS MIPS
Mips64 MIPS-Bit
PPC PowerPC
s390 IBM S390
SH SuperH
SPARC SPARC
SPARC64 SPARC Bit
m68k MC68000
-o Specifies the operating system type, which can take the following values:
OpenBSD, NetBSD, FreeBSD, 4_4bsd, Linux, SVR4, Esix, Solaris, IRIX, SCO, Dell, NCR, LynxOS, VxWorks, PSOs, QNX, U-boot, Rtems, Artos
-t specifies the image type and can take the following values:
Standalone, kernel, RAMDisk, multi, firmware, filesystem
-c Specifies the image compression method, you can take the following values:
None No compression
Gzip compression method with gzip
Bzip2 compression method with bzip2
-a specifies the image to load the address in memory, when the image is downloaded into memory, the address value specified by this parameter is downloaded when the image is made with mkimage.
-e Specifies the address of the entry point for the image run, which is the value specified by the-a parameter plus 0x40 (because there is a header with a mkimage added 0x40 bytes in front)
-n Specifies the image name
-d Specifies the source file to make the image

Using BOOTM to boot kernel methods under U-boot

First, before beginning to explain the BOOTM related things.
1, first of all, the s3c2410 architecture Bootm only the kernel image files in the SDRAM operation (as if the AT91 architecture provides a piece of code from the Flash copy kernel image, but there is no code for the s3c2410 architecture, Although it is possible to add this code under U-boot, it does not seem to be useful, so make sure that your kernel image is downloaded to the SDRAM, or that the kernel image in Flash is copied to the SDRAM under Bootcmd.
2,-a parameter is the running address of the kernel, and the-e parameter is the entry address.
3.
1) If we do not use Mkimage to process the kernel, then directly download the kernel to the 0x30008000 and then run the line, the kernel will Self-extracting run (but the kernel operation requires a tag to pass parameters, and this tag recommendation is provided by bootloader, The default is established by the BOOTM command under U-boot.

2) If you use Mkimage to generate a kernel image file, the kernel will be preceded by a 64byte of information for the purpose of building the tag. The BOOTM command first determines whether the specified address, XXXX, BOOTM xxxx is the same as the load address specified by-A.
(1) If different words will start from this address to extract the 64byte head, analyze it, and then copy the removed head of the kernel to a specified load address to run
(2) If it is the same, then let it be different in the same place, but the E-specific entry address will be postponed 64byte to skip the 64byte head.
Second, good, then introduce the use of Mkimage to generate image files and download the method of running.
Method One,
1, first, with u-boot/tools/mkimage This tool for your kernel plus u-boot boot the required file header, the following practices:
[[email protected] tftpboot] #mkimage-n ' linux-2.6.14 '-A arm-o linux-t kernel-c none-a 0x30008000-e 0x30008000-d ZI Mage Zimage.img
Image name:linux-2.6.14
Created:fri Jan 12 17:14:50 2007
Image Type:arm Linux Kernel image (uncompressed)
Data size:1262504 Bytes = 1232.91 KB = 1.20 MB
Load address:0x30008000
Entry point:0x30008000
This explains the meaning of the parameter:
-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)

2. Download kernel
U-boot 1.1.3 (Jan 12 2007-16:16:36)
U-boot code:33f80000, 33f9bac0 BSS: 33f9fbac
RAM Configuration:
Bank #0:30000000 MB
Nor flash:512 KB
Nand flash:64 MB
In:serial
Out:serial
Err:serial
Hit any key to stop autoboot:0
Sbc2410=>tftp 0x31000000 zimage.img
TFTP from server 192.168.1.115; Our IP address is 192.168.1.128
Filename ' zimage.img '.
Load address:0x31000000
Loading: #################################################################
#################################################################
#################################################################
####################################################
Done
Bytes transferred = 1263324 (1346DC hex)
3. Running
Sbc2410=>bootm 0x31000000
# # Booting image at 31000000 ...
Image name:linun-2.6.14
Image Type:arm Linux Kernel image (uncompressed)
Data size:1263260 Bytes = 1.2 MB
Load address:30008000
Entry point:30008000
Verifying Checksum ... Ok
Ok
Starting kernel ...
Uncompressing Linux ... ..... ... ..... ... ..... ..... ..... ..... ..... ..... ..... ..... ....... ......... Linux version 2.6.14 ([email protected]) (gcc version 3.4.1) #21 Fri Oct 17:206cpu:arm920tid (WB) [41129200] revision 0 (ARMV4T)
machine:smdk2410
Memory POLICY:ECC Disabled, Data cache writeback
CPU s3c2410a (ID 0x32410002)
S3c2410:core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHz
s3c2410 clocks, (c) 2004 Simtec Electronics
Clock:slow mode (1.500 MHz), fast, MPLL on, UPLL on
USB Control, (c) 2006 sbc2410
Cpu0:d vivt Write-back Cache
Cpu0:i cache:16384 bytes, associativity, byte lines, 8 sets
Cpu0:d cache:16384 bytes, associativity, byte lines, 8 sets
Built 1 zonelists
Kernel command line:console=ttysac0 root=/dev/nfs nfsroot=192.168.1.115:/frien "irq:clearing subpending status 00000002
PID Hash Table entries:512 (order:9, 8192 bytes)
Timer tcon=00500000, tcnt a509, Tcfg 00000200,00000000, usec 00001e4c
Console:colour Dummy Device 80x30
Dentry Cache Hash Table entries:16384 (order:4, 65536 bytes)
Inode-cache Hash Table entries:8192 (order:3, 32768 bytes)
MEMORY:64MB = 64MB Total
MEMORY:62208KB available (1924K code, 529K data, 108K init)
Mount-cache Hash Table entries:512
Cpu:testing Write Buffer Coherency:ok
Softlockup thread 0 started up.
Net:registered Protocol Family 16
S3c2410:initialising Architecture
SCSI subsystem Initialized
usbcore:registered New Driver Usbfs
Usbcore:registered New Driver Hub
s3c2410 DMA Driver, (c) 2003-2004 Simtec Electronics
DMA Channel 0 at c4800000, IRQ 33
DMA Channel 1 at c4800040, IRQ 34
DMA Channel 2 at c4800080, IRQ 35
DMA Channel 3 at C48000C0, IRQ 36
Netwinder floating point Emulator V0.97 (double precision)
devfs:2004-01-31 Richard Gooch ([email protected])
devfs:devfs_debug:0x0
devfs:boot_options:0x1
Yaffs OCT 2006 12:39:51 Installing.
Console:switching to colour buffer device 30x40
FB0:S3C2410FB Buffer Device
Fb1:virtual buffer device, using 1024K of video memory
LED driver initialized
s3c2410 Buttons successfully loaded
S3c2410_serial0 at MMIO 0x50000000 (IRQ = All) is a s3c2410
S3c2410_serial1 at MMIO 0x50004000 (IRQ = $) is a s3c2410
S3c2410_serial2 at MMIO 0x50008000 (IRQ = ON) is a s3c2410
IO Scheduler NoOp Registered
IO Scheduler anticipatory registered
IO Scheduler deadline registered
IO Scheduler CFQ Registered
RAMDISK driver initialized:16 RAM disks of 4096K size 1024x768 blocksize
Usbcore:registered New Driver UB
Cirrus Logic cs8900a driver for Linux (Modified for SMDK2410)
eth0:cs8900a Rev E at 0xe0000300 irq=53, no EEPROM, addr:08:0:3e:26:0a:5b
S3c24xx NAND Driver, (c) 2004 Simtec Electronics
S3c2410-nand:mapped Registers at c4980000
S3c2410-nand:timing:tacls 10ns, Twrph0 30ns, TWRPH1 10ns
NAND device:manufacturer id:0xec, Chip id:0x76 (Samsung NAND 64MiB 3,3v 8-bi) scanning device for bad blocks
Bad Eraseblock 1884 at 0x01d70000
Creating 4 MTD partitions on "NAND 64MiB 3,3v 8-bit":
0x00000000-0x00020000: "Vivi"
0x00020000-0x00030000: "param"
0x00030000-0x00200000: "Kernel"
0x00200000-0x04000000: "Root"
Usbmon:debugfs is not available
S3C2410-OHCI s3c2410-ohci:s3c24xx OHCI
S3C2410-OHCI s3c2410-ohci:new USB Bus registered, assigned bus number 1
S3C2410-OHCI S3c2410-ohci:irq, io mem 0x49000000
Hub 1-0:1.0:USB Hub found
Hub 1-0:1.0:2 Ports detected
Initializing USB Mass Storage driver ...
usbcore:registered New Driver Usb-storage
USB Mass Storage support registered.
usbcore:registered New Driver Usbmouse
Drivers/usb/input/usbmouse.c:v1.6:usb HID Boot Protocol Mouse Driver
MICE:PS/2 mouse device common for all mice
S3C2410 touchscreen successfully loaded
UDA1341 Audio driver initialized
Net:registered Protocol Family 2
IP route Cache Hash Table entries:1024 (order:0, 4096 bytes)
TCP established hash table entries:4096 (order:2, 16384 bytes)
TCP bind hash Table entries:4096 (order:2, 16384 bytes)
Tcp:hash tables configured (established 4096 bind 4096)
TCP Reno Registered
TCP BIC Registered
Net:registered Protocol Family 1
Ip-config:complete:
Device=eth0, addr=192.168.1.128, mask=255.255.255.0, gw=192.168.1.1,
Host=luofuchong, domain=, nis-domain= (None),
bootserver=192.168.1.1, rootserver=192.168.1.115, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.115
Looking up port of RPC 100005/1 on 192.168.1.115
vfs:mounted Root (NFS filesystem).
Mounted DEVFS On/dev
Freeing Init memory:108k
Init started:busybox v1.1.3 (2006.09.20-14:52+0000) multi-call binary
Starting PID 696, console/dev/tts/0: '/etc/init.d/rcs '
Press Enter to activate the this console.
Method Two,
1, first, with u-boot/tools/mkimage This tool for your kernel plus u-boot boot the required file header, the following practices:
[[email protected] tftpboot] #mkimage-n ' linux-2.6.14 '-A arm-o linux-t kernel-c none-a 0x30008000-e 0x30008040-d ZI Mage Zimage.img
Image name:linux-2.6.14
Created:fri Jan 12 17:14:50 2007
Image Type:arm Linux Kernel image (uncompressed)
Data size:1262504 Bytes = 1232.91 KB = 1.20 MB
Load address:0x30008000
Entry point:0x30008040

2. Download kernel
U-boot 1.1.3 (Jan 12 2007-16:16:36)
U-boot code:33f80000, 33f9bac0 BSS: 33f9fbac
RAM Configuration:
Bank #0:30000000 MB
Nor flash:512 KB
Nand flash:64 MB
In:serial
Out:serial
Err:serial
Hit any key to stop autoboot:0
Sbc2410=>tftp 0x30008000 zimage.img
TFTP from server 192.168.1.115; Our IP address is 192.168.1.128
Filename ' zimage.img '.
Load address:0x30008000
Loading: #################################################################
#################################################################
#################################################################
####################################################
Done
Bytes transferred = 1263324 (1346DC hex)
3. Running
Sbc2410=>bootm 0x30008000
# # Booting image at 30008000 ...
Image name:linux-2.6.14
Image Type:arm Linux Kernel image (uncompressed)
Data size:1261056 Bytes = 1.2 MB
Load address:30008000
Entry point:30008040
Verifying Checksum ... Ok
XIP Kernel Image ... Ok
Kernel boot Information province ....

Discussion of < related users >
Http://www.linuxforum.net/forum/showflat.php? Cat=&board=embedded&number=651003&page=&view=&sb=&o=&fpart=1&vc=1

Uboot Mkimage Use detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.