What is meant by kernel in OS?

Anyone who uses technologies with an operating system is working with a kernel, though often without realizing it. The kernel organizes processes and data in every computer. It serves as the core of an operating system and the interface between software and hardware. This means that the kernel is in constant use and is a key component of an operating system.

The kernel not only serves as the core of the system but is also a program that controls all processor and memory access. It is responsible for the most important drivers and has direct access to the hardware. It’s the basis for interactions between hardware and software and manages their resources as efficiently as possible.

Contents

  1. What is a kernel?
    1. Structure of a kernel
    2. Process
    3. What is a kernel in a computer program?
  2. What are the kernel’s tasks?
  3. How does a kernel work?
  4. The kernel in the operating system
  5. What kind of kernels exist?
    1. What is an open source kernel?
    2. The three types of kernels

Hosting with IONOS — Fast, Flexible, Secure

Discover fast and secure hosting for any project.
We've got your code covered, whether you're on the backend,
frontend, or the frontlines.

Scalable

Secure

Sustainable

What is a kernel?

The kernel is the heart of the operating system and controls all the important functions of hardware – this is the case for Linux, macOS and Windows, smartphones, servers, and virtualizations like KVM as well as every other type of computer.

Structure of a kernel

A kernel is always built the same way and consists of several layers:

  • The deepest layer is the interface with hardware [processors, memory, and devices], which manages network controllers and PCI express controllers, for example.
  • On top of that is the memory management, which entails distributing RAM including the virtual main memory.
  • Then comes process management [scheduler], which is responsible for time management and makes multitasking possible.
  • The next layer contains device management.
  • The highest layer is the file system. That’s where processes are assigned to RAM or the hard drive.

Process

A kernel is central to all layers, from system hardware to application software. Its work ends where user access begins: at the Graphical User Interface [GUI]. The kernel thus borders on the shell [that is, the user interface]. You can picture the kernel as a seed or pit and the shell as the fruit that surrounds the pit.

What is a kernel in a computer program?

Think of the kernel in this context like a colonel: They both pass along commands. A program sends “system calls” to the kernel, for example when a file is written. The kernel, well-versed in the instruction set of the CPU, then translates the system call into machine language and forwards it to the CPU. All of this usually happens in the background, without the user noticing.

What are the kernel’s tasks?

The main task of the kernel is to multitask. This requires keeping up with time constraints and remaining open to other applications and expansions.

For every rule there are exceptions in such a lean, well-functioning system as an operating system. That’s why the kernel only serves as a go-between when it comes to system software, libraries, and application software. In Linux, the graphic interface is independent from the kernel.

Note

In multi-user systems, the kernel also monitors access rights to files and hardware components. The Task Manager shows what those are at any given time. If a process is finished by the user, the Task Manager gives the kernel instructions for stopping the process and freeing the memory that was used for it.

When a computer powers up, the kernel is the first thing that’s loaded into the RAM. This happens in a protected area, the bootloader, so that the kernel can’t be changed or deleted.

Afterwards, the kernel initializes the connected devices and starts the first processes. System services are loaded, other processes are started or stopped, and user programs and memory allocation are initiated.

How does a kernel work?

This question is best answered by countering: What is a kernel not? The kernel is not the core of a processor, it’s the core of the operating system. A kernel is also not an API or framework.

Multikernel operating systems can use various cores of a multicore processor like a network of independent CPUs. How does that work? It comes down to the special structure of the kernel, which is composed of a series of different components:

  • Since the kernel’s lowest layer is machine oriented, it can communicate directly with the hardware, processor, and memory. The functions of the kernel vary among its five layers, from processor management to device management. The highest layer cannot access machines, and instead is responsible for interfacing with software.
  • Application programs run separately from the kernel in the operating system and merely draw on its functions. Without the kernel, communication between programs and hardware wouldn’t be possible.
  • Several processes can run simultaneously thanks to the multitasking kernel. But it’s generally the case that only one action can be processed by the CPU at one time – unless you’re using a multicore system. The rapid change in processes that gives the impression of multitasking is taken care of by the scheduler.

From these components follow the four functions of the kernel:

  1. Memory management: Regulates how much memory is used in different places.
  2. Process management: Determines which processes the CPU can use, as well as when and how long they’re used for.
  3. Device driver: Intermediates between hardware and processes.
  4. System calls and security: Receives service requests from the processes.

When implemented properly, the functions of the kernel are invisible to users. The kernel works in its own setting, the kernel space. On the other hand, files, programs, games, browsers, and everything that the user sees are located in the user space. Interaction between these two use the system call interface [SCI].

The kernel in the operating system

To understand the function of the kernel in the operating system, imagine the computer as divided into three levels:

  1. Hardware: The foundation of the system, made up of RAM, the processor and input and output devices. The CPU carries out reading and writing operations and calculations for the memory.
  2. Kernel: The nucleus of the operating system in contact with the CPU.
  3. User processes: All running processes that the kernel manages. The kernel makes communication between processes and servers possible, also known as Inter-Process Communication [IPC].

There are two modes for the code in a system: kernel mode and user mode. The code in kernel mode has unlimited access to the hardware, whereas in user mode access is limited to the SCI. If there’s an error in user mode, not much happens. The kernel will intervene and repair any potential damage. On the other hand, a kernel crash can cause the entire system to crash. This is, however, unlikely due to the security measures in place.

What kind of kernels exist?

One type of kernel previously described is the multitasking kernel that describes several processes running simultaneously on one kernel. If you add access management to it, you’ll have a multiuser system, on which several users can work at the same time. The kernel is responsible for authentication, as it can allot or separate called processes.

What is an open source kernel?

Linux maintains a comprehensive archive on its kernel. Apple has published the kernel types for all of its operating systems for open source access. Microsoft also uses a Linux kernel for the Windows subsystem for Linux.

Note

It’s easy to lose track of the different kernel types. Linux systems and Android devices use a Linux kernel. Windows uses the NT kernel, which various subsystems draw on. Apple uses the XNU kernel.

The three types of kernels

There are various types of kernels that are used across different operating systems and end devices. They can be sorted into three groups:

  1. Monolithic kernels: A large kernel for various tasks. It’s responsible for memory and process management as well as communication between processes and offers functions for driver and hardware support. This is the kernel in operating systems like Linux, OS X, and Windows.
  2. Microkernel: The microkernel is deliberately small, so that errors and crashes don’t affect the entire operating system. To ensure that it can still fulfill the same functions as a large kernel, it’s organized into several modules. The OS X component Mach serves as the only decent example, since up until now there aren’t any operating systems with microkernels.
  3. Hybrid kernel: A combination of microkernel and monolith. The large kernel is more compact and can be broken down into modules. Further kernel parts can be appended dynamically. They’re used in part by Linux and OS X.

Related articles

Hypervisor: an intermediary for visualization

Virtualizing is becoming more and more important: Its basic concept is that one imposes a virtual, abstract system onto an actual real system. Both software and hardware can be depicted in this way. In order to create a connection between the actual and the virtual system, one requires an additional layer – the hypervisor.

Hypervisor: an intermediary for visualization

csrss.exe: What’s behind the Client Server Runtime Process

What is csrss.exe? If you inspect the processes currently running on your Windows system, you’ll inevitably come across the csrss.exe process. Your system can’t run without it because it’s responsible for important tasks such as launching processes. If you suspect that the file might be a virus, it’s a good idea to inspect whether it’s the genuine csrss.exe file. But can you spot the difference?

csrss.exe: What’s behind the Client Server Runtime Process

SMR [Shingled Magnetic Recording] increases storage density

When you save data to a hard drive, it is written to tracks on magnetic platters. On conventional hard drives these tracks are completely separate, but with Shingled Magnetic Recording, they partly overlap one another. This means that SMR allows you to store more data per inch. Read on to find out more about this new hard drive technology and its implications.

SMR [Shingled Magnetic Recording] increases storage density

WSL2: meet the Windows Subsystem for Linux 2

WSL2, which was released in early 2020, is the development of a Windows Subsystem for Linux. Instead of a compatibility layer, WSL2 relies on the virtualization of a complete Linux kernel. This means that even complex applications such as Docker can be operated in the Linux environment. We’ll explain the similarities and differences of this to the previous version and show how to use WSL2.

WSL2: meet the Windows Subsystem for Linux 2

What is kernel in OS with example?

It is the core that provides basic services for all other parts of the OS. It is the main layer between the OS and underlying computer hardware, and it helps with tasks such as process and memory management, file systems, device control and networking.

What's meant by kernel?

Definition of kernel 1 : the inner softer part of a seed, fruit stone, or nut … as brown in hue as hazelnuts, and sweeter than the kernels.— William Shakespeare. 2 : a whole seed of a cereal a kernel of corn. 3 : a central or essential part : germ like many stereotypes …

Why OS is called kernel?

It is the primary interface between the hardware and the processes of a computer. The kernel connects these two in order to adjust resources as effectively as possible. It is named a kernel because it operates inside the OS, just like a seed inside a hard shell.

What are 5 types of kernel?

Types of Kernel :.
Monolithic Kernel – It is one of types of kernel where all operating system services operate in kernel space. ... .
Micro Kernel – It is kernel types which has minimalist approach. ... .
Hybrid Kernel – It is the combination of both monolithic kernel and microkernel. ... .
Exo Kernel – ... .
Nano Kernel –.

Chủ Đề