ITS 2330 - Linux III

Chapter 3: Mastering the Kernel

Objectives:

This lesson takes place in week 4 Objectives important to this lesson:

  1. Kernel components
  2. Compiling a kernel
  3. Management and troubleshooting
Concepts:

Chapter three begins with a discussion about the Linux kernel, which you should have encountered several classes ago. A little review starts with a list of the main components you would expect in a current Linux system:

  • the Kernel - manages the hardware of the computer
  • GNU utilities - provides basic OS commands that you expect to be available on a command line
  • a GUI - Gnome, KDE, Cinnamon, and many more
  • applications- not something you expect in an operating system, but most seem to come with some decent products, such as LibreOffice

The text goes back to the kernel, reminding us of four of its functions:

  • memory management - this includes virtual memory using the familiar swap file method seen in Windows
  • program management - running programs (processes) can be visible in the foreground or hidden in the background; use the ps ax command to show sleeping/waiting/running processes
  • hardware management - managing drivers; dealing with devices as either character (one character at at time, like terminals), block (blocks of data at once, like hard drives), or network (data streams, such as are seen by NICs); communication to devices is through a created node for each one
  • filesystem management -page 103 lists several filesystems that can be found on Linux distros; you need one

In the video below, the presenter points out that the kernel is the cluster of code that processes pretty much everything that happens on the computer, so it makes a big difference if you can improve it.


Updating or replacing a Linux kernel will happen to you eventually. The text starts talking about compiling a kernel on page 108, which it admits you may never have to do. Assuming you want to do it for the value in a new experimental kernel that is not being distributed yet, the text provides a five step process:

  1. Download the source code.
  2. Create a kernel configuration file, to specify features.
  3. Compile the source code
  4. Compile and install module files
  5. Install the new kernel

In the video below, the presenter runs through most of these steps, showing us that it is not a frightening concept.


On page 120, the text turns to maintaining the kernel.

  • Look for supportive modules for the kernel in /lib/modules/. There will be subfolders for each kernel available to the system.
  • use the lsmod command to see a list of the modules currently installed; note that this list shows how many other modules use a module and what their names are
  • use modinfo modulename to get information about a module

The rest of the chapter is pretty dreary.