Get free ebooK with 50 must do coding Question for Product Based Companies solved
Fill the details & get ebook over email
Thank You!
We have sent the Ebook on 50 Must Do Coding Questions for Product Based Companies Solved over your email. All the best!

Layered Structure of Operating System

The Layered Structure of Operating System is an operating system architecture that layers software components into different layers in which the hardware is at the bottom of the layer. Each layer in the operating system is responsible for certain functioning tasks.

Origin of Operating Systems Layers

The idea of designing a layered structure of operating systems came to Djikstra and Powell where it was suggested that an operating system can be divided into different layers to increase modularity, and easy to maintain and debug-friendly system.

The layered structure of operating system came into existence by MULTICS, an operating system developed around the early 1970s when the Massachusetts Institute of Technology, Bell Labs and GE started collaborating on its development. MULTICS was the first of many that were about to launch in the following decades.

Layering the Operating System into different parts helps in debugging. Taking an instance on debugging in general when an error is encountered, the error remains the same layer as all the underlying layers are already debugged and each layer can be separately debugged or tested without interference from other layers.

Architecture of Layered Operating Systems

Layered Operating Systems are designed in such a manner that layers below a layer provide the service and the layers above are those that consume the service. This practice is used in software engineering to create applications that are modular, scalable and easy to maintain. Below is an illustration to help us understand the many layers that are fixed to the kernel. The layers sandwiched between the first and last layer are responsible for system services and management such as CPU scheduling, memory management, process management and I/O Management.

As discussed, the operating system consists of n layers where each layer has its own set of functions as its contributes to the proper functioning of the operating system. The certain rules to be followed in this architecture are:

  1. The outermost layer needs where the user is able to interact with the operating system or user interface.

  2. The lowermost layer is hardware which consists of all the components of the device working in integration with the software.

  3. A certain layer is allowed to access all the layers below it but it not can access the layer above itself in the layered structure of operating system.

For example: If the layer is n, then all the layers from 0 to n-1 will be accessible but the n+1 or any further layer above it cannot be accessed from the current layer.

Description of Different Layers

As we have some foundational knowledge of the layered structure of operating system, now we will be discussing each of the layers in detail as given in the ordered way below:-

Layer 1 – Hardware

This layer interacts with the internal components and works in partnership with devices such as monitors, speakers, webcam etc. It is regarded as the most autonomous layer in the layered structure of operating system.

Layer 2 – CPU Scheduling

CPU Scheduling is responsible to schedule the process that is yet to be run by the CPU. Processes lie in Job Queue when they are about to be executed by the CPU and remain in the Ready Queue when they are in memory and ready to be executed. Although there are multiple queues used for scheduling, the CPU Scheduler decides the process that will execute and the others that will wait.

Layer 3 – Memory Management

One of the layers in the middlemost region of the layered structure of operating system is responsible for allocating and deallocating memory to processes, here processes move to the main memory during execution and return back once they are run successfully, and the memory is freed. RAM and ROM are primarily the most popular examples.

Layer 4 – Process Management

The layer decides which process will be executed by giving them the CPU and which will be waiting in the queue. The decision-making is performed with the help of scheduling algorithms like Shortest Job First, First Come First Serve, Shortest Remaining Time First, Priority Scheduling etc.

Layer 5 – I/O Buffer

This is the second layer from the top that is responsible for the interactivity of the user as input devices like the mouse, keyboard, and microphone are the source if communication between the computer and the user. Each device is assigned a buffer to avoid slow processing input by the user.

Layer 6 – User Application

This is the uppermost layer that gives the user easy and user-friendly access to the application to solve a real-world problem, play music or surf the internet etc.. It is also known as the Application Layer.

Advantages of Layered Operating System

Having seen the different layers of the architecture of the Layered Operating System, let us have a look at the advantages:-

  1. Abstraction
    A layer is not concerned with the functioning of other layers in the structure which makes it suitable for debugging practices.

  2. Modularity
    The operating system is divided into several units and each unit performs its task efficiently.

  3. Better Maintenance
    Any updates or modifications made will restrict to the current layer and not impact the other layers in any manner.

  4. Debugging
    Debugging can be performed well with the layer that is debugged will be corrected as the layers existing below are already functioning properly as a comparison to unreliable monolithic systems.

Disadvantages of Layered Operating System

However, there are certain drawbacks attached to the layered operating systems as well that can be justified as:-

  1. Lack of communication
    As there is always a lack of communication between the non-neighbouring layers of the operating system, it can be problematic at times.

  2. Functionality
    When the functionalities are interconnected, they cannot be separated from each other and in this case, layers are difficult to create.

  3. Slow processing
    The layers are responsible for any request erupting and to reach another layer is a tedious and time-taking process, unlike monolithic kernels. More the number of layers, the lesser the efficiency.

  4. Complex Design
    Layered Structure of Operating System has a complex design that must be carefully implemented as the services that are being used by a layer must be kept below that layer.

Applications of Layered Operating System

Layered operating systems have been widely used in the development of modern operating systems, including Unix, Windows, and Linux. They are significantly used in embedded systems, especially the ones found in automobiles, consumer electronics and medical devices.

Layered operating systems are popular in real-time systems, where predictability and reliability are critical. In these systems, each layer is carefully designed and tested to ensure that it meets its timing and performance requirements.

In this article, we studied what is a layered structure of operating system as we started with the origin and moved on to the design and architecture, discussed each component of it and winded up with the pros, cons and applications of the layered structure of operating system. We hope you liked this article and expect to see you again at PrepBytes with another informative article from our side soon.

Frequently Asked Questions

1. What is a Layered Operating System?
A Layered Operating System is a type of operating system that is divided into multiple layers of abstraction. Each layer provides a set of services to the layer above it, which builds on those services to provide more complex functionality. The layers are typically arranged in a hierarchical fashion, with the lowest layers providing basic hardware access and the highest layers providing application-level services.

2. What are the benefits of using a Layered Operating System?
One of the primary benefits of a Layered Operating System is that it allows for modular design and better organization of code. It also makes it easier to maintain and update the system, since changes to one layer can be made without affecting other layers. Additionally, layered architectures can provide greater security, since access to lower layers can be restricted, and higher layers can be isolated from the underlying hardware.

3. What are the disadvantages of using a Layered Operating System?
One of the main disadvantages of a Layered Operating System is that it can be more complex and potentially slower than a monolithic operating system. This is because data has to pass through multiple layers before it can be processed, and each layer adds a certain amount of overhead. Additionally, a layered architecture may require more memory and processing power to maintain.

4. How is a Layered Operating System different from a Microkernel Operating System?
A Layered Operating System is similar to a Microkernel Operating System in that they both separate functionality into different layers. However, a Microkernel Operating System takes the concept a step further by moving more functionality out of the kernel and into user space, which can make it easier to update and maintain the system. In contrast, a Layered Operating System typically keeps more functionality in the kernel.

5. What examples are there of Layered Operating Systems?
There are many examples of Layered Operating Systems, including UNIX, Linux, and the Windows NT family of operating systems (including Windows XP, Vista, 7, 8, and 10). Each of these operating systems has a layered architecture, with different layers providing services to higher layers. However, the exact architecture and number of layers can vary depending on the specific operating system.

Leave a Reply

Your email address will not be published. Required fields are marked *