Professional Documents
Culture Documents
Configuring The Kernel: Buddhika Siddhisena Co Founder & Cto Thinkcube Systems Pvt. LTD
Configuring The Kernel: Buddhika Siddhisena Co Founder & Cto Thinkcube Systems Pvt. LTD
By
Buddhika Siddhisena Co-Founder & CTO THINKCube Systems Pvt. Ltd
<bud at thinkcube.com> Member of LKLUG & FOSS.LK <bud at babytux.org>
Coverage
What is the kernel Why customize? Obtaining the kernel source Quick compile HOWTO Configuring the kernel Loading/ nloading modules
Linux is the Kernel Developed by Linus Torvalds in1991 Modular kernel as opposed to a micro-kernel Ported to more than 20 architectures Over 6M lines of code
Program
read()
GNU C Library
syscall(SYS_read)
Virtual File System (vfs) Linux Kernel Filesystem drivers Block device drivers
Why customize?
Most of the time you actually dont! Optimize to the hardware Optimize for the situation (desktop/server,low memory,SMP,64bit, diskless) Add an unofficial driver or feature Upgrade the kernel to the latest without waiting for your distribution.
Vanilla kernels via kernel.org Specially patched kernels such Andrew Morton's -mm patched kernel and Alan Cox's -ac
OR
OR
# make xconfig
This will clear all pre-compiled binaries as well as remove the .config file
# make clean
10
11
Code Maturity Level Options You will find options to compile alpha quality or experimental drivers. Generally fine for a desktop system, but use with care for a production quality server. General Setup Options to enable process accounting, optimize the kernel for size or have .config support that allows you to see how the kernel was configured (zcat /proc/config.gz).
Loadable Module Support Its generally a good idea to enable this. If you will need third-party kernel modules you will also need to enable Set Version Information on All Module Symbols.
12
Processor Type and Features Included in this submenu are features such as Processor type, Preemptible Kernel which can improve desktop responsiveness, Symmetric Multi-processing Support for machines with multiple CPUs, and High Memory Support for machines with more than 1G of RAM.
Power Management Options Found here are options for ACPI and CPU Frequency Scaling which can dramatically improve laptop power usage Bus Options ( PCI, PCMCIA, EISA, MCA, ISA) Here are found options for all system bus devices. On modern machines the ISA and MCA support can often be disabled.
13
Networking Options to configure network protocols, firewalls, IR, Bluetooth etc. Device Drivers Features such as SCSI support, graphic card optimizations, sound, USB, network cards and other hardware are configured here. File Systems Found here are options for filesystems which are supported by the kernel, such as EXT3, ReiserFS, NTFS or VFAT. It is best to build support for the root filesystems directly into the kernel rather than as a module.
Security Options Interesting options here include support for NSA Security Enhanced Linux and other, somewhat experimental, features to increase security.
14
You can optimize the kernel for your exact processor as shown by /proc/cpuinfo
Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon) --->
You could also turn off Generic x86 support < > Generic x86 support
Kernel reem!tion
Normally, preemption can happen only at the user space For a system to be responsive, kernel space preemption needs to be turned on. <*> Preemptible kernel Do not turn on kernel preemption in server systems
15
By default the kernel can access only about 890MB. If you have 1GB or more memory you need to enable high memory.
<*> High Memory Support (4GB)
&S driver$
You can add file system drivers via the File systems menu. DOS/FAT/NT Filesystems ---> <M> VFAT (Windows-95) fs support <M> NTFS file system support Generally you should make the root file system built-in If you want to mount network file systems such as NFS or CIFS you can enable it here. Network File Systems ---> <M> SMB file system support (to mount Windows shares etc.)
16
Magic Sy$ r)
*n t%e unlikely event of a $y$tem ?cra$%? (not re$!onding)+ !re$$ Alt , rtSc and ot%er key$ to reduce t%e damageAlt Alt Alt Alt + + + + PrtSc PrtSc PrtSc PrtSc + + + + S U O B : : : : flush buffers remount disks read only power off reboot
17
To load a kernel drive automatically as the machine boots consider adding it to /etc/modules.conf (2.4) or /etc/modprobe.conf (2.6)
18
Happy compiling...
19