This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RedBoot porting


On Mon, Jan 08, 2001 at 10:40:06AM -0500, Lewin A.R.W. Edwards wrote:

> >That's the main reason I'm thinking about running RedBoot from
> >RAM (copy from ROM on startup).  Updating flash while you're
> >running from it is a royal pain.
> 
> Is it even possible? The flash chips I use will only return
> status while in program mode, you can't exec code out of them
> while programming them.

You're not actually fetching instructions from flash while the
burn takes place. The usual method is to copy a small chunk of
code (the routine that does the actual "burn" command and waits
while flash is busy) into RAM and call it from flash.  The
catch is that you have to disable all interrrupts (or anything
that might access flash) until the burn is finished.  If you
can have interrupts disabled for a second or two, it's not a
problem.

> The way I handle flash updates in the current program is to (on
> boot) check removable media for an upgrade file. If one is
> found, I load the whole caboodle into RAM, verify its checksum,
> disable all interrupts and other things, and then jump right
> into the loaded program (which is a standalone OS of its own).
> I erase and program the flash as quickly as possible then reset
> the machine.

That's pretty similar to the way I upgrade flash (in the lab):
shove a stand-alone application into RAM that burns a new
bootloader into flash.  How you get that application into RAM
and running is the trick: if you've already got a working
bootloader, it can read it from removable media, over the
network, through a serial port, etc.

-- 
Grant Edwards
grante@visi.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]