Table of content

Kernel Architecture

The kernel is the main component of most computer operating systems. It acts as a bridge between the applications and the actual data processing done at the hardware level. The kernel runs once when the booting process of the computer starts.

The kernel is a simple program inside the OS that is responsible for setting the memory, abstracting the hardware, schedules, and runs the process.

In simple terms, it acts as a mediator between the program and the hardware.

Tasks performed by the kernel
  • Performs memory management for all the running programs.
  • Manages the time slices of the processor's cycles
  • Provides a portable interface for the programs to interact with the hardware components.
Kernel components
  • Device drivers : Devices are the controllers that take input from the kernel.
  • Process Management: It controls the process and the address space they have access to. It allocates the time slices for the process and also performs interprocess communication.
  • Memory Management: It controls the virtual memory address allocation
  • File system control and structuring : A group of files maintained in order is called a s file structure. All the file structure is controlled by the kernel. In Linux when you access the files the kernel is used.
  • Networking : When any appl9ication requires a network. Those requests and authentication process are done internally by the kernel.
Types of Kernel Architecture

1. Monolithic Kernel

In this type of kernel, all operating system services operate in kernel space. It has huge lines of code which is complex.

Example :

Unix, Linux, Open VMS, XTS-400, etc.

  • Advantage :
    It has good performance.
  • Disadvantage :
    It has dependencies between system components and lines of code in millions.

2. MicroKernel –

In this type of kernel, there is virtual memory and thread scheduling. It has fewer services in the kernel space and fewer services in the userspace.

Example :

Mach, L4, AmigaOS, Minix, K42 etc.

  • Advantage :
    It is more stable.
  • Disadvantage :
    There are lots of system calls and context switches.

3. Hybrid Kernel –

It is the combination of both monolithic kernel and microkernel. It has the stability and the speed compared to the monolithic and microkernel.

Example :

Windows NT, Netware, BeOS, etc.

  • Advantage :
    It combines both monolithic kernel and microkernel.
  • Disadvantage :
    It is still similar to a monolithic kernel.

4. Exo Kernel –

This type of kernel follows the end-to-end principle. It allocates physical resources to the applications.

Example :

Nemesis, ExOS, etc.

  • Advantage :
    It has the fewest hardware abstractions.
  • Disadvantage :
    There is more work for application developers.

5. Nano Kernel –

It is the type of kernel that offers hardware abstraction but without system services.

Example :

EROS etc.

  • Advantage :
    It offers hardware abstractions without system services.
  • Disadvantage :
    It is quite the same as Microkernel hence it is less used.

System Run Levels

A run level is a current condition of an operating system. Each of the run levels is represented by a single digit. The default run level is 5

Main Run levels are :

  • 0: Shutdown or halt system.
  • 1: Single user mode.
  • 6 : Reboot system.

Other Run levels are :

  • 2: Multiuser mode without networking.
  • 3 : Multiuser mode with networking
  • 5 : Multiuser mode with networking and GUI.

To run a system level for example 0, the command is:

init 0

To get the current run level of the system, the command is:

who -r

linux-runlevel

Linux Boot Process (Newer Versions)

The boot process sequence changes for CentOS/Redhat 7 and above. The service manager systemd controls the boot process in the CentOS/Redhat 7. It is backward compatible with SysV init scripts used by prior versions of Redhat Linux with Redhat 6.

It is very important to know the boot process to troubleshoot quickly.

Linux Boot Process consists of the following steps one by one :

linux-bootprocessstep

The message of the Day

The message of the day is the first message to be displayed once we login into the Linux system. The message of the day file location is in /etc/motd.

To set the message, run the command:

vi /etc/motd

Once the editor opens, move to the insert mode and type the message.

Save and quit.

:wq!

Once we login into the system again the message gets displayed.

Customize Message of the Day

To customize the message of the day follows the steps:

  • Become root with the command:
    su -​
  • Create a file /etc/profile.d/motd.sh, with the command:
    vi /etc/profile.d/motd.sh​
  • Add the content inside the file.
    #!/bin/bash
    #
    echo -e "
    ##################################
    #
    # Welcome to `hostname`
    # This system is running `cat /etc/redhat-release`
    # kernel is `uname -r`
    #
    "​
  • Edit the content of the file /etc/ssh.sshd_config with the command:
    vi /etc/ssh.sshd_config​
  • As the vi editor opens, search for the /PrintMotd and set the parameter:
    PrintMotd no​
  • Save and quit.
    :wq!​
  • Restart the sshd service, with the command:
    systemctl restart sshd.service​
  • Log in to the system and the message shall appear.
    linux-message
About Author :

Myself Debomita Bhattacharjee, an IT employee with 6+ years of experience in Software industry. My area of interest is Automation testing and Front End Development.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions