Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
What is Operating System?
3.
Architecture of an (OS)Operating System
3.1.
Kernel
3.2.
Shell
3.3.
Central Processing Unit (CPU)
3.4.
Memory
3.5.
Inter-Process Communication
3.6.
Memory Management
4.
Different Types of Operating System Architecture
4.1.
Monolithic Architecture
4.1.1.
Advantages of Monolithic Architecture
4.1.2.
Disadvantages of Monolithic Architecture
4.1.3.
Examples of Monolithic-Based Operating Systems:
4.2.
Microkernel Architecture
4.2.1.
Also read - File management in operating system
4.2.2.
Advantages of Microkernel Architecture
4.2.3.
Disadvantages of Microkernel Architecture
4.2.4.
Examples of Microkernel-Based Operating Systems:
4.2.5.
Differences Between the Monolithic Kernel and Microkernel
4.3.
Hybrid Architecture
4.3.1.
Advantages of Hybrid Architecture
4.3.2.
Disadvantages of Hybrid Architecture
4.3.3.
Examples of Hybrid-Based Operating Systems
4.4.
Layered Architecture
4.4.1.
Advantages of Layered Architecture
4.4.2.
Disadvantages of Layered Architecture
4.4.3.
Examples of Layered-Based Operating Systems:
4.5.
Virtual Machine Architecture
4.5.1.
Advantages of Virtual Machine Architecture
4.5.2.
Disadvantages of Virtual Machine Architecture
4.5.3.
Examples of Virtual Machine-Based Operating Systems
5.
Frequently Asked Questions
5.1.
What is an operating system architecture?
5.2.
What is the role of the kernel in a layered architecture?
5.3.
What are the different types of Kernel?
5.4.
Which type of Kernel is used by Android?
5.5.
Is LINUX monolithic or layered?
5.6.
What is operating system architecture in Linux?
5.7.
What is the architecture of the DOS operating system?
6.
Conclusion
Last Updated: Apr 27, 2024
Medium

Operating System Architecture & Diagram

Author Vikash Kumar
1 upvote
Create a resume that lands you SDE interviews at MAANG
Speaker
Anubhav Sinha
SDE-2 @
12 Jun, 2024 @ 01:30 PM

Introduction

In this article, we will delve into the architecture of operating systems. We'll explore how these different designs impact the OS's performance, usability, and security and what considerations go into choosing the right architecture for a given system.

operating system architecture

What is Operating System?

The OS (Operating System) acts like a mediator between us and the computer hardware, providing us with an interface to execute programs quickly and efficiently.

An essential aspect of an operating system is its architecture, which refers to its different components' design and organization. These components include the CPU, memory management, file systems, device drivers, and user interface. The architecture determines how these components interact with each other and how they provide services to applications and users.

 

Before diving deep into the Operating System Architecture, let get familiar with some Operating system terminologies

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Architecture of an (OS)Operating System

Kernel

Kernel is the central component( core ) of the operating system. It plays a critical role in ensuring the stability and security of the system. The Kernel performs tasks like process and memory management, file systems, etc.

Kernel

Shell

In an operating system, a shell is a user interface( it can be a command line interface or graphical user interface ) that allows users to interact with the operating system by entering commands or running scripts. It acts like exposing the system services to the user and provides a more user-friendly interface.

Central Processing Unit (CPU)

A CPU is the primary component of a computer that performs most of the processing and calculations. It is also known as the "brain" of the computer and is responsible for executing instructions of the computer program.

Memory

Memory in a computer refers to the hardware components that store data, instructions, and information for the computer to access quickly. There are several types of memory in a computer, including:

  • RAM (Random Access Memory): It is the primary memory of a computer and is used to store data and instructions temporarily.
     
  • ROM (Read-Only Memory): A non-volatile memory stores essential instructions and data that the computer needs to access during startup.
     
  • Cache Memory: It is a type of high-speed memory that stores frequently accessed data and instructions to improve the computer's overall performance.
     
  • Virtual Memory: It is a memory management technique that uses hard disk space to extend RAM to improve the computer's performance.

Inter-Process Communication

The interaction of processes is referred to as interprocess communication. There are several threads in a process. Threads from any process interact with one another in the kernel space. Messages are sent and received via ports across threads. There are several ports at the kernel level, including process port, exceptional port, bootstrap port, and registered port. These ports all interact with user-space processes.

Memory Management

Memory management is assigning space in the main memory and managing different operations between the disk and main memory. However, there is also the creation of virtual memory for processes. Virtual memory means that if a process has a bigger size than the main memory, it is partitioned into portions and stored. After that, each part of the process is saved in the main memory one by one until the CPU executes it.

 Must Read Also - Memory hierarchy in computer network and Difference Between Bit and Byte

