Open In App

Kernel in Operating System

Last Updated : 21 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Kernel is central component of an operating system that manages operations of computer and hardware. It basically manages operations of memory and CPU time. It is core component of an operating system. Kernel acts as a bridge between applications and data processing performed at hardware level using inter-process communication and system calls. 

Kernel loads first into memory when an operating system is loaded and remains into memory until operating system is shut down again. It is responsible for various tasks such as disk management, task management, and memory management. 

 Kernel has a process table that keeps track of all active processes
• Process table contains a per process region table whose entry points to entries in region table.

 Kernel loads an executable file into memory during ‘exec’ system call’.

It decides which process should be allocated to processor to execute and which process should be kept in main memory to execute. It basically acts as an interface between user applications and hardware. The major aim of kernel is to manage communication between software i.e. user-level applications and hardware i.e., CPU and disk memory. 

Objectives of Kernel : 
 

  • To establish communication between user level application and hardware. 
  • To decide state of incoming processes.  
  • To control disk management.  
  • To control memory management. 
  • To control task management. 

Types of Kernel : 

1. Monolithic Kernel 

It is one of types of kernel where all operating system services operate in kernel space. It has dependencies between systems components. It has huge lines of code which is complex. 

Example: 

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

Advantage:
1. Efficiency: Monolithic kernels are generally faster than other types of kernels because they don’t have to switch between user and kernel modes for every system call, which can cause overhead.

2. Tight integration: Since all the operating system services are running in kernel space, they can communicate more efficiently with each other, making it easier to implement complex functionalities and optimizations.

3. Simplicity: Monolithic kernels are simpler to design, implement, and debug than other types of kernels because they have a unified structure that makes it easier to manage the code.

4. Lower latency: Monolithic kernels have lower latency than other types of kernels because system calls and interrupts can be handled directly by the kernel.

Disadvantage: 

1. Stability issues: Monolithic kernels can be less stable than other types of kernels because any bug or security vulnerability in a kernel service can affect the entire system.

2. Security vulnerabilities: Since all the operating system services are running in kernel space, any security vulnerability in one of the services can compromise the entire system.

3. Maintenance difficulties: Monolithic kernels can be more difficult to maintain than other types of kernels because any change in one of the services can affect the entire system.

4. Limited modularity: Monolithic kernels are less modular than other types of kernels because all the operating system services are tightly integrated into the kernel space. This makes it harder to add or remove functionality without affecting the entire system.
2. Micro Kernel 
It is kernel types which has minimalist approach. It has virtual memory and thread scheduling. It is more stable with less services in kernel space. It puts rest in user space. 

It is use in small os.

Example : 
 

Mach, L4, AmigaOS, Minix, K42 etc.

 

Advantages:

1. Reliability: Microkernel architecture is designed to be more reliable than monolithic kernels. Since most of the operating system services run outside the kernel space, any bug or security vulnerability in a service won’t affect the entire system.

2. Flexibility: Microkernel architecture is more flexible than monolithic kernels because it allows different operating system services to be added or removed without affecting the entire system.

3. Modularity: Microkernel architecture is more modular than monolithic kernels because each operating system service runs independently of the others. This makes it easier to maintain and debug the system.

4. Portability: Microkernel architecture is more portable than monolithic kernels because most of the operating system services run outside the kernel space. This makes it easier to port the operating system to different hardware architectures.

Disadvantages:

1. Performance: Microkernel architecture can be slower than monolithic kernels because it requires more context switches between user space and kernel space.

2. Complexity: Microkernel architecture can be more complex than monolithic kernels because it requires more communication and synchronization mechanisms between the different operating system services.

3. Development difficulty: Developing operating systems based on microkernel architecture can be more difficult than developing monolithic kernels because it requires more attention to detail in designing the communication and synchronization mechanisms between the different services.

4. Higher resource usage: Microkernel architecture can use more system resources, such as memory and CPU, than monolithic kernels because it requires more communication and synchronization mechanisms between the different operating system services.

