ChorusOS 5.0 Board Support Package Developer's Guide

Environment Variables

The env field points to an EnvDesc structure. The EnvDesc structure is declared in source_dir/nucleus/sys/common/src/lib/util/env.h.

typedef struct EnvDesc {     
                int     envSize;    /* current size of environment */
                int     envMaxSize; /* memory available for environment */
                char*   envPtr;     /* pointer to the environment */
} EnvDesc; 

The system image contains a data file with the initial state of the system environment variables. The env field of the BootConf structure references the contents of this file.

The envPtr field points to a sequence of environment variable definitions. Each definition is a concatenation of two strings, envVariable and envValue, where envVariable is the null-terminated string name of an environment variable, and envValue is the null-terminated string value of the environment variable.

The envSize field is the size in bytes of the environment variable definition sequence.

The envMaxSize field is the environment file size. It must not exceed envMaxSize.