All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <glikely@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Relocation of symbols?
Date: Mon, 27 Jun 2005 16:21:54 -0600	[thread overview]
Message-ID: <528646bc050627152162d1dba@mail.gmail.com> (raw)
In-Reply-To: <20050627200027.C7CD8CD555@atlas.denx.de>

On 6/27/05, Wolfgang Denk <wd@denx.de> wrote:
> In message <528646bc05062709261380120e@mail.gmail.com> you wrote:
> > relocation)?  As opposed to a a two stage process with a small chunk
> > of bootstrap code encapsulating the main u-boot image.  The bootstrap
> 
> Such a "small chunk" would have to include the most critical hadrware
> initialization, especially that of the  SDRAM.  If  you  follow  this
> mailing  list  for a while you will know that this alone makes 99% of
> all the "help me" postings on this list, even  though  it  is  really
> easy  to  debug:  you have printf() and all the like. Now assume this
> was in a "small chunk" which has to work without all these features -
> and which is failing silently as a black box.
I do understand this; I wasn't very clear what I meant, see below.

> 
> > code being linked seperatly from the main image so each image runs in
> > the address space it is linked to.  (like a Linux zImage; bootstrap
> > code only responsible for initializing RAM, copying the main image and
> > jumping to it).
> 
> The "only" in this sentence in inappropriate. This is one of the most
> critical areas, and you really want to have all comfort for debugging
> that you can get.
Let me clarify: I'm using "only" to refer to responsibilities, not to
code size or debug facilities.  I agree that bootstrapping is the most
critical function and debug support is non-negotiable.  I meant that
the bootstrap is responsible to get the board ready for the second
stage; It would not have any exotic functionality for were to get the
second stage or handling boot options.  All that would stay in the
second stage.

> 
> Try searching this list  and  count  how  many  people  report  about
> problems  where the system hangs or acts weird just after relocation.
> Assume this happened in some minimal assember code  without  console,
> without printf etc. You really don't want to have that.
And I do understand this; I was not suggesting an absolute minimalist
environment.  Other than final footprint size (which is not a small
issue either), there is nothing preventing common code from being
linked into both images.  Are there any estimates/measurements on how
much code is executed both before and after relocation?

The problem with relocation is that it adds a layer of complexity to
the debug process after jumping into RAM.  Things such as the
manipulating the command tables so the pointers match up again.  Every
time a new static or global is added, you need to worry about such
things.

For example; when built for flash you cannot load the image into RAM
and run it (i.e. from dBug) to see if the code after relocation is
working correctly.  This makes it more difficult to track down a
relocation problem.  When relocation hangs, it can be difficult to
isolate the problem down to code running before or after relocation. 
However, if it was a two stage image, you could run the RAM stage from
dBug.  If it doesn't work then you know you need to fix the RAM image
problem before fixing the ROM code.  If it does work then you know the
problem is with the ROM portion.  As a bonus, you know that code
running out of RAM is identical regardless of whether you've booted
from FLASH or not.

Ultimatly, I'm asking/debating whether or not a two-image scheme would
make it simpler to debug.  Granted there are other issues, such as
duplicate copies of functions; but that's why I'm asking, to get other
perspectives and become a better designer.  :-)

Comments?

  reply	other threads:[~2005-06-27 22:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-27 13:08 [U-Boot-Users] Relocation of symbols? Andreas Block
2005-06-27 13:40 ` Wolfgang Denk
2005-06-27 16:26   ` Grant Likely
2005-06-27 20:00     ` Wolfgang Denk
2005-06-27 22:21       ` Grant Likely [this message]
2005-06-28  0:21         ` Wolfgang Denk
2005-06-28 15:42           ` Grant Likely
2005-06-28 12:50   ` Andreas Block
2005-06-28 14:01     ` Wolfgang Denk
2005-06-28 14:32       ` Andreas Block
2005-06-28 15:21         ` Wolfgang Denk
2005-06-28 15:47           ` Andreas Block
2005-06-29 10:34           ` Andreas Block
2005-06-29 13:32             ` Wolfgang Denk
2005-06-29 14:16               ` Andreas Block
2005-06-29 17:32                 ` Wolfgang Denk
2005-06-30  8:10                   ` Andreas Block
2005-06-30 11:09                     ` Wolfgang Denk
2005-06-29  7:27       ` OT: Sam Beckett (Was: Re: [U-Boot-Users] Relocation of symbols?) Marius Groeger

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=528646bc050627152162d1dba@mail.gmail.com \
    --to=glikely@gmail.com \
    --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.