SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
Configuring the Kernel
             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/Unloading modules




                                     2
What is the Kernel




  •   What is the Kernel?
      •   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




                                                         3
What is the Kernel




                        read()
         Program                      GNU C Library



 User space                      syscall(SYS_read)



 Kernel space
                                 Virtual File System (vfs)
                     Linux
                                   Filesystem drivers
                     Kernel

                                  Block device drivers




                                                             4
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.



                                           5
 Obtaining the Linux Kernel source

  •   Patched Kernel source can be obtained for your distro

      • e.g.: linux­source­2.6.16 on debian
  •   Vanilla kernels via kernel.org

  •   Specially patched kernels such Andrew Morton's ­mm patched 
      kernel and  Alan Cox's ­ac




                                                               6
 Quick kernel compile


   •   You need to install the kernel development packages

        • e.g.: gcc, make, binutils, ncurses, qt
   •   Extract the kernel source in /usr/src
       linux:# tar jxvf /tmp/linux­2.6.16.8.tar.gz


   •   Optionally create a symlink
       linux:# ln 
       ­s /usr/src/linux­2.6.16.8 /usr/src/linux



   •   Quick configuration using an old configuration
       linux:# cp /boot/config­2.6.14 .config
       linux:# make oldconfig

   •   Compiling the kernel
       linux:# make && make install && make modules_install

                                                              7
 Configuring the Kernel 101
 # make config

                 OR
 # make menuconfig




                                   # make xconfig
                              OR

                                   OR If you are INSANE!
                                   # vi .config




                                                           8
 Configuring the Kernel 101

   But WHAT if you make a MESS and want
   to CLEAN UP?

                              Just use Mr. Proper
                              # make mrproper


                               This will clear all pre­compiled 
                              binaries as well as remove the .config 
                              file
                              # make clean

                               Just clean all pre­compiled binaries




                                                                      9
 Configuring the Kernel 101

   Module or Built-in (Static)?
                           Building drivers into the kernel makes 
                          the kernel FAT – require more memory 
                          and overall slower execution.

                          YET certain drivers are better of being 
                          built­in (e.g: motherboard drivers)

                      Building drivers as modules results in 
                     a thinner kernel that can load external 
                     modules as an when needed.

                     BUT make sure your kernel has 
                     access to essential drivers required to 
                     boot, through an initrd or making 
                     them built­in.
                                                                     10
 Configuring the Kernel 101

  Know your Hardware
  •   To see whats plugged into your motherboard, or USB ports.
      linux:# lspci ­v
      linux:# lsusb

  •   To check your processor and memory
      linux:# cat /proc/cpuinfo
      linux:# cat /proc/meminfo

  •   To see your hard drive partitions.
      linux:# fdisk ­l



  •   To see your kernel log
      linux:# dmesg




                                                                  11
 Configuring the Kernel 101

  Kernel config overview
  •   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
 Configuring the Kernel 101

  Kernel config overview
  •   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
 Configuring the Kernel 101

  Kernel config overview
  •   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
 Configuring the Kernel 101

 Optimize for processor architecture
 •    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 Preemption
  •    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
 Configuring the Kernel 101

 Enable High memory
 •    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)

 FS drivers
  •    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
 Configuring the Kernel 101

 Magic Sys rq
 •   On a desktop system Turn on Magic SysRq key in kernel hacking
     <*> Kernel debugging
     <*> Magic SysRq key


 •   In the unlikely event of a system ?crash? (not responding), press Alt
     + PrtSc and other keys to reduce the damage:

     Alt + PrtSc + S      :  flush buffers
     Alt + PrtSc + U      :  remount disks read only
     Alt + PrtSc + O      :  power off
     Alt + PrtSc + B      :  reboot




                                                                       17
Manually loading Linux device drivers


  •    To list modules that are currently loaded you can issue
       #lsmod

  •   To list available modules (compiled) for the current kernel
       #modprobe ­l

  •   To get a small description about a module ...
       #modinfo radeon

  •   To load a kernel module driver manually
      #modprobe radeon


  •   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...




                          Thank You
                              &
                      Happy compiling ...




                                            19

Weitere ähnliche Inhalte

Was ist angesagt?

Domino9on centos6
Domino9on centos6Domino9on centos6
Domino9on centos6a8us
 
Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...
Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...
Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...Lorscheider Santiago
 
C mode class
C mode classC mode class
C mode classAccenture
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISORVanika Kapoor
 
Cinder - status of replication
Cinder - status of replicationCinder - status of replication
Cinder - status of replicationEd Balduf
 
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...The Linux Foundation
 
Installing and Configuring Domino 10 on CentOS 7
Installing and Configuring Domino 10 on CentOS 7Installing and Configuring Domino 10 on CentOS 7
Installing and Configuring Domino 10 on CentOS 7Devin Olson
 
Relax-and-Recover Automated Testing
Relax-and-Recover Automated TestingRelax-and-Recover Automated Testing
Relax-and-Recover Automated TestingGratien D'haese
 
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, HuaweiXPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, HuaweiThe Linux Foundation
 
Azure VM 101 - HomeGen by CloudGen Verona - Marco Obinu
Azure VM 101 - HomeGen by CloudGen Verona - Marco ObinuAzure VM 101 - HomeGen by CloudGen Verona - Marco Obinu
Azure VM 101 - HomeGen by CloudGen Verona - Marco ObinuMarco Obinu
 
Cinder enhancements-for-replication-using-stateless-snapshots
Cinder enhancements-for-replication-using-stateless-snapshotsCinder enhancements-for-replication-using-stateless-snapshots
Cinder enhancements-for-replication-using-stateless-snapshotsCaitlin Bestler
 
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made EasyBrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made EasySchlomo Schapiro
 
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSEXPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSEThe Linux Foundation
 
Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...
Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...
Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...Lorscheider Santiago
 
VMWare VSphere4 Documentation Notes
VMWare VSphere4 Documentation NotesVMWare VSphere4 Documentation Notes
VMWare VSphere4 Documentation NotesGrit Suwa
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel CrashdumpMarian Marinov
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisBuland Singh
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Chris Tankersley
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirtplarsen67
 

Was ist angesagt? (20)

Domino9on centos6
Domino9on centos6Domino9on centos6
Domino9on centos6
 
Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...
Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...
Diretrizes para Implementação do Citrix XenServer 6.2.0 em Servidores HP Prol...
 
C mode class
C mode classC mode class
C mode class
 
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISORLOAD BALANCING OF APPLICATIONS  USING XEN HYPERVISOR
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
 
Cinder - status of replication
Cinder - status of replicationCinder - status of replication
Cinder - status of replication
 
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
 
Installing and Configuring Domino 10 on CentOS 7
Installing and Configuring Domino 10 on CentOS 7Installing and Configuring Domino 10 on CentOS 7
Installing and Configuring Domino 10 on CentOS 7
 
Relax-and-Recover Automated Testing
Relax-and-Recover Automated TestingRelax-and-Recover Automated Testing
Relax-and-Recover Automated Testing
 
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, HuaweiXPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei
XPDS16: Xen Scalability Analysis - Weidong Han, Zhichao Huang & Wei Yang, Huawei
 
Azure VM 101 - HomeGen by CloudGen Verona - Marco Obinu
Azure VM 101 - HomeGen by CloudGen Verona - Marco ObinuAzure VM 101 - HomeGen by CloudGen Verona - Marco Obinu
Azure VM 101 - HomeGen by CloudGen Verona - Marco Obinu
 
Cinder enhancements-for-replication-using-stateless-snapshots
Cinder enhancements-for-replication-using-stateless-snapshotsCinder enhancements-for-replication-using-stateless-snapshots
Cinder enhancements-for-replication-using-stateless-snapshots
 
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made EasyBrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
 
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSEXPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE
XPDS16: libvirt and Tools: What's New and What's Next - James Fehlig, SUSE
 
Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...
Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...
Comparação entre XenServer 6.2 e VMware VSphere 5.1 - Comparison of Citrix Xe...
 
Wowza project
Wowza   projectWowza   project
Wowza project
 
VMWare VSphere4 Documentation Notes
VMWare VSphere4 Documentation NotesVMWare VSphere4 Documentation Notes
VMWare VSphere4 Documentation Notes
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 
Kdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysisKdump and the kernel crash dump analysis
Kdump and the kernel crash dump analysis
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015
 
Kvm and libvirt
Kvm and libvirtKvm and libvirt
Kvm and libvirt
 

Andere mochten auch

Andere mochten auch (12)

Bendicin
BendicinBendicin
Bendicin
 
X11 leave term_lunch and learn
X11 leave term_lunch and learnX11 leave term_lunch and learn
X11 leave term_lunch and learn
 
porta-sin ti-ale te amo
porta-sin ti-ale te amoporta-sin ti-ale te amo
porta-sin ti-ale te amo
 
Fotossimpticas
FotossimpticasFotossimpticas
Fotossimpticas
 
For you
For youFor you
For you
 
Letter And Rhyme
Letter And RhymeLetter And Rhyme
Letter And Rhyme
 
visión
visiónvisión
visión
 
Leave policies of different companies
Leave policies  of different companiesLeave policies  of different companies
Leave policies of different companies
 
Leave roles and leave policy
Leave roles and leave policyLeave roles and leave policy
Leave roles and leave policy
 
Marmelada
MarmeladaMarmelada
Marmelada
 
16 Jerry Ketel: How to know if you are a Narcissist
16 Jerry Ketel: How to know if you are a Narcissist16 Jerry Ketel: How to know if you are a Narcissist
16 Jerry Ketel: How to know if you are a Narcissist
 
07 Jayson Falkner: Science. It works, bitches. DNA Edition.
07 Jayson Falkner: Science. It works, bitches. DNA Edition.07 Jayson Falkner: Science. It works, bitches. DNA Edition.
07 Jayson Falkner: Science. It works, bitches. DNA Edition.
 

Ähnlich wie Kernel Configuration

Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and CompilationBud Siddhisena
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Bud Siddhisena
 
Kernel compilation
Kernel compilationKernel compilation
Kernel compilationmcganesh
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库maclean liu
 
Dru lavigne servers-tutorial
Dru lavigne servers-tutorialDru lavigne servers-tutorial
Dru lavigne servers-tutorialDru Lavigne
 
How to Install ArchLinux to a USB Flashdrive in 2012
How to Install ArchLinux to a USB Flashdrive in 2012How to Install ArchLinux to a USB Flashdrive in 2012
How to Install ArchLinux to a USB Flashdrive in 2012Chukwuma Onyeije, MD, FACOG
 
Howtoinstallarchlinuxtousb final-120610172253-phpapp01
Howtoinstallarchlinuxtousb final-120610172253-phpapp01Howtoinstallarchlinuxtousb final-120610172253-phpapp01
Howtoinstallarchlinuxtousb final-120610172253-phpapp01decenttr
 
High performance content hosting
High performance content hosting High performance content hosting
High performance content hosting Aleksey Korzun
 
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfBasics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfstroganovboris
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsCumulus Networks
 

Ähnlich wie Kernel Configuration (20)

Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and Compilation
 
Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)Recipe of a linux Live CD (archived)
Recipe of a linux Live CD (archived)
 
Kernel compilation
Kernel compilationKernel compilation
Kernel compilation
 
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
图文详解安装Net backup 6.5备份恢复oracle 10g rac 数据库
 
Dru lavigne servers-tutorial
Dru lavigne servers-tutorialDru lavigne servers-tutorial
Dru lavigne servers-tutorial
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
How to Install ArchLinux to a USB Flashdrive in 2012
How to Install ArchLinux to a USB Flashdrive in 2012How to Install ArchLinux to a USB Flashdrive in 2012
How to Install ArchLinux to a USB Flashdrive in 2012
 
Howtoinstallarchlinuxtousb final-120610172253-phpapp01
Howtoinstallarchlinuxtousb final-120610172253-phpapp01Howtoinstallarchlinuxtousb final-120610172253-phpapp01
Howtoinstallarchlinuxtousb final-120610172253-phpapp01
 
Ilf2013
Ilf2013Ilf2013
Ilf2013
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
High performance content hosting
High performance content hosting High performance content hosting
High performance content hosting
 
Self 2013
Self 2013Self 2013
Self 2013
 
BSDCan2013
BSDCan2013BSDCan2013
BSDCan2013
 
Dev ops
Dev opsDev ops
Dev ops
 
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdfBasics_of_Kernel_Panic_Hang_and_ Kdump.pdf
Basics_of_Kernel_Panic_Hang_and_ Kdump.pdf
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center Operations
 
Texas 2013
Texas 2013Texas 2013
Texas 2013
 
Good virtual machines
Good virtual machinesGood virtual machines
Good virtual machines
 
Rac on NFS
Rac on NFSRac on NFS
Rac on NFS
 

Kürzlich hochgeladen

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 

Kürzlich hochgeladen (20)

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 

Kernel Configuration

  • 1. Configuring the Kernel By Buddhika Siddhisena Co­Founder & CTO THINKCube Systems Pvt. Ltd <bud at thinkcube.com> Member of LKLUG & FOSS.LK <bud at babytux.org>
  • 2.  Coverage • What is the kernel • Why customize? • Obtaining the kernel source • Quick compile HOWTO • Configuring the kernel • Loading/Unloading modules 2
  • 3. What is the Kernel • What is the Kernel? • 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 3
  • 4. What is the Kernel read() Program GNU C Library User space syscall(SYS_read) Kernel space Virtual File System (vfs) Linux Filesystem drivers Kernel Block device drivers 4
  • 5. 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. 5
  • 6.  Obtaining the Linux Kernel source • Patched Kernel source can be obtained for your distro • e.g.: linux­source­2.6.16 on debian • Vanilla kernels via kernel.org • Specially patched kernels such Andrew Morton's ­mm patched  kernel and  Alan Cox's ­ac 6
  • 7.  Quick kernel compile • You need to install the kernel development packages • e.g.: gcc, make, binutils, ncurses, qt • Extract the kernel source in /usr/src linux:# tar jxvf /tmp/linux­2.6.16.8.tar.gz • Optionally create a symlink linux:# ln  ­s /usr/src/linux­2.6.16.8 /usr/src/linux • Quick configuration using an old configuration linux:# cp /boot/config­2.6.14 .config linux:# make oldconfig • Compiling the kernel linux:# make && make install && make modules_install 7
  • 8.  Configuring the Kernel 101 # make config OR # make menuconfig # make xconfig OR OR If you are INSANE! # vi .config 8
  • 9.  Configuring the Kernel 101 But WHAT if you make a MESS and want to CLEAN UP? Just use Mr. Proper # make mrproper  This will clear all pre­compiled  binaries as well as remove the .config  file # make clean  Just clean all pre­compiled binaries 9
  • 10.  Configuring the Kernel 101 Module or Built-in (Static)?  Building drivers into the kernel makes  the kernel FAT – require more memory  and overall slower execution. YET certain drivers are better of being  built­in (e.g: motherboard drivers)  Building drivers as modules results in  a thinner kernel that can load external  modules as an when needed. BUT make sure your kernel has  access to essential drivers required to  boot, through an initrd or making  them built­in. 10
  • 11.  Configuring the Kernel 101 Know your Hardware • To see whats plugged into your motherboard, or USB ports. linux:# lspci ­v linux:# lsusb • To check your processor and memory linux:# cat /proc/cpuinfo linux:# cat /proc/meminfo • To see your hard drive partitions. linux:# fdisk ­l • To see your kernel log linux:# dmesg 11
  • 12.  Configuring the Kernel 101 Kernel config overview • 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
  • 13.  Configuring the Kernel 101 Kernel config overview • 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
  • 14.  Configuring the Kernel 101 Kernel config overview • 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
  • 15.  Configuring the Kernel 101 Optimize for processor architecture • 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 Preemption • 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
  • 16.  Configuring the Kernel 101 Enable High memory • 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) FS drivers • 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
  • 17.  Configuring the Kernel 101 Magic Sys rq • On a desktop system Turn on Magic SysRq key in kernel hacking <*> Kernel debugging <*> Magic SysRq key • In the unlikely event of a system ?crash? (not responding), press Alt + PrtSc and other keys to reduce the damage: Alt + PrtSc + S  :  flush buffers Alt + PrtSc + U  :  remount disks read only Alt + PrtSc + O  :  power off Alt + PrtSc + B  :  reboot 17
  • 18. Manually loading Linux device drivers •  To list modules that are currently loaded you can issue #lsmod • To list available modules (compiled) for the current kernel #modprobe ­l • To get a small description about a module ... #modinfo radeon • To load a kernel module driver manually #modprobe radeon • 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
  • 19.  Happy compiling... Thank You & Happy compiling ... 19