0% found this document useful (0 votes)
15 views10 pages

Mainline Kernel Stable Kernel Long-Term Support LTS Kernel Distribution-Specific Kernel Custom Kernel Real-Time Kernel

Uploaded by

jsusomebody
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

Mainline Kernel Stable Kernel Long-Term Support LTS Kernel Distribution-Specific Kernel Custom Kernel Real-Time Kernel

Uploaded by

jsusomebody
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

PPT

Slide 2 - what is linux kernel


Kernel is a barrier between applications, CPU, memory, and devices.
With the kernel, applications have a way to access the hardware portions of
the computer. Without the kernel, the hardware doesn’t know how to interact
with anything else.

deployed on both

1. traditional computer systems - Linux distributions

2. on embedded devices such as routers.

Slide 3 - Linux kernel architecture


https://linux-kernel-labs.github.io/refs/heads/master/lectures/intro.html

slide 4 - Types of kernels

Mainline Kernel: Latest development kernel with the newest features and
experimental changes.

Stable Kernel: More tested version of the mainline kernel, focused on


stability and minor improvements.

Long-Term Support (LTS) Kernel: Maintained for several years with


regular security updates and bug fixes, but no new features.

Distribution-Specific Kernel: Custom kernels provided by distributions


with patches and tweaks tailored to their use cases.

Custom Kernel: Kernel built from source to meet specific needs or


performance requirements, with tailored features.

Real-Time Kernel: Custom kernel configured for low-latency and


predictable timing to handle real-time applications.

PPT 1
Embedded Kernel: Custom kernel optimized and stripped down for
embedded systems with limited resources.

Slide 5 - Recompiling Linux Kernel


Steps to Recompile the Kernel:

1. Obtain the Kernel Source Code: Download the kernel source code from
the official Linux kernel repository or your distribution's specific source
code repository.

2. Create a Configuration File: Use a configuration tool like make menuconfig or


make nconfig to create a configuration file (typically named .config ) that

specifies the features and options you want to enable or disable in your
recompiled kernel.

3. Build the Kernel: Execute the make command in the kernel source
directory. This will compile the kernel based on the configuration file you
created.

4. Install the Kernel: Copy the compiled kernel image to the /boot directory,
where it can be selected by the bootloader.

5. Update the Bootloader: Modify the bootloader configuration (e.g., GRUB)


to include the newly compiled kernel as a boot option.

6. Reboot: Restart your system to load the recompiled kernel.

Slide 6 - build andinstall the kernel

slide 7 - configuration changing

Slide 8 - menuconfig guide

slide 9 - menuconfig guide

slide 10 - kernel build and install


Sure! Here’s a step-by-step guide for building and installing a Linux kernel
after making changes with make menuconfig :

1. Build the Kernel


1. Compile the Kernel:

PPT 2
make -j$(nproc)

j$(nproc) uses all available CPU cores to speed up the build process.

2. Compile Kernel Modules:

make modules

2. Install the Kernel and Modules


1. Install the Kernel:

sudo make install

This installs the kernel image to /boot and updates the initial RAM disk
( initramfs ).

2. Install Kernel Modules:

sudo make modules_install

This installs the kernel modules to /lib/modules/$(uname -r)/ .

3. Update GRUB
1. Update GRUB Configuration:
This command regenerates the GRUB configuration file, detecting the new
kernel and adding it to the GRUB boot menu.

sudo update-grub

4. Reboot
1. Reboot the System:
During the boot process, GRUB should present the new kernel as an
option. If everything is set up correctly, it will boot using the newly
installed kernel.

PPT 3
sudo reboot

5. Verify the New Kernel


1. Check the Kernel Version:
After rebooting, verify that the new kernel is running with:
This command should display the version of the kernel you just installed.

uname -r

Feel free to adjust any steps based on your specific setup or requirements!

Buildroot
Different methods to create custom kernels for your embedded devices

PPT 4
go to buildroot user manual

check for the mandatory packages list and verify if these are installed on
your system

Also look into the Optional Packages section to enable the required
packages (for example - ncursers5 for menuconfig interface)

do apt-upadate and upgrade to make sure you are working with the latest
packages

clone the buildroot project and cd into the buildroot folder

In this folder there is a configs directory, which consists of a a large


