Skip to main content

The Linux Kernel

Course

Intro Video

Photo of Matthew Pearson

Matthew Pearson

Linux Training Architect II in Content

Matthew currently resides in Lynchburg, Virginia where his favorite things are spending time with family and friends, gaming, and campfires in the fall. During his senior year of high school and early college, Matthew performed in a sketch comedy show on public access television that was called Tomato Time. He brings this creativity and fun to the content he creates.

Length

03:00:00

Difficulty

Intermediate

Videos

16

Hands-on Labs

4

Course Details

Welcome to this course on the Linux kernel! This is a standalone course, but it's also part of a learning path to prepare one for the LPIC-2 201-450 exam.

The Linux kernel sits at the core of a Linux system. It provides an interface between the system hardware and both the processes and services that use it. In the first section, we teach about the various kernel components such as the linux kernel source tree, documentation, and the compressed kernel image. Then we compile a kernel from start to finish, resulting in the installation of a new Linux kernel. Finally, we cover kernel runtime management and troubleshooting. This includes gaining information about the running kernel and kernel modules, adding and removing modules, and modifying the behavior of modules on boot.

Syllabus

Introduction

Course Introduction

00:02:50

Lesson Description:

Welcome to this course on the Linux kernel! In this course, we cover the various kernel components, how to compile a kernel, and how to manage and troubleshoot a kernel during runtime.

About the Training Architect

00:00:27

Lesson Description:

Learn a little more about the training architect, Matthew Pearson.

Kernel Components (201.1)

Viewing the Kernel Source Tree and Documentation on CentOS (Linux Kernel Version 2.6.x and 3.x)

00:09:44

Lesson Description:

In order to compile a Linux kernel, the kernel source tree must be downloaded on the host. In this lesson, we show how to install the kernel source tree and view the kernel documentation on CentOS (kernel version 2.6.x and 3.x). Download and Build the Kernel Source Tree with rpm Install required packages. To perform this command, we must be the root user. Use the sudo -i command to switch to root.

yum install asciidoc audit-libs-devel bash bc binutils binutils-devel bison diffutils elfutils -y && yum install elfutils-devel elfutils-libelf-devel findutils flex gawk gcc gettext gzip hmaccalc hostname java-devel -y && yum install m4 make module-init-tools ncurses-devel net-tools newt-devel numactl-devel openssl -y && yum install patch pciutils-devel perl perl-ExtUtils-Embed pesign python-devel python-docutils redhat-rpm-config -y && yum install rpm-build sh-utils tar xmlto xz zlib-devel -y
Install and run the random number generator.
yum install rng-tools
rngd -r /dev/urandom
Switch back to cloud_user by typing exit. Install the rpm package. First create the build directory.
cd ~
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' >~/.rpmmacros
rpm -i http://vault.centos.org/7.7.1908/updates/Source/SPackages/kernel-3.10.0-1062.12.1.el7.src.rpm 2>&1 | grep -v exist
Build the rpm package.
cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec

Viewing the Kernel Source Tree and Documentation on Ubuntu (Linux Kernel Version 4.x)

00:04:26

Lesson Description:

In order to compile a Linux kernel, the kernel source tree must be downloaded on the host. In this lesson, we show how to install the kernel source tree and view the kernel documentation on Ubuntu (kernel version 4.x).

Compressed Kernel Images (zimage and bzimage)

00:03:37

Lesson Description:

Once the Linux kernel is compiled, it needs to be compressed into a smaller image file. In this lesson, we demonstrate two different compressed kernel images - zimage and bzimage.

Compiling a Kernel (201.2)

Compiling a Kernel and Building Modules (Kernel 3.x/4.x)

00:10:20

Lesson Description:

The kernel is at the core of a Linux system. In this lesson, we learn how to modify the kernel configuration, compile a compressed kernel image, and both build and install kernel modules.

Installing a New Linux Kernel

00:06:33

Lesson Description:

Once a new kernel has been compiled, the system must be configured to use it. In this lesson, we add the new kernel image to the boot directory and create a new initramfs image.

Understanding Make Targets

00:06:09

Lesson Description:

Make targets are defined within a makefile and perform specific actions when called. In this lesson, we learn about the different types of make targets that can be used when compiling a Linux kernel.

Understanding the Depmod and DKMS Utilities

00:04:14

Lesson Description:

Working with kernel modules is an important part of administering a Linux system. In this video, we demonstrate the depmod utility. It's used to manage module dependencies and the DKMS utility, which is used to build and install modules outside of the mainline kernel.

Kernel runtime management and troubleshooting (201.3)

Using Command-Line Utilities to Gain Information About the Kernel and Kernel Modules

00:10:58

Lesson Description:

Being able to gain information about the running kernel and its modules can help with troubleshooting and administering the system. In this lesson, we demonstrate several command-line utilities that provide this information. The commands we use include lsmod, uname, modinfo, and dmesg.

Adding and Removing Kernel Modules

00:06:54

Lesson Description:

The Linux system supports the ability to extend the kernel functionality by adding and removing loadable kernel modules (LKM). In this lesson, we teach how to load and remove kernel modules and how to change module parameters.

Understanding Module Configuration Files

00:08:58

Lesson Description:

Linux supports the ability to extend kernel functionality through loadable kernel modules (LKM), but changes made to the kernel during runtime will not persist through a reboot. In this lesson, we show how to use the module configuration files to load, restrict, and modify the behavior of kernel modules.

The /proc Filesystem and the` sysctl` Command

00:11:18

Lesson Description:

The proc file system is a virtual file system in Linux that provides information about the host and allows parameters to be updated at runtime. In this lesson, we demonstrate the various files and directories within the proc file system and how to modify kernel parameters using sysctl.

The Device Filesystem and Udev

00:07:15

Lesson Description:

The device file system in Linux contains files for all the devices connected to a host. In this lesson, we teach about the various device files contained in the /dev directory as well as how the Linux kernel and udev work to maintain them.

Analyzing Information about Available Hardware

00:06:59

Lesson Description:

There are several different types of hardware that allow our system to run and interact with users. In this lesson, we learn about several different utilities that can give us additional information about the hardware connected to the host.

Conclusion

Next Steps

00:03:30

Lesson Description:

Congratulations on completing the course! In this lesson, we go over some recommended content for future studies and attempt to answer the question, "What's next?".

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial