Architecture of Operating System

Learn via video courses
Topics Covered

Overview

The operating system provides an environment for the users to execute computer programs. Operating systems are already installed on the computers you buy for eg personal computers have windows, Linux, and macOS, mainframe computers have z/OS, z/VM, etc, and mobile phones have operating systems such as Android, and iOS. The architecture of an operating system consists of four major components hardware, kernel, shell, and application and we shall explore all of them in detail one by one.

Architecture of an Operating System

Highlights:

  • The operating system gives an environment for executing programs by the users.
  • Kernel is the most central part of the operating systems.
  • Software running on any operating system can be system software and application software. The operating system as we know is an intermediary and its functionalities include file management, memory management, process management, handling input and output, and peripheral devices as well. Highlights of os The operating system handles all of the above tasks for the system and application software. The architecture of an operating system is basically the design of its software and hardware components. Depending upon the tasks or programs we need to run users can use the operating system most suitable for that program/software. Architecture of os Before explaining various architectures of the operating systems, let's explore a few terms first which are part of the operating system.

1) Application: The application represents the software that a user is running on an operating system it can be either system or application software eg slack, sublime text editor, etc.

2) Shell: The shell represents software that provides an interface for the user where it serves to launch or start some program for which the user gives instructions.

It can be of two types first is a command line and another is a graphical user interface for eg: MS-DOS Shell, PowerShell, csh, ksh, etc.

3) Kernel: Kernel represents the most central and crucial part of the operating system where it is used for resource management i.e. it provides necessary I/O, processor, and memory to the application processes through inter-process communication mechanisms and system calls. Let's understand the various types of architectures of the operating system.

Types of Architectures of Operating System

Highlights:

  • Architectures of operating systems can be of four types monolithic, layered, microkernel, and hybrid.
  • Hybrid architecture is the combination of all architectures. There are major four major types of architectures of operating systems.

1) Monolithic Architecture

In monolithic architecture, each component of the operating system is contained in the kernel i.e. it is working in kernel space, and the components of the operating system communicate with each other using function calls. Monolithic Architecture Examples of this type of architecture are OS/360, VMX, and LINUX.

Advantages:

  1. The main advantage of having a monolithic architecture of the operating system is that it provides CPU scheduling, memory management, memory management, etc through system calls.
  2. In a single address space, the entire large process is running.
  3. It is a single static binary file.

Disadvantages:

  1. The main disadvantage is that all components are interdependent and when one of them fails the entire system fails.
  2. In case the user has to add a new service or functionality the entire operating system needs to be changed.

2) Layered architecture

In Layered architecture, components with similar functionalities are grouped to form a layer and in this way, total n+1 layers are constructed and counted from 0 to n where each layer has a different set of functionalities and services. Example: THE operating system, also Windows XP, and LINUX implements some level of layering.

The layers are implemented according to the following rule:

  1. Each layer can communicate with all of its lower layers but not with its upper layer i.e. any ith layer can communicate with all layers from 0 to i-1 but not with the i+1th layer.
  2. Each layer is designed in such a way that it will only need the functionalities that are present in itself or the layers below it.

There are 6 layers in layered architecture as shown below:

layers in layered architecture Let's explain the layers one by one

1) Hardware: This layer is the lowest layer in the layered operating system architecture, this layer is responsible for the coordination with peripheral devices such as keyboards, mice, scanners etc.

2) CPU scheduling: This layer is responsible for process scheduling, multiple queues are used for scheduling. Process entering the system are kept in the job queue while those which are ready to be executed are put into the ready queue. It manages the processes which are to be kept in the CPU and those which are to be kept out of the CPU.

3) Memory Management: This layer handles the aspect of memory management i.e. moving the processes from the secondary to primary memory for execution and vice-versa. There are memories like RAM and ROM. RAM is the memory where our processes run they are moved to the RAM for execution and when they exit they are removed from RAM.

4) Process Management: This layer is responsible for managing the various processes i.e. assigning the CPU to those processes on a priority basis for their execution. Process management uses many scheduling algorithms for prioritizing the processes for execution such as the Round-Robin algorithm, FCFS(First Come First Serve), SJF(Shortest Job First), etc.

