B2 Configuration with Kconfig

As you know, the kernel must be configured prior to compilation. By referring to a list of options, users can decide which functions they want to include in the kernel, which they want to compile as modules, and which they want to leave out. With this in mind, developers must provide a system that indicates which features are available. To this end, the kernel employs a configuration language known as Kconfig, which is discussed throughout the remainder of this section.

The configuration language must address the following issues:

□ Components can be permanently compiled into the kernel, compiled as modules, or simply ignored (because it may not be possible to compile some components as modules in certain circumstances).

□ There may be mutual dependencies between configuration options. In other words, some options can be selected only in combination with one or more other options.

□ It must be possible to show a list of alternative options from which users may select one. There are also situations in which users are prompted to enter numbers (or similar values).

□ It must be possible to arrange the configuration options hierarchically (in a tree structure).

□ The configuration options differ from architecture to architecture.

□ The configuration language should not be over-complicated because writing configuration scripts is not exactly what most kernel programmers prefer to do.

The configuration information is spread throughout the entire source tree so that there is no need for a gigantic, central configuration file that would be difficult to patch. There must be a configuration file in each subdirectory whose code contains configurable options. The following subsection uses an example to illustrate the proper syntax of a configuration file.

The following discussion deals only with the way in which the configuration options are specified. How the options are implemented in the kernel sources is not important at the moment.

Continue reading here: B21 A Sample Configuration File

Was this article helpful?

0 0