Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

DISTRIBUTED SYSTEMS (CS 3006)

National Institute of Technology Rourkela


Difference between Microkernel and Monolithic Kernel
What is a kernel ?
The kernel is a computer program at the core of a computer’s operating system
and has complete control over everything in the system.

It manages the operations of the computer and the hardware.


A kernel is an important part of an OS that manages system resources.

Acts as a bridge between the software and hardware of the computer.


One of the first program which is loaded on start-up after the bootloader.

Responsible for offering secure access to the machine’s hardware for various
programs.
Decides when and how long a certain application uses specific hardware.
2
Difference between Microkernel and Monolithic Kernel
There are five types of kernels :

 A micro kernel, which only contains basic functionality


 OTOH, BeOS and QNX are microkernel based and are very fast.
 A monolithic kernel, which contains many device drivers

 Hybrid Kernel:
 A combination of microkernel and monolithic kernel architecture used in
DOS.
 This kernel approach combines the speed and simpler design of
monolithic kernel with the modularity and execution safety of
microkernel.

3
Exokernel:
 is an OS kernel developed by the MIT Parallel and Distributed Operating Systems
group, and also a class of similar operating systems.

 Main Idea: Reduce the level of abstractions provided by OSs and allow application
level management of hardware resources as much as possible.

 This gives the power to application developers to declare their own levels of
abstractions and manage the hardware.

 The exokernel architecture is designed to separate resource protection from


management to facilitate application-specific customization.

 Abstractions: file systems for disk storage, virtual address spaces for memory,
schedulers for task management, and sockets for network communication.

 These abstractions of the hardware make it easier to write programs in general, but
limit performance and stifle experimentation in new abstractions. 4
Nanokernel
 A small kernel that offers hardware abstraction, but without system services.

 Larger kernels are designed to offer more features and manage more
hardware abstraction.

 Modern microkernels lack system services as well, hence, the terms


microkernal and nanokernal have become analogous.

 A kernel where the total amount of kernel code, i.e. code executing in the
privileged mode of the hardware, is very small.

 Why microkernels are slower than monolithic kernel?


 What is a Picokernel?
5
Microkernel
Microkernel:
Microkernel is a software or code which contains the required minimum amount of functions,
data, and features to implement an operating system.
Provides a minimal number of mechanisms to run the most basic functions of an OS.
Allows other parts of the OS to be implemented as it does not impose a lot of policies.

The user services and kernel services are implemented in different address space. The user
services are kept in user address space, and kernel services are kept under kernel address
space.

Microkernels and their user environments are usually implemented in the C++ or C
programming languages with a little bit of assembly.

However, other implementation languages are possible with some high-level coding.
6
Monolithic Kernel
The entire OS runs as a single program in kernel mode.

The user & kernel services are implemented in same address space.

Runs all the basic system services like Process management, Memory
management, I/O communication, and interrupt handling, file system,
etc in kernel space.

The OS is written as a collection of procedures that are linked together


into a large executable binary program.
Two copies are required in monolithic kernel
MICROKERNEL MONOLITHIC KERNEL

User services and kernel services are kept in separate Both user services and kernel services are kept in the
address space. same address space.

OS is complex to design. OS is easy to design and implement.

Microkernel are smaller in size. Monolithic kernel is larger than microkernel.

Easier to add new functionalities. Difficult to add new functionalities.

To design a microkernel, more code is required. Less code when compared to microkernel

Failure of one component does not effect the working Failure of one component in monolithic kernel leads to
of micro kernel. failure of entire system.

Execution speed is low. Execution speed is high.

It is easy to extend Microkernel. It is not easy to extend monolithic kernel.

8
Parameters Monolithic kernel MicroKernel
It can be broken down into
It is a large process running
Basic separate processes called
in a single address space
servers.
In order to write a In order to write a
Code monolithic kernel, less code microkernel, more code is
is required. required
If a service crashes, the If a service crashes, it never
Security whole system collapses in a affects the working of a
monolithic kernel. microkernel.
It is a single static binary Servers communicate
Communication
file through IPC.
Linux, BSDs, Microsoft
Windows (95,98, Me), L4Linux, QNX, SymbianK42,
Example
Solaris, OS-9, AIX, DOS, Mac OS X, Integrity, etc.
XTS-400, etc.
9
Monolithic Architecture
is like a big container, wherein all the software components of an app are
assembled and tightly coupled, i.e., each component fully depends on each
other.
Let’s take an example of an e-commerce site-
All the services provided by the application
(Customer Services, Cost Services, Product
Services) are directly connected.

If we want to change in code or something we


have to change in all the services as well.

10
11
Click to add text

12
Monolithic Kernel System

13
14
Disadvantages
Large and Complex Applications: It is difficult for maintenance because they are
dependent on each other.
Slow Development: It is because, for modify an application we have to redeploy
whole application instead of updates part. It takes more time or slow
development.
Unscalable: Each copy of the application will access the hole data which make
more memory consumption. We cannot scale each component independently.
Unreliable: If one services goes down, then it affects all the services provided by
the application. It is because all services of applications are connected to each
other.
Inflexible:Really difficult to adopt new technology.It is because we have to change
hole application technology.
What is the reason for not preferring monolithic architectures in recent times ?
15
Microkernel Architectures