5) I/O Buffer: Buffering is the temporary storage of data and I/O Buffer means that the data input is first buffered before storing it in the secondary memory. All I/O devices have buffers attached to them for the temporary storage of the input data because it cannot be stored directly in the secondary storage as the speed of the I/O devices is slow as compared to the processor.

6) User Programs: This is the application layer of the layered architecture of the operating system, it deals with all the application programs running eg games, browsers, words, etc. It is the highest layer of layered architecture.

Advantages:

1) Layered architecture of the operating system provides modularity because each layer is programmed to perform its own tasks only. 2) Since the layered architecture has independent components changing or updating one of them will not affect the other component or the entire operating system will not stop working, hence it is easy to debug and update. 3) The user can access the services of the hardware layer but cannot access the hardware layer itself because it is the innermost layer. 4) Each layer has its own functionalities and it is concerned with itself only and other layers are abstracted from it.

Disadvantages:

  1. Layered architecture is complex in implementation because one layer may use the services of the other layer and therefore, the layer using the services of another layer must be put below the other one.
  2. In a layered architecture, if one layer wants to communicate with another it has to send a request that goes through all layers in between which increases response time causing inefficiency in the system.

3) Microkernel Architecture

In this architecture, the components like process management, networking, file system interaction, and device management are executed outside the kernel while memory management and synchronization are executed inside the kernel. The processes inside the kernel have relatively high priority, the components possess high modularity hence even if one or more components fail the operating system keeps on working. Microkernel Architecture Example: Linux and Windows XP contain Modular components.

Advantages:

  1. Microkernel operating systems are modular and hence, disturbing one of the components will not affect the other component.
  2. The architecture is compact and isolated and hence relatively efficient.
  3. New features can be added without recompilation.

Disadvantages:

  1. Implementing drivers as procedures requires a function call or context switch.
  2. In microkernel architecture, providing services is costlier than monolithic operating systems.

4) Hybrid Architecture

Hybrid architecture as the name suggests consists of a hybrid of all the architectures explained so far and hence it has properties of all of those architectures which makes it highly useful in present-day operating systems.

The hybrid-architecture consists of three layers

1) Hardware abstraction layer: It is the interface between the kernel and hardware and is present at the lowest level.

2) Microkernel Layer: This is the old microkernel that we know and it consists of CPU scheduling, memory management, and inter-process communication.

3) Application Layer: It acts as an interface between the user and the microkernel. It contains functionalities like a file server, error detection, I/O device management, etc.

Hybrid Architecture Example: Microsoft Windows NT kernel implements a hybrid architecture of the operating system.

Advantages:

  1. Since it is a hybrid of other architectures it allows various architectures to provide their services respectively.
  2. It is easy to manage because it uses a layered approach.
  3. The number of layers is relatively lesser.
  4. Security and protection are relatively improved.

Disadvantage:

1)Hybrid architecture of the operating system keeps certain services in the kernel space while moving less critical services to the user space.

Don't miss out on the opportunity to become proficient in operating systems. Enroll in our Free Operating System Course and master the skills!

Conclusion

  • We conclude that the operating system has various architectures with which we can describe the functionality of various components.
  • The components of the operating system are process management, memory management, I/O management, Error Detection, and controlling peripheral devices.
  • These architectures include monolithic, layered, microkernel, and hybrid architectures classified on the basis of the structure of components.
  • Hybrid architecture is the most efficient and useful architecture as it implements the functionalities of all other architectures.
  • Hybrid architecture is better in terms of security as well.

FAQs

Q: How the Hybrid Architecture of Operating Systems is Better Than Other Architectures?

A: The hybrid architecture of operating systems as we know is a hybrid of other architectures like monolithic, layered, and microkernel architectures of operating systems so it has the functionalities of all of them. Since, we can see that hybrid architecture contains all the functionalities of monolithic, layered, and microkernel architecture, therefore it is better than all of them.

Q: What are the Key Differences Between Monolithic and Layered Architecture of Operating Systems?

A: The key differences between the monolithic and layered architecture of the operating system are:

  1. In the monolithic operating system the entire operating system functionalities operate in the kernel space while in layered architecture there are several layers where each layer has a specific set of functionalities.
  2. In the monolithic operating system there are mainly three layers while in a layered the number of layers is multiple.