Operating System Structure

Learn via video courses
Topics Covered

Operating System provides the medium for the user to communicate with the computer hardware. System software is installed on top of the operating system. Operating System structure is the basic model which is needed to implement Operating Systems. There are many types of structures, each having its own properties covered further.

This article defines the operating system structure and why it is used.

This article also covers different types of structures implementing Operating Systems as mentioned below.

  1. Simple Structure
  2. Monolithic Structure
  3. Layered Approach Structure
  4. Micro-kernel Structure

This article does not compare Operating system structures with other each other and their implementation.

Before reading this article, understand the following Operating System topic:

What is the Operating System Structure?

The operating system structure refers to the way in which the various components of an operating system are organized and interconnected. There are several different approaches to operating system structure, each with its own advantages and disadvantages.

An operating system has a complex structure, so we need a well-defined structure to assist us in applying it to our unique requirements. Just as we break down a big problem into smaller, easier-to-solve subproblems, designing an operating system in parts is a simpler approach to do it. And each section is an Operating System component. The approach of interconnecting and integrating multiple operating system components into the kernel can be described as an operating system structure. As mentioned below, various sorts of structures are used to implement operating systems.

Simple Structure

It is the simplest Operating System Structure and is not well defined; It can only be used for small and limited systems. In this structure, the interfaces and levels of functionality are well separated; hence programs can access I/O routines which can cause unauthorized access to I/O routines.

This structure is implemented in MS-DOS operating system:

  • The MS-DOS operating System is made up of various layers, each with its own set of functions.
  • These layers are:
    • Application Program
    • System Program
    • MS-DOS device drivers
    • ROM BIOS device drivers
  • Layering has an advantage in the MS-DOS operating system since all the levels can be defined separately and can interact with each other when needed.
  • It is easier to design, maintain, and update the system if it is made in layers. So that's why limited systems with less complexity can be constructed easily using Simple Structure.
  • If one user program fails, the entire operating system gets crashed.
  • The abstraction level in MS-DOS systems is low, so programs and I/O routines are visible to the end-user, so the user can have unauthorized access.

Layering in simple structure is shown below: Simple structure in Operating System

Advantages of Simple Structure

  • It is easy to develop because of the limited number of interfaces and layers.
  • Offers good performance due to lesser layers between hardware and applications.
  • Minimal overhead, suitable for resource-constrained environments.

Disadvantages of Simple Structure

  • If one user program fails, the entire operating system crashes.
  • Limited functionality.
  • Abstraction or data hiding is not present as layers are connected and communicate with each other.
  • Layers can access the processes going in the Operating System, which can lead to data modification and can cause Operating System to crash.

Monolithic Structure

The Monolithic operating System in which the kernel acts as a manager by managing all things like file management, memory management, device management, and operational processes of the Operating System.

The kernel is the heart of a computer operating system (OS). Kernel  delivers basic services to all other elements of the System. It serves as the primary interface between the Operating System and the hardware.

In monolithic systems, kernels can directly access all the resources of the operating System like physical hardware, exp Keyboard, Mouse etc.

The monolithic kernel is another name for the monolithic operating system. Batch processing and time-sharing maximize the usability of a processor by multiprogramming. The monolithic kernel functions as a virtual machine by working on top of the Operating System and controlling all hardware components. This is an outdated operating system that was used in banks to accomplish minor activities such as batch processing and time-sharing, which enables many people at various terminals to access the Operating System.

A Diagram of the Monolithic structure is shown below: Monolithic Structure in Operating System

Advantages of Monolithic structure:

  • It is simple to design and implement because all operations are managed by kernel only, and layering is not needed.
  • As services such as memory management, file management, process scheduling, etc., are implemented in the same address space, the execution of the monolithic kernel is relatively fast as compared to normal systems. Using the same address saves time for address allocation for new processes and makes it faster.
  • Simple design and implementation.

Disadvantages of Monolithic structure:

  • If any service in the monolithic kernel fails, the entire System fails because, in address space, the services are connected to each other and affect each other.
  • Lack of modularity makes maintenance and extensions difficult.
  • It is not flexible, and to introduce a new service

Micro-kernel Structure

Micro-Kernel structure designs the Operating System by removing all non-essential components of the kernel. These non-essential components of kernels are implemented as systems and user programs. Hence these implemented systems are called as Micro-Kernels.

Each Micro-Kernel is made independently and is isolated from other Micro-Kernels. So this makes the system more secure and reliable. If any Micro-Kernel fails, then the remaining operating System remains untouched and works fine.

Micro-Kernels in Operating System

Advantages of Micro-kernel structure:

  • It allows the operating system to be portable between platforms.
  • Enhanced system stability and security.
  • As each Micro-Kernel is isolated, it is safe and trustworthy.
  • Because Micro-Kernels are smaller, they can be successfully tested.
  • If any component or Micro-Kernel fails, the remaining operating System is unaffected and continues to function normally.

Disadvantages of Micro-kernel structure:

  • Increased inter-module communication reduces system performance.
  • System is complex to be constructed.
  • Complexity in managing user-space components.

Hybrid-Kernel Structure

A hybrid kernel structure combines elements of both monolithic and microkernel structures. The core of the hybrid kernel is a small microkernel that provides essential services, such as memory management, process scheduling, and inter-process communication (IPC). Other operating system services are implemented as modules that run in user space.

This approach aims to strike a balance between the performance advantages of a monolithic kernel and the stability and modularity benefits of a microkernel.