3. Hybrid Kernel – 
It is the combination of both monolithic kernel and microkernel. It has speed and design of monolithic kernel and modularity and stability of microkernel. 

Example : 
 

Windows NT, Netware, BeOS etc.

Advantages:

1. Performance: Hybrid kernels can offer better performance than microkernels because they reduce the number of context switches required between user space and kernel space.

2. Reliability: Hybrid kernels can offer better reliability than monolithic kernels because they isolate drivers and other kernel components in separate protection domains.

3. Flexibility: Hybrid kernels can offer better flexibility than monolithic kernels because they allow different operating system services to be added or removed without affecting the entire system.

4. Compatibility: Hybrid kernels can be more compatible than microkernels because they can support a wider range of device drivers.

Disadvantages:

1. Complexity: Hybrid kernels can be more complex than monolithic kernels because they include both monolithic and microkernel components, which can make the design and implementation more difficult.

2. Security: Hybrid kernels can be less secure than microkernels because they have a larger attack surface due to the inclusion of monolithic components.

3. Maintenance: Hybrid kernels can be more difficult to maintain than microkernels because they have a more complex design and implementation.

4. Resource usage: Hybrid kernels can use more system resources than microkernels because they include both monolithic and microkernel components.

4. Exo Kernel – 
It is the type of kernel which follows end-to-end principle. It has fewest hardware abstractions as possible. It allocates physical resources to applications. 

Example : 
 

Nemesis, ExOS etc.

Advantages:

1. Flexibility: Exokernels offer the highest level of flexibility, allowing developers to customize and optimize the operating system for their specific application needs.

2. Performance: Exokernels are designed to provide better performance than traditional kernels because they eliminate unnecessary abstractions and allow applications to directly access hardware resources.

3. Security: Exokernels provide better security than traditional kernels because they allow for fine-grained control over the allocation of system resources, such as memory and CPU time.

4. Modularity: Exokernels are highly modular, allowing for the easy addition or removal of operating system services.

Disadvantages:

1. Complexity: Exokernels can be more complex to develop than traditional kernels because they require greater attention to detail and careful consideration of system resource allocation.

2. Development Difficulty: Developing applications for exokernels can be more difficult than for traditional kernels because applications must be written to directly access hardware resources.

3. Limited Support: Exokernels are still an emerging technology and may not have the same level of support and resources as traditional kernels.

4. Debugging Difficulty: Debugging applications and operating system services on exokernels can be more difficult than on traditional kernels because of the direct access to hardware resources.
 
5. Nano Kernel – 
It is the type of kernel that offers hardware abstraction but without system services. Micro Kernel also does not have system services therefore the Micro Kernel and Nano Kernel have become analogous. 

Example : 
 

EROS etc.

 Advantages:

1. Small size: Nanokernels are designed to be extremely small, providing only the most essential functions needed to run the system. This can make them more efficient and faster than other kernel types.

2. High modularity: Nanokernels are highly modular, allowing for the easy addition or removal of operating system services, making them more flexible and customizable than traditional monolithic kernels.

3. Security: Nanokernels provide better security than traditional kernels because they have a smaller attack surface and a reduced risk of errors or bugs in the code.

4. Portability: Nanokernels are designed to be highly portable, allowing them to run on a wide range of hardware architectures.

Disadvantages:

1. Limited functionality: Nanokernels provide only the most essential functions, making them unsuitable for more complex applications that require a broader range of services.

2. Complexity: Because nanokernels provide only essential functionality, they can be more complex to develop and maintain than other kernel types.

3. Performance: While nanokernels are designed for efficiency, their minimalist approach may not be able to provide the same level of performance as other kernel types in certain situations.

4. Compatibility: Because of their minimalist design, nanokernels may not be compatible with all hardware and software configurations, limiting their practical use in certain contexts.
 

 



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads