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]

Re: Redboot boot script?


"Dennis Ehlin (ECS)" wrote:
> 
> Is it possible to use a "static boot script" i.e a script defined when RedBoot is compiled ?
> And this without having any flash memory support compiled into RedBoot.
> 
> What I want to do is to get RedBoot to load an image from flash into RAM an exec it after a delay.

Not at present but I think it would be trivial to add.

FWIW, here's my thoughts. Create a new CDL option for scripting, 
CYGFUN_REDBOOT_BOOT_SCRIPT. This can be enabled either when
CYGSEM_REDBOOT_FLASH_CONFIG is enabled, or if a new option of flavor
booldata called CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT is defined.

Change this ifdef in redboot.h:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
EXTERN unsigned char *script;
EXTERN int script_timeout;
#endif

to #ifdef CYGFUN_REDBOOT_BOOT_SCRIPT

At around line 215 or so of redboot's main.c change:

#ifdef CYGSEM_REDBOOT_FLASH_CONFIG
    // Give the guy a chance to abort any boot script
    if (script) {

to

#ifdef CYGFUN_REDBOOT_BOOT_SCRIPT
    // Give the guy a chance to abort any boot script
#ifdef CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT
    if (!script)
      script = CYGDAT_REDBOOT_DEFAULT_BOOT_SCRIPT;
#endif
    if (script) {

You'll need to do some further tweaking of the CDL options to move some of
the existing options to do with scripting underneath the new
CYGFUN_REDBOOT_BOOT_SCRIPT component.

If you did that and sent the patches, that would be brill :-).

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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