Different Types of Operating System Architecture

Operating systems are the backbone of modern computing devices, from smartphones to servers. However, not all operating systems are created equal, and different architectures of the operating system can significantly impact system performance, flexibility, and security. 

Here, we will explore different operating system architectures and discuss each architecture's fundamental design principles, advantages and disadvantages, and some examples of operating systems that use each approach.

Monolithic Architecture

A monolithic operating system architecture includes all system functionalities in a single module, with the kernel and device drivers as key components. In this architecture, the operating system as a whole is working in the kernel space. The kernel directly controls all the file, memory, device, and process management.

Monolithic Architecture

Advantages of Monolithic Architecture

  • Fast: Monolithic operating systems are fast. Thus, they provide better process scheduling, memory management, file management, etc.
     
  • Direct Interaction between Components: All the components and the kernel can directly interact. It also helps in gaining a better speed.
     
  • Easy and Simple: Its structure is easy and simple as all the components are located in the same address space.
     
  • Better for Smaller Tasks: Monolithic OS works better for handling smaller tasks.
     

Disadvantages of Monolithic Architecture

  • Prone to Errors: Monolithic OS can generate errors and bugs in the system. It is because user programs use the same address space as the kernel.
     
  • Difficult to Update: In a monolithic OS, all the OS code is in a single big chunk; therefore, it is difficult to add or remove features in the OS.
     
  • Not Portable: The code written in a monolithic OS is difficult to carry with or transfer to another system: this is because all the code works in a big chunk only, and you have to move it all.
     

Examples of Monolithic-Based Operating Systems:

  • Windows
  • Linux
  • MacOS

Microkernel Architecture

The microkernel architecture includes only the major functions like memory and process management in the kernel. In this architecture, file management and input-output management are included in the user space. 

Microkernel Architecture

Also read - File management in operating system

Advantages of Microkernel Architecture

  • Performance: Microkernel architecture is compact and isolated, it can perform better.
     
  • Security: Microkernels are safe since only those components are provided that would otherwise disturb the system’s functionality. 
     
  • Scalable: It is easily expandable as compared to a monolithic kernel. 
     
  • Modularity: Microkernels are modular, and the various modules can be swapped out, reloaded, and modified without affecting the Kernel.
    When compared to monolithic systems, there are fewer system crashes.The Microkernel interface aids in the implementation of a more modular system structure.
     

Disadvantages of Microkernel Architecture

  • Performance overhead: Performance overhead arises due to the need for inter-process communication between kernel modules. A context switch or a function call is required when the drivers are implemented as procedures or processes.
     
  • Limited hardware support: The microkernel architecture can be more difficult to port to new hardware platforms.
     
  • Higher cost: Compared to a monolithic system, providing services in a Microkernel system is costly.


Examples of Microkernel-Based Operating Systems:

  • MINIX
  • QNX
  • L4 microkernel
  • GNU Hurd

Differences Between the Monolithic Kernel and Microkernel

ParameterMonolithic KernelMicrokernel
System ServicesAll services, including device drivers, run in kernel space.Only essential services, such as scheduling and interprocess communication, run in kernel space. Device drivers run in user space.
CouplingFunctions are tightly coupled and share a common memory space.Functions are loosely coupled and communicate via message passing, incurring some overhead.
System CallsSystem calls are fast, but errors in one component can crash the entire system.System calls are slower due to message passing, but errors in one component do not necessarily crash the entire system.
SecurityLess secure because a bug or vulnerability in one component can affect the entire system.More secure because if one component is compromised, the damage is contained to that component.
ExamplesExamples include Linux, FreeBSD, and Windows.Examples include QNX, L4, and MINIX.

Also read - AMD vs Intel

Hybrid Architecture

Hybrid architecture is a combined approach of both microkernel and monolithic kernel architectures. It has a design like the monolithic kernel. It is fast, like the monolithic kernel. While it inherits the modularity and stability of microkernel architecture.

Hybrid architecture

Advantages of Hybrid Architecture

  • Flexibility: It is flexible to design a hybrid architecture.
     
  • Better performance: Hybrid architecture provides better performance as it has the features of both monolithic and microkernel architecture.
     
  • Improved security: The hybrid architecture improves system security by isolating critical services.
     
  • Greater hardware support: The hybrid architecture can provide greater hardware support than a pure microkernel architecture.
     

Disadvantages of Hybrid Architecture

  • Complexity: Including both monolithic and microkernel architecture increases complexity.
     
  • Higher cost: The hybrid architecture can be more expensive to develop than a pure microkernel architecture due to the need for more complex inter-process communication mechanisms.


Examples of Hybrid-Based Operating Systems

  • Windows NT
  • macOS
  • IBM AIX
  • Solaris

