public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Doug Fraser <dfraser@photuris.com>
To: 'Jesper Skov' <jskov@redhat.com>, Doug Fraser <dfraser@photuris.com>
Cc: Andrew Lunn <andrew.lunn@ascom.ch>,
	Grant Edwards <grante@visi.com>,
	ecos-discuss@sources.redhat.com, gthomas@cambridge.redhat.com
Subject: RE: [ECOS] RedBoot porting
Date: Mon, 08 Jan 2001 05:32:00 -0000	[thread overview]
Message-ID: <E2D27064CD59574F88D05AEF5728396D01E5E4@PH01SRV02.photuris.com> (raw)

Jesper,

Thanks, see my comments in-line below.

Doug

> -----Original Message-----
> From: Jesper Skov [ mailto:jskov@redhat.com ]
> Sent: Monday, January 08, 2001 7:54 AM
> To: Doug Fraser
> Cc: 'Jesper Skov'; Andrew Lunn; Grant Edwards;
> ecos-discuss@sources.redhat.com; gthomas@cambridge.redhat.com
> Subject: RE: [ECOS] RedBoot porting
> 
<snip>

> What you're after is something like:
> 
>  FLASH
>    boot block:  RedBoot ROMRAM startup
>    blocks n-m:  application area 1
>    blocks x-y:  application area 2
>    last blocks: FIS directory
> 
>  RAM
>    bottom-whatever: RedBoot code and data space
>    whatever-top:    application code and data space
> 
> 
> On reset RedBoot will reloc to RAM and execute from there. Now we need
> to load the appropriate image. I'd suggest each image to have:
> 
>  CRC     - for the image
>  version - image version
> 
> RedBoot will (after a timeout) select the highest version with a valid
> CRC and load it into RAM, then jump to it. RedBoot already has all but
> the magic to select which image to use - which is something I think
> would be good to add as a standard feature.

I have done something like this before. I will give a quick
overview. Because FLASH is inherently block oriented, you
will find images on block boundries. Starting at that boundary,
put enough info to quickly locate and verify the image.
For example (all fields are long words):

'@@@@'                at offset zero, easy to see in memory dumps.
CRC32                 offset one, covers all remaining fields and image.
length of image       offset two
load address          offset three
start address         offset four
option word           offset five

The option word only ever had one use. Was the image compressed (RFC1951)
or was it uncompressed? You could add version information. I never
considered
that, and it could be autotragic. The updater could read the current
release and add one to it. A 32 bit version would give more update versions
than the FLASH would survive.

> 
> OK, after the image has been loaded to RAM, both ReBoot and
> application run out of RAM, and you can update the flash without
> risking it to fry because there's an unexpected exception or
> something.

Correct. That is what I am looking for.


> To get this totally failsafe, I think we'd also need to add an extra
> FIS directory, also using CRC+version, so that a power outage during
> programming does not invalidate anything.

I am not sure. Can this be recovered by the application?
It probably is implementation dependent.

> 
> And for failsafe RedBoot updating, we'd have this:
> 
>  FLASH
>   RedBoot - bootstrapper
>   RedBoot image1
>   RedBoot image2
>   Application image1
>   Application image2
> 
> RedBoot bootstrapper just loads the highest versionend (and CRC
> checked) RedBoot RAM image, which then does the application loading.

And this is what I am looking for. The only problem being that the
RedBoot image is so small and my FLASH blocks so big. So I would
recommend carrying RedBoot with the application as follows.

FLASH
 RedBoot - bootstrapper
 RedBoot + Application image 1
 RedBoot + Application image 2

I that case, the bootstrap would choose and load RedBoot, which
would then choose and load its companion OS. Optionally, the block
header could contain two sub headers that located and loaded the
contained images. In that way, the FIS could be co-located if desired.
One of the header values could be a count of subheaders:

@@@@
CRC32
length
version
subheader cnt
length <- start of first subheader
load address
start address
control word

 .
 .
 .

length <- start of second subheader
ladder
saddr
ctrl

 .
 .
 .

length <- start of Nth subheader
laddr
saddr
ctrl

 .
 .

end....


> 
> 
> Neat. But I'm sure it's unusable for all sorts of reasons :)

Maybe, but not unreasonable to think about...

> 
> Jesper
> 

             reply	other threads:[~2001-01-08  5:32 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-08  5:32 Doug Fraser [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-09-16  2:55 [ECOS] redboot porting yu weiping
     [not found] <20010108171508.U10158@biferten.ma.tech.ascom.ch>
     [not found] ` <XFMail.20010108095423.gthomas@redhat.com>
2001-01-09  0:50   ` [ECOS] RedBoot porting Andrew Lunn
2001-01-09  8:57     ` Grant Edwards
2001-01-09  9:05       ` Andrew Lunn
2001-01-09  9:12         ` Grant Edwards
2001-01-09  9:09       ` Gary Thomas
2001-01-09  9:24         ` Grant Edwards
2001-01-09  9:47         ` Andrew Lunn
2001-01-09 10:08           ` Lewin A.R.W. Edwards
2001-01-09 10:30             ` Grant Edwards
2001-01-09 10:39             ` Andrew Lunn
2001-01-09 11:24               ` Grant Edwards
2001-01-08  4:36 Doug Fraser
2001-01-08  4:54 ` Jesper Skov
2001-01-08  7:34 ` Grant Edwards
2001-01-05  9:49 Grant Edwards
2001-01-05 15:41 ` Jonathan Larmour
2001-01-08  0:08 ` Jesper Skov
2001-01-08  0:29 ` Andrew Lunn
2001-01-08  1:09   ` Jesper Skov
2001-01-08  2:36     ` Andrew Lunn
2001-01-08  3:04       ` Jesper Skov
2001-01-08  7:31   ` Grant Edwards
2001-01-08  7:40     ` Lewin A.R.W. Edwards
2001-01-08  8:24       ` Grant Edwards
2001-01-08  7:42     ` Gary Thomas
2001-01-08  7:57       ` Grant Edwards
2001-01-08  7:59       ` Andrew Lunn
2001-01-08  8:07         ` Gary Thomas
2001-01-08 14:42 ` Grant Edwards
2001-01-08 16:26   ` Gary Thomas
2001-01-09  7:33     ` Grant Edwards

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=E2D27064CD59574F88D05AEF5728396D01E5E4@PH01SRV02.photuris.com \
    --to=dfraser@photuris.com \
    --cc=andrew.lunn@ascom.ch \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=grante@visi.com \
    --cc=gthomas@cambridge.redhat.com \
    --cc=jskov@redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).