From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] arm: use $loadaddr as the standalone entry point
Date: Tue, 15 Aug 2017 15:21:15 +0200 [thread overview]
Message-ID: <20170815132115.DD22C1202B0@gemini.denx.de> (raw)
In-Reply-To: <20170815113952.GE20467@bill-the-cat>
Dear Tom,
In message <20170815113952.GE20467@bill-the-cat> you wrote:
>
> What CONFIG_STANDALONE_LOAD_ADDR is, is the location that we want
> hello_world, or other example stand alone applications loaded into
> memory at. CONFIG_LOADADDR is the safe default location to load things
> into memory at in order to run them. At least on ARM, where there's a
> good number of different default memory layouts, what arch/arm/config.mk
> does today is broken for the majority of platforms.
I agree up to here.
> We should be
> providing at least a functional default value here, which we are not
> today. This in no way precludes a 'real' standalone application from
> linking and running at whatever it wants within a platforms memory map.
This is where things become fishy.
We should use clean terms.
Please keep in mind that even the term "load address" can mean two
things: many people use this term (incorrectly) for the address where
they load an image to on RAM, and unfortunately we even provide the
"loadaddr" environment variable which carries this meaning.
Originally, the term refers to the address where the image payload gets
uncompressed and loaded to when unpacking the image. For example,
on Power architecture, a typical setup would look like:
Output of mkimage -l:
Image Name: Linux-4.4.8
Created: Fri Apr 22 09:06:09 2016
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 2009139 Bytes = 1962.05 kB = 1.92 MB
Load Address: 00000000
Entry Point: 00000000
We download the uImage file to - say - 0x400000 in RAM (so the
environment variable "loadaddr" might be 0x400000), but when we run
"bootm", U-Boot will uncompress and _load_ the Linux kernel to the
_Load_Address_ stored in the image header, i. e. 0x00000000, and then
it will transfer control to the _Entry_Point_Address_, also stored
in the image header, here also 0x00000000.
So we have:
download address (address of image in RAM): 0x00400000
load address (start of unpacked kernel image): 0x00000000
entry point (start of executable code): 0x00000000
The term "load address" has always been meant to mean the address
where the kernel gets _loaded_to_ by the bootm command. I know that
there has always been confusion of these terms, and I must have
explained this at least a hundred times here before.
I would really appreciate if you helped to avoid mixing terms of
different meaning. If you have an idea how to avoid this it would
be more than welcome - unfortunately the (mis)use of the loadaddr
environment variable is so widespread that I feat there is no easy
way out.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I'd rather be led to hell than managed to heaven.
next prev parent reply other threads:[~2017-08-15 13:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-12 9:03 [U-Boot] [PATCH 0/2] improve hello_world standalone application for arm Max Krummenacher
2017-08-12 9:03 ` [U-Boot] [PATCH 1/2] arm: use $loadaddr as the standalone entry point Max Krummenacher
2017-08-12 18:29 ` Wolfgang Denk
2017-08-12 21:21 ` Max Krummenacher
2017-08-14 19:36 ` Wolfgang Denk
2017-08-14 21:13 ` Tom Rini
2017-08-15 7:32 ` Wolfgang Denk
2017-08-15 11:39 ` Tom Rini
2017-08-15 12:22 ` Max Krummenacher
2017-08-15 13:31 ` Wolfgang Denk
2017-08-15 13:21 ` Wolfgang Denk [this message]
2017-08-19 1:35 ` Tom Rini
2017-08-12 9:03 ` [U-Boot] [PATCH 2/2] hello_world.c: fix entry point in case of arm thumb binary Max Krummenacher
2017-08-12 18:39 ` Wolfgang Denk
2017-08-12 21:31 ` Max Krummenacher
2017-08-14 19:46 ` Wolfgang Denk
2017-08-14 21:15 ` Tom Rini
2017-08-15 12:24 ` Max Krummenacher
2017-08-12 18:32 ` [U-Boot] [PATCH 0/2] improve hello_world standalone application for arm Wolfgang Denk
2017-08-12 21:21 ` Max Krummenacher
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=20170815132115.DD22C1202B0@gemini.denx.de \
--to=wd@denx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox