Skip to main content

Layered Operating System

 

Layered Operating System

Layered Structure is a type of system structure in which the different services of the operating system are split into various layers, where each layer has a specific well-defined task to perform. It was created to improve the pre-existing structures like the Monolithic structure ( UNIX ) and the Simple structure ( MS-DOS ).

Example – The Windows NT operating system uses this layered approach as a part of it.

Design Analysis :
The whole Operating System is separated into several layers ( from 0 to n ) as the diagram shows. Each of the layers must have its own specific function to perform. There are some rules in the implementation of the layers as follows.

  1. The outermost layer must be the User Interface layer.
  2. The innermost layer must be the Hardware layer.
  3. A particular layer can access all the layers present below it but it cannot access the layers present above it. That is layer n-1 can access all the layers from n-2 to 0 but it cannot access the nth layer.

Thus if the user layer wants to interact with the hardware layer, the response will be traveled through all the layers from n-1 to 1. Each layer must be designed and implemented such that it will need only the services provided by the layers below it.

Layered OS Design

1. Monolithic architecture

2.    Layerd archtecture.

3.     Virtual machine architecture

4.     Exokernel architecture

5.    Client server architecture 

6.     Micro kernel architecture

Advantages :
There are several advantages to this design :

  1. Modularity :
    This design promotes modularity as each layer performs only the tasks it is scheduled to perform.
  2. Easy debugging :
    As the layers are discrete so it is very easy to debug. Suppose an error occurs in the CPU scheduling layer, so the developer can only search that particular layer to debug, unlike the Monolithic system in which all the services are present together.
  3. Easy update :
    A modification made in a particular layer will not affect the other layers.
  4. No direct access to hardware :
    The hardware layer is the innermost layer present in the design. So a user can use the services of hardware but cannot directly modify or access it, unlike the Simple system in which the user had direct access to the hardware.
  5. Abstraction :
    Every layer is concerned with its own functions. So the functions and implementations of the other layers are abstract to it.

Disadvantages :
Though this system has several advantages over the Monolithic and Simple design, there are also some disadvantages as follows.

  1. Complex and careful implementation :
    As a layer can access the services of the layers below it, so the arrangement of the layers must be done carefully. For example, the backing storage layer uses the services of the memory management layer. So it must be kept below the memory management layer. Thus with great modularity comes complex implementation.
  2. Slower in execution :
    If a layer wants to interact with another layer, it sends a request that has to travel through all the layers present in between the two interacting layers. Thus it increases response time, unlike the Monolithic system which is faster than this. Thus an increase in the number of layers may lead to a very inefficient design.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.


Comments

Popular posts from this blog

Multi Level Queue Scheduling (MLQ)

  Multi Level Queue Scheduling (MLQ) ·          Multilevel queue scheduling classifies the processes according to their types for example, a multilevel queue scheduling algorithm makes a common. ·          In this scheduling ready queue is divided into various queue that are called sub queues. A subqueue is a distinct operational queue ·          The process are permanently assigned to subqueues, generally based on some property of the process such as memory size,priority or process type ·          Each subqueue has its process sucheduling algorithm. For example interactive process at the foreground may use round robin scheduling while batch jobs at the background may use the FCFS method ·          For example, consider a system with four different queues 1.   ...

Micro kernel architecture

  Micro kernel  architecture What is Kernel? A kernel is an important part of an OS that manages system resources. It also acts as a bridge between the software and hardware of the computer. It is one of the first program which is loaded on start-up after the bootloader. The Kernel is also responsible for offering secure access to the machine's hardware for various programs. It also decides when and how long a certain application uses specific hardware. What is Microkernel? Microkernel  is a software or code which contains the required minimum amount of functions, data, and features to implement an operating system. It provides a minimal number of mechanisms, which is good enough to run the most basic functions of an operating system. It allows other parts of the operating system to be implemented as it does not impose a lot of policies. Microkernels and their user environments are usually implemented in the C++ or C programming languages with a little bit of assembly. Ho...

Exokernel architecture

Exokernel architecture Most of us know what kernels are and how do they work to make programmers’ lives easier. But, how many of us know what exokernels are? I hope you will be able to get a brief introduction on this terminology through this blog. Let’s start with a brief introduction on kernel. What is a kernel? A kernel is the foundational layer of an operating system that functions at a basic level, communicating with hardware and managing resources, such as CPU and the memory. It works as an interface between the user application and the hardware. There   are two main types of kernel 1. Micro kernel 2. Monolithic Kernel 1.  Monolithic architecture 2.      Layerd archtecture . 3.       Virtual machine architecture 4.       Exokernel architecture 5.      Client server architecture   6.       Micro kernel architecture Now let’s head into our main focus. What is an Exokern...

Shortest Job First Scheduling (SJF)

  Shortest Job First Scheduling (SJF) ·          SJF ia also known as shortest-job-next(SJN) algorithm and is faster than FCFS. ·          In SJF, the process with the least estimated execution time is selected from the ready queue for   execution. ·          For this, SJF algorithm associates with each process, the length of its next CPU burst. When the CPU is available, it is assigned to the process that has the smallest next CPU burst. ·          If tow processes have the same length of next CPU burst ,FCFS scheduling algorithm is used to break the tie. ·          SJF algorithm can be preemptive or non-preemptive.     Non-preeptive SJF ·          In non-preemptive SJF, scheduling, CPU is always assigned to the ...

Monolithic Architecture

  Monolithic Architecture Monolith means composed all in one piece. The  Monolithic  application describes a single-tiered  software  application in which different components combined into a single program from a single platform. Components can be: Authorization — responsible for authorizing a user Presentation — responsible for handling HTTP requests and responding with either HTML or JSON/XML (for web services APIs). Business logic — the application’s business logic. Database layer — data access objects responsible for accessing the database. Application integration — integration with other services (e.g. via messaging or REST API). Or integration with any other Data sources. Notification module — responsible for sending email notifications whenever needed. Example for Monolithic Approach Consider an example of Ecommerce application, that authorizes customer, takes an order, check products inventory, authorize payment and ships ordered products. This applicat...