Microkernel fulfills basic operations like memory, process scheduling mechanisms, and inter-
16
process communication.
Advantages of Microkernel
Microkernel architecture is small and isolated therefore it can function better.
Microkernels are secure because only those components are included that disrupt the
functionality of the system otherwise.
The expansion of the system is more accessible, so it can be added to the system application
without disturbing the Kernel.
Microkernels are modular, and the different modules can be replaced, reloaded, modified
without even touching the Kernel.
Fewer system crashes when compared with monolithic systems.
Microkernel interface helps you to enforce a more modular system structure.
Without recompiling, add new features
Server malfunction is also isolated as any other user program’s malfunction.
Microkernel system is flexible, so different strategies and APIs, implemented by different
servers, which can coexist in the system.
Increased security and stability will result in a decreased amount of code which runs on kernel
mode
17
Disadvantage of Microkernel
Providing services in a microkernel system are expensive compared to the
normal monolithic system.

Context switch or a function call needed when the drivers are implemented as
procedures or processes, respectively.

The performance of a microkernel system can be indifferent and may lead to


some problems.

Disadvantages are less as compared to advantages

18
Basis of Comparison Monolithic Kernel MicroKernel

Only the most important


All processes are executed under the processes take place in the Kernel
Execution Style
kernel space in privileged mode. space. All other processes are
executed in the user space.
Kernel size is bigger when compared to Kernel size is smaller with respect
Size
Microkernel. to the monolithic kernel.
Speed It provides faster execution of processes. Process execution is slower.
A single process crash will cause the A single process crash will have
Stability
entire system to crash. no impact on other processes.
Use signals and sockets to achieve Use messaging queues to achieve
Inter-Process Communication
interprocess communication. inter-process communication.
Extensibility Difficult to extend. Easily extensible.
Maintenance is more time and resource
Maintainability Easily maintainable
consuming.
Debug
Security
Harder to debug
Less Secure.
Easier to debug
More Secure
Example Linux Mac OS

19
Implementation Aspect of Microkernel Architectures

20
Implementation Aspect of Microkernel Architectures
1. Creation of Plug-in Modules

2. Creating Contracts

3. Identify the deployment type (Single/Distributed)

4. Identification of Plug-in Modules by the Core System

5. Connecting the Plug-in Modules to the Core System through contracts

21
Implementation Aspect of Microkernel Architectures
The plug-in modules are stand-alone, independent components that contain
specialized processing, additional features, and custom code that is meant to
enhance or extend the core system to produce additional business capabilities.

Plug-in modules should be independent of other plug-in modules, but you can
certainly design plug-ins that require other plug-ins to be present.

It is important to keep the communication between plug-ins to a minimum to


avoid dependency issues.

The core system needs to know about which plug-in modules are available and
how to get to them.

22
Implementation Aspect of Microkernel Architectures
Using Plug-in Registry.

This registry contains information about each plug-in module, including things
like its name, data contract, and remote access protocol details (depending on
how the plug-in is connected to the core system).

Example:
A plug-in for tax software that flags high-risk tax audit items might have a
registry entry that contains the name of the service (AuditChecker), the data
contract (input data and output data), and the contract format (XML).

It might also contain a WSDL (Web Services Definition Language) if the plug-in
is accessed through SOAP.
23
Implementation …
Plug-in modules can be connected to the core system through a variety of ways, including
OSGi (open service gateway initiative), messaging, web services, or even direct point-to-
point binding (i.e., object instantiation).

The type of connection depends on the type of application you are building (small product or
large business application) and your specific needs (e.g., single deploy or distributed
deployment).

24
Implementation …
The architecture pattern itself does not specify the implementation details, only that the
plug-in modules must remain independent from one another.

The contracts between the plug-in modules and the core system can range anywhere from
standard contracts to custom ones.

Custom contracts: Plug-in components are developed by a third party where you have no
control over the contract used by the plug-in. In such cases, it is common to create an
adapter between the plug-in contact and your standard contract so that the core system
doesn’t need specialized code for each plug-in.

When creating standard contracts (usually implemented through XML or a Java Map), it is
important to remember to create a versioning strategy right from the start.

25
Examples of Microkernel Architectures
1. Eclipse IDE

Downloading the basic Eclipse product provides little more than a fancy editor.

Once you start adding plug-ins, it becomes a highly customizable and useful product.

2. Internet browsers

A common product example using the microkernel architecture: viewers and other plug-ins add additional
capabilities that are not otherwise found in the basic browser (i.e., core system).

26
Plug-in Architecture

There should be a well-defined interface between the core and the plugins.
27
Application of Micro-kernel Architecture: Data
Pipelining

28
Different types of data (JSON(JavaScript Object Notation)/CSV(Comma
Separated Values Format)
A JSON file by default is larger and takes more time to parse compared to CSV.
… data sources (HTTP endpoint, AWS CloudWatch, sensor devices)

… data storage (in-memory, NoSQL, relational, file/object storage)

… data processing (Lambda functions, Spark, Hive, Kensis Analytics)

… consumers (Lambda function, S3, emails, Slack, visualization tools).

29
Thank
You

30

You might also like