Linux Kernel Architecture

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

Appendix B: Working with the Source Code


Architecture specific targets (sparc64):
* vmlinux - Standard sparc64 kernel
vmlinux.aout - a.out kernel for sparc64
tftpboot.img - Image prepared for tftp

make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
make V=2 [targets] 2 => give reason for rebuild of target
make O=dir [targets] Locate all output files in "dir", including .config
make C=1 [targets] Check all c source with $CHECK (sparse by default)
make C=2 [targets] Force check of all c source with $CHECK

Execute "make" or "make all" to build all targets marked with [*]
For further info see the ./README file

IA-32 and AMD64 systems provide different architecture-specific targets.

wolfgang@meitner>make help
Architecture specific targets (x86):
* bzImage - Compressed kernel image (arch/x86/boot/bzImage)
install - Install kernel using
(your) ~/bin/installkernel or
(distribution) /sbin/installkernel or
install to $(INSTALL_PATH) and run lilo
bzdisk - Create a boot floppy in /dev/fd0
fdimage - Create a boot floppy image
isoimage - Create a boot CD-ROM image

i386_defconfig - Build for i386
x86_64_defconfig - Build for x86_64

As the help text explains, all targets marked with*are compiled ifmakeis invoked without arguments.

B.3.2 Structure of the Makefiles


The Kbuild mechanism makes use of the following components in addition to the.configfile:

❑ The main Makefile (/path/to/src/Makefile) that generates the kernel itself and the modules by
recursively compiling the subdirectories in accordance with the configuration and by merging
the compilation results into the final product.
❑ The architecture-specific Makefile inarch/arch/Makefilethat is responsible for the processor-
specific subtleties that must be observed during compilation — special compiler optimization
options, for instance. This file also implements allmaketargets specified in the architecture-
specific help discussed previously.
❑ scripts/Makefile.*that containmakerules relating to general compilation, module produc-
tion, the compilation of various utilities, and the removal of object files and temporary files from
the kernel tree.
❑ Various kernel source subdirectories that contain Makefiles that cater to the specific needs of a
driver or subsystem (and employ a standardized syntax).
Free download pdf