Posts

Showing posts with the label Kernel

Compiling and installing latest kernel from source on RHEL or CentOS 7

Image
Compile and install latest kernel from source on RHEL or CentOS 7 OS ... In this blog i will show you, how you can compile and install latest kernel from source on RHEL 7 Or CentOS 7 Operating system. Check currently installed kernel version : # uname -r 3.10.0-957.el7.x86_64 As you can see current kernel version is 3.10, but i want to upgrade it to the latest stable available version, which you can find on  https://www.kernel.org/  official website. As of today current stable available version is "5.0.5" To download this "5.0.5" kernel source, you can click either the big Yellow download button or you can click on the "tarball" link as shown in above screenshot. You can also download this version from below link: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.0.5.tar.xz Step 1 : Install build tools and other mandatory dependencies which are needed to compile and install new kernel from source. Before you ins...

Linux Kernel Architecture

Image
A kernel is the core of an Operating System. It provides basic services for all other components of the OS. It is the main layer between the OS and hardware, and it helps with process and memory management, file systems, device control, and networking. Following is Linux  Kernel Architecture : User Space is the memory area where all user mode applications works and this memory can be swapped out when needed. Userspace process normally runs in its own virtual memory space and unless explicitly requested, cannot access the memory of other processes. Due to the protection afforded by this sort of isolation, crashes in user mode are always recoverable. Kernel Space is strictly reserved for running the kernel, OS background process, kernel extensions and device drivers. In Linux kernel space gives full access to the hardware, although some extensions runs in the user space. Crashes in kernel mode are catastrophic; they will halt the entire PC. These two modes are enforced...

Identifying major and minor numbers for a block device in Linux

One of the basic features of the Linux kernel is that it abstracts the handling of devices. All hardware devices look like regular files; they can be opened, closed, read and written using the same, standard, system calls that are used to manipulate files. Every device in the system is represented by a file. For block (disk) and character devices, these device files are created by the mknod command and they describe the device using major and minor device numbers. The kernel needs to be told how to access the device. Not only does the kernel need to be told what kind of device is being accessed but also any special information, such as the partition number if it's a hard disk or density if it's a floppy, for example. This is accomplished by the major number and minor number of that device. Major Numbers : All devices controlled by the same device driver have a common major device number. The major number is actually the offset into the kernel's device driver table, whi...

What are Udev, HAL, Dbus and Netlink ?

Image
Hot-plugging (which is the word used to describe the process of inserting devices into a running system) is achieved in a Linux distribution by a combination of three components: Udev, HAL, and Dbus . Udev is a userspace daemon, that supplies a dynamic device directory containing only the nodes for devices which are connected to the system. It creates or removes the device node files in the /dev directory as they are plugged in or taken out. Dbus is like a system bus which is used for inter-process communication. The HAL gets information from the Udev service, when a device is attached to the system and it creates an XML representation of that device. It then notifies the corresponding desktop application like Nautilus through the Dbus and Nautilus will open the mounted device files. Dbus is an IPC mechanism, which allows applications to register for system device events. Udev is the device manager for the Linux 2.6 kernel that creates/removes device nodes in...