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]
Other format: [Raw text]

Re: RedBoot creating overlapping files?


On Mon, 2003-02-17 at 16:19, Grant Edwards wrote:
> 
> When I load two files (a linux kernel image and a root
> filesystem) into RAM and then create two FIS files, RedBoot
> seems to be overlapping the files:
> 
>   RedBoot> fis init -f
>   About to initialize [format] FLASH image system - are you sure (y/n)? y
>   *** Initialize FLASH Image System
> [...]
> 
>   RedBoot> load -r -b 0x11000000 root.jffs2
>   Raw file loaded 0x11000000-0x112bd57c
>   
>   RedBoot> load -r -b 0x11600000 zImage
>   Raw file loaded 0x11600000-0x116ab458
> 
> [Both files are in RAM now.]
> 
>   RedBoot> fis create -b 0x11600000 -e 0x11600000 -r 0x11600000 -l 0x100000 -s 0xab458 zImage
>   ... Erase from 0x50040000-0x50140000: ........
>   ... Program from 0x11600000-0x116ab458 at 0x50040000: ......
>   ... Unlock from 0x50fe0000-0x51000000: .
>   ... Erase from 0x50fe0000-0x51000000: .
>   ... Program from 0x1ffdf000-0x1ffff000 at 0x50fe0000: .
>   ... Lock from 0x50fe0000-0x51000000: .
>   
> [This created a 1MB image that lives at 0x50040000-0x50140000]
>   
>   RedBoot> fis create -b 0x11000000 -l 0x800000 -s 0x2bd57c root
>   ... Erase from 0x50100000-0x50900000: ................................................................
>   ... Program from 0x11000000-0x112bd57c at 0x50100000: ......................
>   ... Unlock from 0x50fe0000-0x51000000: .
>   ... Erase from 0x50fe0000-0x51000000: .
>   ... Program from 0x1ffdf000-0x1ffff000 at 0x50fe0000: .
>   ... Lock from 0x50fe0000-0x51000000: .
>   
> [This created an 8MB image that lives at 0x50100000-0x50900000]  
>   
> RedBoot> fis list
> Name              FLASH addr  Mem addr    Length      Entry point
> RedBoot           0x50000000  0x50000000  0x00040000  0x00000000
> RedBoot config    0x50FC0000  0x50FC0000  0x00001000  0x00000000
> FIS directory     0x50FE0000  0x50FE0000  0x00020000  0x00000000
> zImage            0x50040000  0x11600000  0x00100000  0x11600000
> root              0x50100000  0x11000000  0x00800000  0x00000000
> 
> The last two files (zImage and root) overlap. zImage ends at
> 50140000 but root starts at 50100000.  I think the problem is
> caused by the fact that though the zImage file ends at
> 0x5014000, the data within that file ends at 0x500eb458, so
> RedBoot ignores the stored image length and overlaps the files
> by erroneously re-using the empty sectors in the last 1/4 of
> the zImage file.
> 
> Am I correct in thinking that this is a bug in the FIS code?
> It's a version I downloaded from Intel's site:

The problem is that when you don't specify a FLASH address
for the image, RedBoot tries to find one which fits.  Currently,
it does not trust the FIS directory to determine this - which
can be argued whether or not this is correct.  It finds space
by scanning the FLASH for erased blocks.  Since your Linux image
only used 0xC0000 blocks (with actual data), the next block at
0x50100000 looked empty and that's what it used.

I wouldn't be opposed to a patch which performed a combination
of scanning and then verifying against the FIS table.  That would
probably make the most sense.

-- 
.--------------------------------------------------------.
|       Mind: Embedded Linux and eCos Development        |
|--------------------------------------------------------|
| Gary Thomas              email:  gary.thomas@mind.be   |
| Mind ( http://mind.be )  tel:    +1 (970) 229-1963     |
| gpg: http://www.chez-thomas.org/gary/gpg_key.asc       |
'--------------------------------------------------------'


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


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