This is the mail archive of the ecos-patches@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: Fix for CONFIG_STRING option in RedBoot


The default value config_option_any_string.dflt is initialised to 0.
Then the :
    case CONFIG_STRING:
        memcpy(dp, (void *)opt->dflt, config_length(CONFIG_STRING));
does a memory fault.

The patch I proposed is wrong indeed.
The solution is to set a default value to the STRING option :

RedBoot_config_option("Any string",
                     any_string,
                      ALWAYS_ENABLED, true,
                      CONFIG_STRING,
                      "default_string"
   );

or to check if value of opt->dflt is a valid ram or rom address.

Xavier

At 08:37 31/07/2003 -0600, Gary Thomas wrote:
On Thu, 2003-07-31 at 01:28, Xavier Debreuil wrote:
> I agree with you. But I do not use any alias.
> In fact I though I could use CONFIG_STRING to add an option to my redboot
> options as follows:
>
> RedBoot_config_option("Any string",
>                       any_string,
>                        ALWAYS_ENABLED, true,
>                        CONFIG_STRING, 0
>      );
>
> If you add such an option, and your flash is erased, there is at boot time
> a problem when config_init is called which makes the system reboot.
> It does not work without that patch.

What's the value of "any_string"? (How is it declared)?

--
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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