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

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...