Archive for the tag 'Kernel'

32 bit Architecture and the hugemem Kernel

In Red Hat Enterprise Linux 3, 4 or 5 the smp kernel can be used on systems with up to 16 GB of RAM. The hugemem kernel is required in order to use all the memory on systems that have more than 16GB of RAM up to 64GB. However, it is recommend to use the hugemem kernel even on systems that have 8GB of RAM or more due to the potential issue of “low memory” starvation (see next section) that can happen on database systems with 8 GB of RAM. The stability you get with the hugemem kernel on larger systems outperforms the performance overhead of address space switching.

SBDavid

Dynamic Kernel Module Support (DKMS)

Dynamic Kernel Module Support (DKMS) is a framework used to generate Linux kernel modules whose sources do not generally reside in the Linux kernel source tree. DKMS enables kernel device drivers to be automatically rebuilt when a new kernel is installed.

An essential feature of DKMS is that it automatically recompiles all DKMS modules if a new kernel version is installed. This allows drivers and devices outside of the mainline kernel to continue working after a Linux kernel upgrade.

Another benefit of DKMS is that it allows one to install a new driver on an existing system, running an arbitrary kernel version, without any need for manual compilation or precompiled packages provided by the vendor.

DKMS was written by the Linux Engineering Team at Dell in 2003. It is included in many distributions, such as Ubuntu, Debian, Red Hat Enterprise Linux, Fedora, SuSE and CentOS. DKMS is free software released under the terms of the GNU General Public License (GPL) v2 or later.

DKMS supports both the RPM and DEB package formats out-of-the-box.

Reference: http://linux.dell.com/dkms/

Downloading and using kernel source on Ubuntu

There may come a time when you need the kernel source code, usually to build kernel headers, compile a module etc. To work with the kernel source once you have it, you’ll want some development tools installed on your server.

sudo aptitude update
sudo aptitude install build-essential

To check the version right on the server. Just run:

root@laptop:~# uname -r
2.6.28-11-generic

Searching for kernel source.

# apt-cache search linux-source
linux-ports-source-2.6.28 - Linux kernel source for version 2.6.28 with Ubuntu patches
linux-source - Linux kernel source with Ubuntu patches
linux-source-2.6.28 - Linux kernel source for version 2.6.28 with Ubuntu patches
SBDavid

The Linux Kernel

When the kernel loads, it immediately initializes and configures the computer’s memory. Next it configures the various hardware attached to the system, including all processors and I/O subsystems, as well as any storage devices. It then looks for the compressed initrd image in a predetermined location in memory, decompresses it, mounts it, and loads all necessary drivers. Next it initializes file system-related virtual devices, such as LVM or software RAID before unmounting the initrd disk image and freeing up all the memory it once occupied.

After the kernel has initialized all the devices on the system, it creates a root device, mounts the root partition read-only, and frees unused memory.

At this point, with the kernel loaded into memory and operational. However, with no user applications to give the user the ability to provide meaningful input to the system, not much can be done with it.

To set up the user environment, the kernel starts the /sbin/init command.

SBDavid

Some common Linux kernel processes

Some common Linux kernel processes

kjournald Commits ext3 journal updates to disk
kswapd Swaps processes when physical memory is low
kreclaimd Reclaims memory pages that haven’t been used recently
ksoftirqd Handles multiple layers of soft interrupts
khubd Configures USB devices

There is one kjournald for each mounted ext3 filesystem.

Among these processes, only init is really a full-fledged user process. The others are actually portions of the kernel that have been dressed up to look like processes for scheduling or architectural reasons.

Next »