Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Understanding the Kernel

The kernel is the innermost layer of the Linux operating system, a thin layer of software between applications and the hardware, and that thing which is most rightly called "Linux." When your computer starts, the BIOS starts the boot loader, the boot loader hands control to the kernel, and the kernel does the rest. It initializes core systems; probes, identifies, and enables your hardware; and initiates the boot scripts. After the boot, the kernel is your gateway to the local machine, managing all resources and tasks, and supplying modules and applications with a uniform interface to services such as task switching, signaling, device I/O, and memory management.

When we say a program "runs on Linux," we mean that it communicates through these kernel interfaces. Because the kernel has been ported to systems from the tiny SH-based handheld computers to the huge S/390 mainframes, any program written on one Linux can be moved to any other platform with relative ease despite the obvious differences in the ways these computers physically handle their memory, disks, and other services. Unlike a portable interpreter such as Java, a Linux program will run optimally as a native application on its new home, depending only on the kernel configuration. Also, because Linux is an implementation of the POSIX standard UNIX interfaces, programs coded for the POSIX standard are also portable to Linux.

Linux is the fastest-growing O/S platform, already rivaling Microsoft Windows/NT and surpassing Novell. Linux is estimated to command at least 25% of all servers and 10% of desktops worldwide. There are millions of users deploying Linux in Web servers, edge servers, routers, and embedded systems. Linux is used in the space shuttle, in medicine and telerobotics, and in Hollywood. The reason for this success is not the low price tag: Linux succeeds because it is a solid design that is flexible, friendly to Open Source development, scalable, and portable from handheld computers to mainframes. Simply put, Linux succeeds because it works.

Kernel Modules

Configuring a UNIX kernel means selecting some devices and services and omitting others, and passing configuration values to the included services to more closely match the underlying hardware. Linux 2.0 introduced a middle ground to configuration by allowing for dynamic kernel configuration through the use of modules and sysctl. Rather than rebuild the whole kernel when conditions change, the modular components let you load and unload services as needed, and the /proc interface (sysctl) lets you set runtime parameters on-the-fly.

The Linux kernel is now almost completely modular; most components and services can be automatically inserted as needed through the kmod and most are generally configured through the sysctl interfaces or through setting bootparams in /etc/modules.conf. Modules can dynamically add support for filesystems or network protocols that are only needed only for certain applications and remove the module code while offline.

Loadable modules coupled with hardware detection is what lets your Red Hat distribution boot and install on your hardware. A quick look at /lib/modules will show many extraneous components. Should your hardware need them, they will already be installed. Modules are also convenient for adding services under tight memory constraints, such as in laptops or embedded systems, and essential where the hardware must be initialized before a service is enabled or where the module must be configured at runtime to support the device; for example, with plug-and-play sound cards where the boot process must initialize the interrupts before the module can be invoked.

The use of kernel modules in Linux also has a political implication: Because module system calls are not considered "linking against the kernel," modules are not bound by the GPL that governs the rest of the kernel sources. Developers are free to create proprietary modules and to distribute these without releasing the source code. This policy has prompted several commercial vendors to provide modules where patent or other licensing issues would otherwise prevent Linux support.

Share ThisShare This

Informit Network