This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Re: loading and executing an ELF image from flash.
There currently isn't a way to do this directly using the FIS commands.
That said, the new 'load' command structure can easily be extended for
any media, so it wouldn't be too hard to extend RedBoot to be able to
do something like this:
RedBoot> lo -m flash image.elf
Thanks to the invaluable guidance, I was able to get ELF booting from
flash fairly easily.
I guess this could be extended to an explicit flash address, but I
will allow other brave souls to tackle that issue. I have the code
available and I can fix it up if others are interested.
David
RedBoot> load -r -b 0x10000000 -m xmodem -c 0
CRaw file loaded 0x10000000-0x1001931a, assumed entry at 0x10000000
xyzModem - CRC mode, 807(SOH)/0(STX)/0(CAN) packets, 1 retries
RedBoot> fis create -b 0x10000000 -l 0x1931a -e 0x0 RedBoot2
** WARNING: RAM address: 0x10000000 may be invalid
valid range is 0x00000000-0x00040000
... Erase from 0x00420000-0x00440000: ..
... Program from 0x10000000-0x1001931a at 0x00420000: ..
... Erase from 0x007e0000-0x007f0000: .
... Program from 0x00030000-0x00040000 at 0x007e0000: .
... Program from 0x0003000a-0x0003000c at 0x007e000a: .
RedBoot> fis list
Name FLASH addr Mem addr Length Entry point
RedBoot 0x00400000 0x00400000 0x00020000 0x00000000
RedBoot2 0x00420000 0x10000000 0x00020000 0x00000000
RedBoot config 0x007D0000 0x007D0000 0x00001000 0x00000000
FIS directory 0x007E0000 0x007E0000 0x00010000 0x00000000
Redundant FIS 0x007F0000 0x007F0000 0x00010000 0x00000000
RedBoot> x -b 0x420000
00420000: 7F 45 4C 46 01 01 01 61 00 00 00 00 00 00 00 00 |.ELF...a........|
00420010: 02 00 28 00 01 00 00 00 40 00 00 10 34 00 00 00 |..(.....@...4...|
RedBoot> load -m fis Redboot2
RedBoot> go
+
RedBoot(tm) bootstrap and debug environment [RAM]
Non-certified release, version UNKNOWN - built 13:33:43, Jul 21 2006
Platform: NMX SATMODEM (ARM7TDMI)
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
RAM: 0x00000000-0x00040000, [0x100121e8-0x00040000] available
0x10000000-0x10100000, [0x10000000-0x10100000] available
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss