Книга: Real-Time Concepts for Embedded Systems

9.3 Component Configuration

9.3 Component Configuration

The available system memory in many embedded systems is limited. Therefore, only the necessary service components are selected into the final application image. Frequently programmers ask how to configure a service component into an embedded application. In a simplified view, the selection and consequently the configuration of service components are accomplished through a set of system configuration files. Look for these files in the RTOS development environment to gain a better understanding of available components and applicable configuration parameters.

The first level of configuration is done in a component inclusion header file. For example, call it sys_comp.h, as shown in Listing 9.1.

Listing 9.1: The sys_comp.h inclusion header file.

#define INCLUDE_TCPIP       1
#define INCLUDE_FILE_SYS    0
#define INCLUDE_SHELL       1
#define INCLUDE_DBG_AGENT   1

In this example, the target image includes the TCP/IP protocol stack, the command shell, and the debug agent. The file system is excluded because the sample target system does not have a mass storage device. The programmer selects the desired components through sys_comp.h.

The second level of configuration is done in a component-specific configuration file, sometimes called the component description file. For example, the TCP/IP component configuration file could be called net_conf.h, and the debug agent configuration file might be called the dbg_conf.h. The component-specific configuration file contains the user-configurable, component-specific operating parameters. These parameters contain default values. Listing 9.2 uses net_conf.h.

Listing 9.2: The net_conf.h configuration file.

#define NUM_PKT_BUFS       100
#define NUM_SOCKETS         20
#define NUM_ROUTES          35
#define NUM_NICS            40

Оглавление книги


Генерация: 0.707. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз