SlideShare a Scribd company logo
OTP Training  - Ganesh M C
Drivers and the kernel UNIX system has three layers: The hardware The operating system kernel The user-level programs Kernel Kernel hides the hardware, provides a abstract, high-level programming interface Process  Signal and semaphores Virtual memory The filesystem Interprocess communication   Kernel contains device drivers that manage its interaction with specific pieces of hardware.   Size of kernel
Why Configure the kernel Generic kernel Many device drivers Optional packages Tailor the kernel for your need Less memory Well-tuned configuration Add support for new types of device Some system is simple Some may need to several steps. Read this: Building the kernel is not difficult; its just difficult to fix when you break it. Get a good reference book for your OS
Kernel Source Repository http://kernel.org/ Is the place where you could get the kernel source  Compile it according to your need
Packages required to start compilation apt-get install build-essential apt-get install bin86 kernel-package apt-get install module-init-tools initrd-tools  apt-get install fakeroot  apt-get install libncurses5-dev
Kernel Compilation Decide where to build your kernel Good place is $HOME Deciding on a kernel version For any kernel version x.y.z, * x - This is the major revision number * y - This is the minor revision number, where: Even numbers indicate "stable" kernel releases Odd numbers indicate "development" or "beta" kernel releases which may be less stable. * z - This is the patch level of the kernel
Downloading the maintainer-specific patch. Unpacking the kernel source bash$ cd $HOME bash$ tar zxvf linux-x.y.z.tar.gz bash$ cd linux-x.y.z bash$ zcat ../patch-x.y.z-vrs1.gz | patch -p1 For Cross compilation linux/README  and   linux/Documentation/arm/README   before proceeding. Both these files provide further useful information which may be specific to your kernel version.
Configuration of the kernel build environment To use the default configuration present in kernel source bash$ make  <machinename>_defconfig  Copies the config of /linux-2.6-2.6.32/arch/x86/configs/i386_defconfig to .config In this case no need to run oldconfig To do manual configuration run the command $make menuconfig
Example for configuration Selecting necessary file systems File systems ---> Pseudo Filesystems ---> [*] /proc file system support [*] Virtual memory file system support (former shm fs) (Select one or more of the following options as needed by your system) Reiser, ext3, ext4, jfs, etc.,
Selecting PPPoE necessary drivers Device Drivers --->  Networking Support --->  <*> PPP (point-to-point protocol) support <*>  PPP support for async serial ports <*>  PPP support for sync tty ports
Activating SMP support Processor type and features  --->  [*] Symmetric multi-processing support Like that we can do for the following options Activating USB Support for Input Devices Enabling PCMCIA support
Manual Installation Compiling the kernel Make  Make modules_install Installing the kernel cp arch/i386/boot/bzImage /boot/vmlinuz Generate the initrd by using the tool mkinitrd mkinitramfs -k -o /boot/initrd.img-KVN KVN Edit the grub.cfg & boot the kernel
To get the kernel in DEB make-kpkg --initrd --revision=boss4.0 kernel_image kernel_headers --us –uc --append-to-version --revision
SELinux Configure Compile as like normal kernel Edit the /etc/init.d/rc Add the parameter selinux=1 to kernel line of grub

More Related Content

PPT
Linuxdd[1]
PDF
Gnubs-pres-foss-cdac-sem
ODP
Linux internal
PPT
Basic Linux kernel
PDF
Part 02 Linux Kernel Module Programming
PDF
Part 01 Linux Kernel Compilation (Ubuntu)
PDF
Linux kernel modules
PPTX
Linux Kernel Tour
Linuxdd[1]
Gnubs-pres-foss-cdac-sem
Linux internal
Basic Linux kernel
Part 02 Linux Kernel Module Programming
Part 01 Linux Kernel Compilation (Ubuntu)
Linux kernel modules
Linux Kernel Tour

What's hot (20)

PPTX
Linux Kernel Programming
PPT
Kernel module programming
ODP
Linux Internals - Kernel/Core
PPTX
Device drivers Introduction
PDF
Kernel Configuration and Compilation
PDF
PPT
Basic Linux Internals
PDF
Architecture Of The Linux Kernel
PDF
brief intro to Linux device drivers
PDF
Kernel Module Programming
PPTX
Introduction to Linux Kernel
DOC
Type of Embedded core
PDF
Introduction To Linux Kernel Modules
PPT
Linux architecture
PPTX
Kernel modules
PPTX
Linux Kernel I/O Schedulers
PPT
Linux Kernel Development
PDF
Board support package_on_linux
PPT
Linux introduction
PDF
Linux kernel module programming guide
Linux Kernel Programming
Kernel module programming
Linux Internals - Kernel/Core
Device drivers Introduction
Kernel Configuration and Compilation
Basic Linux Internals
Architecture Of The Linux Kernel
brief intro to Linux device drivers
Kernel Module Programming
Introduction to Linux Kernel
Type of Embedded core
Introduction To Linux Kernel Modules
Linux architecture
Kernel modules
Linux Kernel I/O Schedulers
Linux Kernel Development
Board support package_on_linux
Linux introduction
Linux kernel module programming guide
Ad

Similar to Kernel compilation (20)

PPTX
introduction to computer Linux essential.pptx
PDF
Development platform virtualization using qemu
PDF
Android memory analysis Debug slides.pdf
PPT
Linux filesystemhierarchy
PPTX
Advanced Level Training on Koha / TLS (ToT)
PPT
Linux Conf Admin
PPT
Linux conf-admin
PPT
Linux conf-admin
PDF
Building
PPT
ODP
S4 xen hypervisor_20080622
PPT
Linux Troubleshooting
PDF
linux installation.pdf
PDF
Recipe of a linux Live CD (archived)
PDF
How to Check the Kernel Version in Debian 12.pdf
PDF
2015.10.05 Updated > Network Device Development - Part 1: Switch
PDF
Dru lavigne servers-tutorial
PDF
Embedded Linux Kernel - Build your custom kernel
PPTX
Introduction to Operating Systems.pptx
PPTX
managing kernal module from egineering sunject operating system
introduction to computer Linux essential.pptx
Development platform virtualization using qemu
Android memory analysis Debug slides.pdf
Linux filesystemhierarchy
Advanced Level Training on Koha / TLS (ToT)
Linux Conf Admin
Linux conf-admin
Linux conf-admin
Building
S4 xen hypervisor_20080622
Linux Troubleshooting
linux installation.pdf
Recipe of a linux Live CD (archived)
How to Check the Kernel Version in Debian 12.pdf
2015.10.05 Updated > Network Device Development - Part 1: Switch
Dru lavigne servers-tutorial
Embedded Linux Kernel - Build your custom kernel
Introduction to Operating Systems.pptx
managing kernal module from egineering sunject operating system
Ad

Recently uploaded (20)

PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
project resource management chapter-09.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
A Presentation on Touch Screen Technology
PDF
DP Operators-handbook-extract for the Mautical Institute
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
project resource management chapter-09.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25-Week II
WOOl fibre morphology and structure.pdf for textiles
SOPHOS-XG Firewall Administrator PPT.pptx
cloud_computing_Infrastucture_as_cloud_p
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
TLE Review Electricity (Electricity).pptx
A Presentation on Touch Screen Technology
DP Operators-handbook-extract for the Mautical Institute

Kernel compilation

  • 1. OTP Training - Ganesh M C
  • 2. Drivers and the kernel UNIX system has three layers: The hardware The operating system kernel The user-level programs Kernel Kernel hides the hardware, provides a abstract, high-level programming interface Process Signal and semaphores Virtual memory The filesystem Interprocess communication   Kernel contains device drivers that manage its interaction with specific pieces of hardware. Size of kernel
  • 3. Why Configure the kernel Generic kernel Many device drivers Optional packages Tailor the kernel for your need Less memory Well-tuned configuration Add support for new types of device Some system is simple Some may need to several steps. Read this: Building the kernel is not difficult; its just difficult to fix when you break it. Get a good reference book for your OS
  • 4. Kernel Source Repository http://kernel.org/ Is the place where you could get the kernel source Compile it according to your need
  • 5. Packages required to start compilation apt-get install build-essential apt-get install bin86 kernel-package apt-get install module-init-tools initrd-tools apt-get install fakeroot apt-get install libncurses5-dev
  • 6. Kernel Compilation Decide where to build your kernel Good place is $HOME Deciding on a kernel version For any kernel version x.y.z, * x - This is the major revision number * y - This is the minor revision number, where: Even numbers indicate &quot;stable&quot; kernel releases Odd numbers indicate &quot;development&quot; or &quot;beta&quot; kernel releases which may be less stable. * z - This is the patch level of the kernel
  • 7. Downloading the maintainer-specific patch. Unpacking the kernel source bash$ cd $HOME bash$ tar zxvf linux-x.y.z.tar.gz bash$ cd linux-x.y.z bash$ zcat ../patch-x.y.z-vrs1.gz | patch -p1 For Cross compilation linux/README and linux/Documentation/arm/README before proceeding. Both these files provide further useful information which may be specific to your kernel version.
  • 8. Configuration of the kernel build environment To use the default configuration present in kernel source bash$ make <machinename>_defconfig Copies the config of /linux-2.6-2.6.32/arch/x86/configs/i386_defconfig to .config In this case no need to run oldconfig To do manual configuration run the command $make menuconfig
  • 9. Example for configuration Selecting necessary file systems File systems ---> Pseudo Filesystems ---> [*] /proc file system support [*] Virtual memory file system support (former shm fs) (Select one or more of the following options as needed by your system) Reiser, ext3, ext4, jfs, etc.,
  • 10. Selecting PPPoE necessary drivers Device Drivers ---> Networking Support ---> <*> PPP (point-to-point protocol) support <*> PPP support for async serial ports <*> PPP support for sync tty ports
  • 11. Activating SMP support Processor type and features ---> [*] Symmetric multi-processing support Like that we can do for the following options Activating USB Support for Input Devices Enabling PCMCIA support
  • 12. Manual Installation Compiling the kernel Make Make modules_install Installing the kernel cp arch/i386/boot/bzImage /boot/vmlinuz Generate the initrd by using the tool mkinitrd mkinitramfs -k -o /boot/initrd.img-KVN KVN Edit the grub.cfg & boot the kernel
  • 13. To get the kernel in DEB make-kpkg --initrd --revision=boss4.0 kernel_image kernel_headers --us –uc --append-to-version --revision
  • 14. SELinux Configure Compile as like normal kernel Edit the /etc/init.d/rc Add the parameter selinux=1 to kernel line of grub