From: "Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] arm linux images with load address == entry point
Date: Thu, 15 Mar 2007 16:55:50 +0100 [thread overview]
Message-ID: <20070315155550.GA7760@lala> (raw)
Hello,
the make target "uImage" in the linux kernel calls mkimage as follows:
$(MKIMAGE) -A arm -O linux -T kernel \
-C none -a $(ZRELADDR) -e $(ZRELADDR) \
-n 'Linux-$(KERNELRELEASE)' -d $< $@
(see http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=arch/arm/boot/Makefile;h=ec9c400c7f82d171ba9ccf6e52cdb055bf1a50cb;hb=HEAD,
line 63)
i.e. sets the load address and the entry point to the same address.
This part is unchanged since it was introduced in 2003.
If I understand do_bootm and do_bootm_linux (for arm, in
lib_arm/armlinux.c) correctly, the first asserts that the image is
loaded to the load address[1] and the latter jumps to entry point.
For an image created with the above rule from the vanilla kernel, that
means, jump to the header (instead of the actual image@entry point +
0x40).
So I think the linux rule is wrong, or did I miss anything?
The U-Boot I have on my target here has somewhere after the crc check in
do_bootm the following:
hdr->ih_load = htonl(addr);
hdr->ih_ep = htonl(addr + 0x40);
(Actually it's still worse, load_addr instead of addr is used ...)
This works but is ugly.
I wonder how other people using U-Boot + Linux on ARM handle that.
Best regards
Uwe
PS: Linux uses entry point == load address == 0 for PowerPC. Didn't
look in the PowerPC version of bootm_linux, but maybe it has the same
problem?
[1] For Linux this is not needed, because the decompressor (at least for
2.6) is position independant. But that's another topic.
--
Uwe Kleine-K?nig
http://www.google.com/search?q=1+stone%3D
next reply other threads:[~2007-03-15 15:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-15 15:55 Uwe Kleine-König [this message]
2007-03-15 20:25 ` [U-Boot-Users] arm linux images with load address == entry point Wolfgang Denk
2007-03-15 21:13 ` Uwe Kleine-König
2007-03-15 21:25 ` Wolfgang Denk
2007-03-15 21:42 ` [U-Boot-Users] [PATCH] Fix the condition to detect if an image is already in its place Uwe Kleine-König
2007-03-15 21:53 ` Wolfgang Denk
2007-03-15 22:35 ` Uwe Kleine-König
2007-03-15 23:14 ` Wolfgang Denk
2007-03-16 9:02 ` Uwe Kleine-König
2007-03-16 20:10 ` Wolfgang Denk
2007-03-21 20:33 ` Uwe Kleine-König
2007-03-21 20:57 ` Wolfgang Denk
2007-03-21 21:17 ` Uwe Kleine-König
2007-03-21 21:36 ` Wolfgang Denk
2007-03-15 22:57 ` [U-Boot-Users] arm linux images with load address == entry point Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070315155550.GA7760@lala \
--to=ukleinek@informatik.uni-freiburg.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.