Advantages of Hybrid-Kernal Structure

  • Hybrid kernels can achieve good performance because frequently used services can be implemented as modules in user space, which avoids the overhead of system calls.
  • Hybrid kernels are more modular than monolithic kernels, which makes them easier to maintain and extend.
  • Hybrid kernels can be tailored to specific needs by adding or removing modules.
  • Hybrid kernels can be more secure than monolithic kernels because modules in user space are less likely to contain security vulnerabilities.

Disadvantages of Hybrid-Kernel Structure

  • Hybrid kernels can be more complex than monolithic kernels because they must manage the interaction between the microkernel and the modules in user space.
  • There is some performance overhead associated with IPC between the microkernel and the modules in user space.

Exo-Kernal Structure

An exokernel is a type of operating system kernel that provides only the most basic services, such as memory management and communication. All other services are provided by user-level processes. This makes exokernels highly modular and flexible, but also very complex to implement.

The exokernel structure is an alternative operating system design that is quite different from traditional monolithic or microkernel architectures. In an exokernel, the kernel provides a minimal interface to applications and exposes hardware resources directly, allowing applications to manage these resources.

Advantages of Exo-Kernal Structure

  • Exokernels are the most modular type of operating system structure. This makes them easy to modify and extend.
  • Exokernels are the most flexible type of operating system structure. They can be used to support a wide variety of operating system designs.
  • Exokernels can be more secure than other types of operating system structures because they provide a smaller attack surface.
  • Exokernels can achieve good performance because they avoid the overhead of system calls.

Disadvantages of Exo-Kernal Structure

  • Exokernels are the most complex type of operating system structure to implement. This is because they must provide a low-level interface to hardware that is still secure and reliable.
  • There can be some performance overhead associated with the communication between user-level processes and the exokernel.

Layered Structure

In this type of structure, OS is divided into layers or levels. The hardware is on the bottom layer (layer 0), while the user interface is on the top layer (layer N). These layers are arranged in a hierarchical way in which the top-level layers use the functionalities of their lower-level levels.

In this approach, functionalities of each layer are isolated, and abstraction is also available. In layered structure, debugging is easier as it is a hierarchical model, so all lower-level layered is debugged, and then the upper layer is checked. So all the lower layers are already checked, and the current layer is to be checked only.

The following are some of the key characteristics of a layered operating system structure:

  • Each layer is responsible for a specific set of tasks. This makes it easier to understand, develop, and maintain the operating system.
  • Layers are typically arranged in a hierarchy. This means that each layer can only use the services provided by the layers below it.
  • Layers are independent of each other. This means that a change to one layer should not affect the other layers.

Below is the Image illustrating the Layered structure in OS:

Layered Approach in Operating System

Advantages of Layered Structure

  • A layered structure is highly modular, meaning that each layer is responsible for a specific set of tasks. This makes it easier to understand, develop, and maintain the operating system.
  • Each layer has its functionalities, so work tasks are isolated, and abstraction is present up to some level.
  • Debugging is easier as lower layers are debugged, and then upper layers are checked.

Disadvantages of Layered Structure

  • In Layered Structure, layering causes degradation in performance.
  • It takes careful planning to construct the layers since higher layers only utilize the functions of lower layers.
  • There can be some performance overhead associated with the communication between layers. This is because each layer must pass data to the layer above it.

Modular Structure

In a modular operating system structure, the operating system is divided into a set of independent modules. Each module is responsible for a specific task, such as memory management, process scheduling, or device drivers. Modules can be loaded and unloaded dynamically, as needed.

Advantages of Modular Structure

  • A modular structure is highly modular, meaning that each module is independent of the others. This makes it easier to understand, develop, and maintain the operating system.
  • A modular structure is very flexible. New modules can be added easily, and existing modules can be modified or removed without affecting the rest of the operating system.

Disadvantages of Modular Structure

  • There can be some performance overhead associated with the communication between modules. This is because modules must communicate with each other through well-defined interfaces.
  • A modular structure can be more complex than other types of operating system structures. This is because the modules must be carefully designed to ensure that they interact correctly.

Virtual Machines

Virtual Machines (VMs) are a form of virtualization technology that allows multiple operating systems to run on a single physical machine simultaneously. Each virtual machine acts as an independent, isolated system with its own OS and applications.

Advantages of Virtual Machines

  • VMs provide a high degree of isolation between guest operating systems. This makes it difficult for malware or other problems in one guest to affect other guests or the host system.
  • VMs can be used to create secure environments for running untrusted code. For example, a VM can be used to run a web browser without risking the entire system to malware infection.
  • VMs can be easily moved from one physical machine to another. This makes it easy to deploy and manage applications across multiple servers.

Disadvantages of Virtual Machines

  • VMs typically have some performance overhead compared to running software directly on the hardware. This is because the VM must emulate the hardware for the guest operating system.
  • VMs can be complex to manage. This is because they require additional software to be installed and configured.
  • VMs can consume a significant amount of system resources. This is because they must run a guest operating system in addition to the host operating system.

Conclusion

  • The operating System enables the end-user to interact with the computer hardware. System software is installed and utilized on top of the operating system.
  • We can define operating system structure as to how different components of the operating system are interconnected.
  • There are many structures of the operating system:
    • Simple Structure
    • Monolithic Approach
    • Layered Approach
    • Micro-kernels
  • All these approaches or structures evolved from time to time, making the OS more and more improved than before.