Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer runapp02.tex V2 - 09/04/2008 6:09pm Page 1153

Appendix B: Working with the Source Code


All configuration options must analyze the configuration information in the diverse Kconfig files. The
resulting configuration must also be saved. The kernel sources provide thelibkconfiglibrary for this
purpose. It holds the routines needed to perform the appropriate tasks. (This appendix does not discuss
the implementation of the parser that employs the Bison and Flex parser and scanner generators. For
that, refer to the relevant sources inscripts/kconfig/zconf.yandzconf.l.)


The user-defined configuration options are held in.config, as shown in this example:


wolfgang@meitner>cat .config
#
# Automatically generated make config: don’t edit
# Linux kernel version: 2.6.24
# Thu Mar 20 00:09:15 2008
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_GENERIC_TIME=y
...
#
# General setup
#
CONFIG_EXPERIMENTAL=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION="-default"
CONFIG_LOCALVERSION_AUTO is not set
...
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_CHECK_SIGNATURE=y

All configuration symbols are prefixed with theCONFIG_string.=yor=nis appended if the entry is set.
Options that are not set are commented out using a number sign (#).


The<config.h>file must be linked in to make the selected configuration visible in the kernel sources. In
turn, this file incorporates<autoconf.h>into the source text. The latter contains configuration informa-
tion in a form that the pre-processor can easily digest, as shown here:


<autoconf.h>
/*
* Automatically generated C config: don’t edit
* Linux kernel version: 2.6.24
* Thu Mar 20 00:09:26 2008
*/
#define AUTOCONF_INCLUDED
#define CONFIG_USB_SISUSBVGA_MODULE 1
#define CONFIG_USB_PHIDGETMOTORCONTROL_MODULE 1
#define CONFIG_VIDEO_V4L1_COMPAT 1
Free download pdf