public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] RedBoot porting
@ 2001-01-08  4:36 Doug Fraser
  2001-01-08  4:54 ` Jesper Skov
  2001-01-08  7:34 ` Grant Edwards
  0 siblings, 2 replies; 33+ messages in thread
From: Doug Fraser @ 2001-01-08  4:36 UTC (permalink / raw)
  To: 'Jesper Skov', Andrew Lunn; +Cc: Grant Edwards, ecos-discuss

Then RedBoot becomes a chunk of the application at that
point. What I want then, I guess, is two copies of 'RedBoot'.
An immutable copy in FLASH that provides recovery of a dead board
and a runtime copy that contains the callbacks for the OS.
The runtime copy is normally copied to RAM and run there. The
FLASH copy is just used to network boot an image if the rest
of my FLASH is dead (for development). I plan on two application
regions of FLASH to provide failsafe remote updates. The
bootstrap picks the image to load based on CRC sanity. Updates
load and verify one section before erasing the second.

Does the above sound reasonable?

Doug

> -----Original Message-----
> From: Jesper Skov [ mailto:jskov@redhat.com ]
> Sent: Monday, January 08, 2001 6:05 AM
> To: Andrew Lunn
> Cc: Jesper Skov; Grant Edwards; ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] RedBoot porting
> 
<snip>

> This should work already for targets that support it. Adding the
> support to new targets it relatively simple (only really requires PIC
> startup code that initializes the system, copies everything to RAM and
> jumps there). Remember, RedBoot _is_ just an application (as far as I
> know, anyway).
> 
> Jesper
> 

^ permalink raw reply	[flat|nested] 33+ messages in thread
* [ECOS] redboot porting
@ 2003-09-16  2:55 yu weiping
  0 siblings, 0 replies; 33+ messages in thread
From: yu weiping @ 2003-09-16  2:55 UTC (permalink / raw)
  To: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb2312; format=flowed, Size: 1291 bytes --]

I'm trying to port redboot for ixdp425 to my custom board based on ixp425, 
but ixp425 seems halt every time when redboot trying to switch from boot 
address (0x000000000) to the actual flash runtime address. the code is:

	// value to load into pc to jump to real runtime address
	ldr     r0, =1f

	// Setup EXP_CNFG0 value to switch EXP bus out of low memory
	ldr 	r2, =IXP425_EXP_CFG_BASE
	ldr     r1, [r2, #IXP425_EXP_CNFG0]
	bic     r1, r1, #EXP_CNFG0_MEM_MAP
	ldr     r3, =0xFFFF
	ldr     r4, =IXDP425_LED_DATA

	b       icache_boundary
	.p2align 5
icache_boundary:
	// Here is where we switch from boot address (0x000000000) to the
	// actual flash runtime address. We align to cache boundary so we
        // execute from cache during the switchover. Cachelines are 8 
words.
        str     r1, [r2, #IXP425_EXP_CNFG0]    // make the EXP bus switch


I can light LED before the last code, but can't light LED after it.

Plesae give me some advince. Thanks!

yuwp

_________________________________________________________________
ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£  http://www.hotmail.com  


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 33+ messages in thread
[parent not found: <20010108171508.U10158@biferten.ma.tech.ascom.ch>]
* RE: [ECOS] RedBoot porting
@ 2001-01-08  5:32 Doug Fraser
  0 siblings, 0 replies; 33+ messages in thread
From: Doug Fraser @ 2001-01-08  5:32 UTC (permalink / raw)
  To: 'Jesper Skov', Doug Fraser
  Cc: Andrew Lunn, Grant Edwards, ecos-discuss, gthomas

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
> 

^ permalink raw reply	[flat|nested] 33+ messages in thread
* [ECOS] RedBoot porting
@ 2001-01-05  9:49 Grant Edwards
  2001-01-05 15:41 ` Jonathan Larmour
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Grant Edwards @ 2001-01-05  9:49 UTC (permalink / raw)
  To: ecos-discuss

I've decided to try to get RedBoot running on our custom
platform to see if it would make a suitable basis for a boot
loader.  After reading through the RedBoot porting docs, I'm a
bit confused.

Is the virtual vector table used to make calls in both
directions (user-app calling ROM and ROM calling user-app)?

Once an eCos app is running, are there one or two virtual
vector tables?

If I do not want RedBoot to provide any services to user
applications, do I still need to implement virtual vector
support in my HAL?  [Having application code depend on services
available in the boot loader is way too high-risk, since there
isn't going to be any way to upgrade the boot loader in the
field.]

There are several statements in hal-calling-if.html from which
I infer that eCos is headed towards dependence on RedBoot (or a
similar ROM monitor) for various services and that in the
future eCos apps will not be stand-alone as they are now:

  "The use of this service is controlled by the option
   CYGSEM_HAL_VIRTUAL_VECTOR_DIAG which is disabled per default
   on most older platforms (thus preserving backwards
   compatibility with older stubs). On newer ports, this option
   should always be set."

  "Note: On old ports the hardwired HAL_DIAG_INIT,
   HAL_DIAG_WRITE_CHAR and HAL_DIAG_READ_CHAR implementations
   will also contain code to O-packetize the output for GDB.
   This should not be adopted for new ports! On new ports the
   ROM monitor is guaranteed to provide the necessary mangling
   via the vector table."

I don't know that I can guarantee that a ROM monitor will be
available for use by my eCos applications. If eCos must be
guaranteed a ROM monitor, this could be a serious problem for
me.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2003-09-16  2:55 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-08  4:36 [ECOS] RedBoot porting Doug Fraser
2001-01-08  4:54 ` Jesper Skov
2001-01-08  7:34 ` Grant Edwards
  -- 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  5:32 Doug Fraser
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

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).