eCosPro® Reference Manual
Prev |  | Next

# RedBoot Extra Initialization

## Name

CYGPKG_RBINIT -- provide extra RedBoot initialization

## Description

The RedBoot Extra Initialisation (RBINIT) package provides extra default initialization for RedBoot. This may be used to execute a set of initial commands, or to perform any additional platform or system specific initialization. The RBINIT package is aimed primarily at field deployment of production systems rather than at application development.

## Building RedBoot

The first step in building RedBoot with RBINIT support is to create a RedBoot configuration appropriate for the target platform. This is somewhat target specific so the appropriate platform HAL or RedBoot documentation should be consulted for further details. Typically RedBoot should be configured for ROM startup.

Given this initial configuration the RBINIT package CYGPKG_RBINIT should now be added to the configuration, using one of the eCos configuration tools. For example with the command line tool this involves using ecosconfig add rbinit.

There are a number of other configuration options which may be changed at this point:

CYGGLO_RBINIT_STDIO_DISABLE

  This option causes all output generated during the extra initialization to be discarded. Turn this option off to get output for debugging purposes.

CYGPKG_RBINIT_PRI

  This option selects the priority of the extra initialization routine. The value of this option may either be RedBoot_INIT_BEFORE_NET or RedBoot_INIT_AFTER_NET which, as the names imply, cause the extra initialization to occur either before or after any network device is initialized.

Once RedBoot has been appropriately configured it can be built and installed as usual for the target platform.

## Extra Initialization Function

The purpose of the extra initialization package is to execute the `rbinit_exec()` function. This function is at the end of the `rbinit.c` file.

The default content of this function provides support for loading and executing primary or secondary applications from a filesystem. The default function will first attempt to mount a JFFS2 filesystem named “jffs2” in the RedBoot FIS table. If that fails it will attempt to mount the first partition of an IDE hard disk using a FAT filesystem. Finally if that fails it will attempt to mount a RAM filesystem, although it will be empty. If a filesystem has been successfully mounted, it will attempt to load into RAM and run a program named “`app.primary`” from the root of the filesystem, and if that fails, a program named “`app.secondary`”.

A customized version of this function may be made by either editing the file directly in the source repository, or by copying the file to the build tree and editing it there.

Prev | Home | Next
RedBoot Extra Initialization | Up | ecoflash Flash Programming Utility