number of config files for a variety of different chips and boards which
help in building a kernel image for the specific chip or board

do make <config name> to write the config into the .config file

then do make menuconfig if you want to make any changes to the


configuration,

Or directly run make to start the build

PPT 5
💡 The make process usually takes about 1 to 3 hours depending on your
system specifications

once the build is completed you can do ls -la output/image to look for the
.img file for your specifig configuration

Buildroot slides

PPT 6
Types of kernels (detailed)

Types of Linux Kernels


Mainline Kernel

Example: Linux Kernel 6.5

Context: Used by developers and those needing the latest features for
testing or bleeding-edge development. It's the kernel that eventually
forms the basis for stable and LTS releases.

Stable Kernel

Example: Ubuntu's HWE (Hardware Enablement) Kernel

Context: Ubuntu releases a stable kernel (e.g., 5.4 in Ubuntu 20.04


LTS) that undergoes extensive testing before deployment to users. It’s
recommended for most desktop and server environments.

Long-Term Support (LTS) Kernel

Example: Linux Kernel 5.10 LTS

Context: Used in systems requiring long-term stability, such as


servers or critical infrastructure. Automotive Grade Linux (AGL) often
relies on LTS kernels to ensure reliability and security over time.

Distribution-Specific Kernel

Example: Red Hat Enterprise Linux (RHEL) Kernel

Context: RHEL applies custom patches to enhance performance and


stability for enterprise environments. Similarly, Yocto Project enables

PPT 7
users to create custom distributions with tailored kernels for
embedded systems.

Real-Time Kernel

Example: PREEMPT-RT Kernel

Context: Used in real-time applications like industrial automation or


robotics, where precise timing is essential. Automotive systems, such
as AGL, may use real-time kernels to ensure critical automotive
functions are executed with low latency.

Embedded Kernel

Example: Kernel in a Buildroot-based System

Context: Buildroot is used to create minimal, optimized systems for


embedded devices. The kernel in such a system is stripped down to
include only the necessary components, often used in IoT devices or
automotive infotainment systems.

Custom Kernel

Example: Custom Kernel Built with Yocto

Context: Yocto allows for the creation of custom kernels tailored to


specific hardware or application needs, such as embedded automotive
systems. Developers can include only the necessary features,
optimizing performance and reducing footprint.

Kernel Type Description Characteristics

Developed by
Receives the latest features, updates, and
the Linux
Mainline experimental changes. Ideal for developers or
community and
Kernel those needing the newest kernel
led by Linus
advancements.
Torvalds.

A version of the
mainline kernel Focuses on stability. Recommended for
that has general users. Receives updates primarily
Stable Kernel
undergone focused on bug fixes and minor
more extensive improvements.
testing.

PPT 8
Maintained for
Long-Term several years Used in environments where reliability is
Support (LTS) with a focus on critical. Regular security updates and bug
Kernel stability and fixes but no new features.
security.

Custom kernels Often includes patches or tweaks specific to


Distribution- provided by the distribution. Optimized for the
Specific Kernel Linux distribution's intended use cases (e.g.,
distributions. desktop, server, or embedded).

Designed for
real-time Ensures predictable and low-latency response
Real-Time
applications times. Often used in specialized systems
Kernel
where timing is requiring precise timing and performance.
critical.

Optimized for
Stripped-down version of the kernel, removing
embedded
Embedded unnecessary features. Used in devices like
devices with
Kernel routers, IoT gadgets, and other dedicated
limited
hardware.
resources.

Built from
Allows for the inclusion of specific features or
source to meet
the exclusion of unnecessary components.
Custom Kernel specific needs
Can be used in specialized hardware or for
or optimize
performance tuning in specific environments.
performance.

what is kconfig

Configuration Language: Kconfig is used to define configuration options


for building the Linux kernel and its modules.

Hierarchical Structure: It organizes settings in a tree-like structure,


allowing for complex dependencies and visibility rules.

Menu System: Provides a menu-driven interface for configuring kernel


options, improving user experience in kernel configuration.

Dependency Management: Allows setting dependencies between


options, ensuring consistency and correctness of configuration.

PPT 9
Automated Tools: Tools like make menuconfig or make xconfig use Kconfig
files to generate user-friendly configuration interfaces.

put monolithic vs micro kernel architecture comparision

module installation

PPT 10

You might also like