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: eCos HAL Object Tables


On Tue, 2002-05-21 at 12:18, Craig Vanderborgh wrote:
> Hello all:
> 
> I am trying to determine how the eCos HAL Object Tables mechanism works.
> In particular, I am looking at the macros:
> 
> CYG_HAL_TABLE_BEGIN( __CONFIG_options_TAB__, RedBoot_config_options);
> CYG_HAL_TABLE_END( __CONFIG_options_TAB_END__, RedBoot_config_options);
> 
> and trying to understand where in flash memory the Redboot config options
> parameters get written.  I need to understand this because I wish to
> use "fconfig" values for configuring my system at the time my Linux
> kernel boots.
> 
> Could someone please describe how the CYG_HAL_TABLE_* mechanism works, and
> how to ascertain the location of table objects in flash memory??

There are two things at work here.

First, the tables mentioned are used by the 'fconfig' command to know
what data items go in the database.  Secondly, the actual data which is
stored in flash has little to do with the tables - it is dynamically 
laid out, depending on the actual data present.

For the tables: these are a vector of simple structures.  They are 
collected by the linker into a separate program section, with the labels
__CONFIG_options_TAB__ and __CONFIG_options_TAB_END__ marking the start
and end of the vector, respectively.  The symbol "RedBoot_config_options"
is [part of] the name of the program section.

As for how the actual data is organized in the flash, look at
<flash_config.h> and <flash.c>  You'll see that it's just a variable length
list of items, each with a type identifier (for the types supported - numbers,
strings, etc), and a key name, followed by the actual key data.  Think of it
as a list
  key1=value1, key2=value2, ...
You can determine where in the flash the actual data is stored by looking at
the FIS directory (although RedBoot does it the hard way).  I'd suggest this
because we're changing this a bit, allowing the fconfig data to reside in the
same flash erase block as the FIS directory.

I hope this helps.


-- 
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]