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]

RedBoot creating overlapping files?


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:

  RedBoot> vers

  RedBoot(tm) bootstrap and debug environment [ROM]
  Non-certified release, version 2.00 - built 15:20:38, Jan 13 2003

  Platform: RICHFIELD (XScale) 
  Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

It claims to be version 2.00, but based on the Changelog
entries it's well over a year old [most recent entry is
2002-01-10]. I've read through the ChangeLog entires since
then, but don't see any that sound like they fixed this bug.
I'm going to try updating to a newer version, but it would be
nice to know whether the bug is supposed to have been fixed.

[off to look at flash.c to see if I can tell...]

-- 
Grant Edwards
grante@visi.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


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