[U-Boot-Users] mkimage

Hi; I am new to mkimage. I have an image with an entry at 0x00100004. I `mkimage` it with the following details:
[teh@ShrekII tftpboot 75]$ mkimage -l uImage Image Name: psos Created: Tue Jun 28 17:53:24 2005 Image Type: PowerPC pSOS Kernel Image (uncompressed) Data Size: 593268 Bytes = 579.36 kB = 0.57 MB Load Address: 0x00100000 Entry Point: 0x00100004 [teh@ShrekII tftpboot 76]$
Then I `tftp` it into my target, examine the memory contents.
u-boot> tftp 100000 uImage Using FCC2 ETHERNET device TFTP from server 147.128.28.42; our IP address is 147.128.28.44 Filename 'uImage'. Load address: 0x100000 Loading: ################################################################# ################################################### done Bytes transferred = 593332 (90db4 hex) u-boot> md 100000 00100000: 27051956 ba54f4c3 42c11e14 00090d74 '..V.T..B......t 00100010: 00100000 00100004 040da48f 0f070200 ................ 00100020: 70736f73 00000000 00000000 00000000 psos............ 00100030: 00000000 00000000 00000000 00000000 ................ 00100040: 7c631b78 7c631b78 3c400019 3842b234 |c.x|c.x<@..8B.4 00100050: 3da0001a 39ad8d50 7c6000a6 5463045e =...9..P|`..Tc.^ 00100070: 3c400019 3842b234 3da0001a 39ad8d50 <@..8B.4=...9..P 00100080: 4e800020 80430000 81a30004 4e800020 N.. .C......N.. 00100090: 00100470 7d6802a6 91610004 44000002 ...p}h...a..D... 001000a0: 4e800020 28030000 40820008 48022c3c N.. (...@...H.,< 001000b0: 7d6324aa 7d635b78 48022c30 38000001 }c$.}c[xH.,08... 001000c0: 4bffffe4 38000002 4bffffdc 60842000 K...8...K...`. . 001000d0: 38000003 48022c14 38000004 48022c0c 8...H.,.8...H.,. 001000e0: 38000005 48022c04 38000006 48022bfc 8...H.,.8...H.+. 001000f0: 38000007 48022bf4 38000008 48022bec 8...H.+.8...H.+. u-boot> imi
## Checking Image at 00100000 ... Image Name: psos Image Type: PowerPC Unknown OS Kernel Image (uncompressed) Data Size: 593268 Bytes = 579.4 kB Load Address: 00100000 Entry Point: 00100004 Verifying Checksum ... OK u-boot>
Content of my original executable image: hello: file format elf32-powerpc
Disassembly of section .DAE_exp: Disassembly of section .IAE_exp: Disassembly of section .RST_exp: Disassembly of section .text:
00100000 <_START-0x4>: 100000: 7c 63 1b 78 mr r3,r3
00100004 <_START>: 100004: 7c 63 1b 78 mr r3,r3 100008: 3c 40 00 19 lis r2,25 10000c: 38 42 b2 34 addi r2,r2,-19916 100010: 3d a0 00 1a lis r13,26 100014: 39 ad 8d 50 addi r13,r13,-29360 100018: 7c 60 00 a6 mfmsr r3 10001c: 54 63 04 5e rlwinm r3,r3,0,17,15 100020: 7c 60 01 24 mtmsr r3 100024: 48 00 64 3c b 106460 <HdwInit> <snip>
It crashes when I `bootm 100000`. Here is my question. The original ELF executable image has the entry point at 0x00100004. After `mkimage` and having examined the content of the memory, I find out that the content which were at the original entry point has been shifted to 0x00100040. Would that be the cause of the crash? I assume that the "-e" option to mkimage is the entry point of the original executable which is 0x00100004?
Any comment is appreciated.
Regards, TEH

In message OFAA97ED1B.93B27F93-ON4825702E.00368300@uk.marconicomms.com you wrote:
[teh@ShrekII tftpboot 75]$ mkimage -l uImage Image Name: psos Created: Tue Jun 28 17:53:24 2005 Image Type: PowerPC pSOS Kernel Image (uncompressed) Data Size: 593268 Bytes = 579.36 kB = 0.57 MB Load Address: 0x00100000
^^^^^^^^^^^^^^^^^^^^^^^^^^
u-boot> tftp 100000 uImage
^^^^^^^^^^^^^^^^^^^^^^
This makes no sense. If U-Boot is told to copy the image to a "Load Address" of 0x00100000 you must make sure to chose such an address when downloading that there will be no overlap.
It crashes when I `bootm 100000`. Here is my question. The original
ELF executable image has the entry point at 0x00100004. After `mkimage` and
But you downloaded the image to 100000, so the area 100000...10003F will be the U-Boot image header, followed by your binary file which is now offset by those 64 byes.
having examined the content of the memory, I find out that the content which were at the original entry point has been shifted to 0x00100040.
As was to be expected. You just got what you asked for.
Best regards,
Wolfgang Denk
participants (2)
-
KokHow Teh
-
Wolfgang Denk