Layered Architecture

The Layered Structure of the Operating System is a way of organizing the different components of an OS into separate layers. Each layer is responsible for specific functions and interacts with the layer above and below it. The bottom layer is the hardware layer, followed by the kernel layer, system call interface, and shell layer. This structure helps in modularizing the OS and allows for easier maintenance, development, and debugging.

Layered Architecture

Advantages of Layered Architecture

  • Modularity: This architecture promotes modularity because each layer only does its assigned duties.
     
  • Easy debugging: It is relatively simple to debug because the layers are discrete. If a mistake happens in the CPU scheduling layer, the developer can only debug that layer, as opposed to a Monolithic system where all services are present at the same time.
     
  • Easy update: A change made to one layer will have no effect on the other layers.
     
  • No direct access to hardware: The hardware layer is the design's innermost layer. So, unlike the Simple system, where the user has direct access to the hardware, a user can use hardware services but not directly modify or access it. 
     
  • Abstraction: Every layer is focused on its own set of tasks. As a result, the other layers' functions and implementations are abstract.

Disadvantages of Layered Architecture

  • Complex and careful implementation: Because a layer can use the services of the levels below it, the layers must be carefully arranged. The memory management layer, for example, is used by the backup storage layer. As a result, it must be placed behind the memory management layer. As a result, significant modularity leads to complicated implementation.
     
  • Slower in execution: When a layer wishes to communicate with another layer, it sends a request that must travel through the layers between the two layers to be fulfilled. As a result, unlike the Monolithic system, which is faster, it increases response time. As an output, increasing the number of layers may result in an inefficient design.

Examples of Layered-Based Operating Systems:

  • UNIX
  • THEOS
  • VMS

Virtual Machine Architecture

The virtual machine architecture is a type of operating system architecture that runs multiple operating systems on a single physical machine. This approach provides flexibility and allows for efficient use of hardware resources, but it can also introduce overhead and complexity.

Virtual Machine Architecture

Advantages of Virtual Machine Architecture

  • Efficient Resource Utilization: Virtual machine architecture allows multiple operating systems to run concurrently on a single physical machine, improving hardware resource utilization.
     
  • Enhanced Security: This architecture provides greater security because every virtual machine is isolated from each other.
     
  • Easy Recovery: As this architecture uses virtual machines, recovery of the system is easy.
     

Disadvantages of Virtual Machine Architecture

  • Overhead: Virtual machine architecture introduces overhead due to the need for additional software layers, such as the hypervisor.
     
  • Workload: Depending on the workload, one virtual machine can be affected by other running virtual machines.
     
  • Complex Design: Virtual machine architecture can be complex to design and maintain due to the need for multiple layers of software. This can increase development time and maintenance costs.
     

Examples of Virtual Machine-Based Operating Systems

Frequently Asked Questions

What is an operating system architecture?

An operating system architecture refers to the fundamental structure and design principles of an operating system. It describes how the system manages hardware, memory, processes, and communication. It also manages the interaction between software and hardware components.

What is the role of the kernel in a layered architecture?

In a layered architecture, the kernel provides a core set of services, such as memory management and process scheduling, to the layer above it.

What are the different types of Kernel?

There are basically five types of Kernels: Monolithic Kernel, MicroKernel, Hybrid Kernel, Nano Kernel, Exo Kernel.

Which type of Kernel is used by Android?

Android Operating System, widely used in smartphones, is based on the Linux Kernel, which uses a monolithic type of Kernel. The Linux kernel provides the necessary low-level hardware abstraction layer and device drivers for Android to run on a wide variety of hardware platforms.

Is LINUX monolithic or layered?

Linux and other UNIX systems are considered monolithic kernels. It is because all the functionalities are compiled into one big chunk of code. In a monolithic kernel, all operating system services, such as device drivers, file system management, and process management, run in the same address space as the kernel.

What is operating system architecture in Linux?

The architecture of the Linux operating system consists of the Kernel, system library, system, hardware layer, and shell utility. The kernel of Linux is monolithic, and the hardware layer includes peripheral devices like CPU, RAM, HDD, etc.

What is the architecture of the DOS operating system?

DOS, or Disk Operating System, follows a simple architecture consisting of a kernel, command interpreter (COMMAND.COM), and various utility programs. It interacts directly with hardware, lacking the multitasking and memory protection features of modern operating systems.

Conclusion

In this article, we discussed the architecture of operating systems and its different types of it. We discussed all these types of operating systems' advantages and disadvantages and example operating systems.

Check out other related articles to learn more: 

 

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc. You can also consider our Operating System Course to give your career an edge over others.

Happy Coding!

Previous article
Synchronization Hardware in OS
Next article
Nix Operating System
Live masterclass