Layered Structure of Operating System |
Several structures can be used to implement the operating system. The way the several common components of the operating system are integrated into the kernel and related to one another determines the overall structure of the operating system. We must adhere to the operating system's structures based on this.
The layered structure method divides the operating system into several layers while maintaining a great deal of system control. The hardware is at layer zero (bottom) while the user interface is at layer N (top). The way these layers are constructed, only the functionalities of the lower-level layers are used by each layer. Debugging becomes easier as if lower-level layers were being debugged, and an error happens while debugging. Given that the lower-level layers have already undergone debugging, the mistake can only exist on that layer.
This boosts modularity and enables implementers to modify the internal operations.
Developers are more liberty to alter the internal operations of the routines as long as the external interface remains unchanged.
The primary benefit is how easy it is to develop and debug. Identifying the different layers is the primary challenge.
This structure's primary drawback is the additional overhead it adds to the system due to the requirement for data to be updated and transferred between layers. A layer can only employ lower-level layers, therefore careful layer planning is required. One illustration of this organization is UNIX.
Why Layering in Operating System?
In an operating system, layering offers a clear benefit. Each layer can be specified independently and interact with the others as needed. Creating, updating, and maintaining a system in the form of layers is also simpler when done so. A modification to one layer specification has no effect on the remaining layers.
The operating system's layers can only communicate with those layered above and below. The user applications are handled by the topmost layer, while the hardware is managed by the lowest layer.
Architecture of Layered Structure
The early monolithic systems were improved upon with the creation of this kind of operating system. In a layered operating system, the operating system is divided into multiple layers, each of which has distinct functionality. The following guidelines apply to how the layers are implemented.
A given layer has access to every layer that is present underneath it, yet it is unable to access them. In other words, layer n-1 can access every layer from n-2 to 0, but not the nth layer.
Allocating the processes and transitioning between them when there are pauses or timers expire are handled by Layer 0. It also addresses the fundamental CPU multiprogramming.
As a result, the response will pass through all n-1 layers before reaching layer 1 if the user layer wishes to communicate with the hardware layer. Every layer has to be built and put into place so that it only requires the services that the levels below it give.
- Hardware: This layer communicates with the hardware of the computer and arranges for all of the peripherals that are utilized, including the printer, mouse, keyboard, scanner, and so on. The hardware layer is where thes e kinds of hardware devices are managed. In the layered operating system architecture, the hardware layer is the lowest and most authoritative layer. It is fastened straight to the system's center.
- CPU Scheduling: The scheduling of the CPU's processes is handled by this layer. Process handling is done via numerous scheduling queues. The processes are added to the job queue as soon as they are added to the system. The ready queue contains the processes that are prepared for main memory execution. This layer is in charge of controlling the number of processes that are assigned to the CPU and the number that are not.
- Memory Management: This refers to the movement of processes from the disk to the main memory for execution and vice versa. The operating system's third layer is in charge of this. This layer is linked to all memory management. The computer has several kinds of memories, including ROM and RAM.
- RAM is concerned with switching in and out of memory, if that makes sense. Certain processes on our computer are relocated to the main memory (RAM) during operation, while certain programs—like the calculator—are withdrawn from the main memory when they terminate.
- Process Management: This layer is in charge of allocating the processor to a process, determining how many processes will remain in the waiting schedule, and other process management tasks. This layer also handles the processes' priorities. Process scheduling is done using several techniques, such as round-robin scheduling, priority scheduling, FCFS (first come, first served), and SJF (shortest job first).
- I/O Buffer: In computer systems, I/O devices play a critical role. They give users a way to communicate with the system. This layer manages and ensures the proper operation of the buffers for the I/O devices. Let's say you are using a keyboard to type. The keyboard has a keyboard buffer attached to it that temporarily saves data. In a similar vein, every input/output device has a buffer connected to it. This is a result of the input/output devices' sluggish processing and storage rates. Buffers are used by the computer to keep the CPU and input/output devices operating at optimal timing speeds. The topmost layer of the layered operating system is called User Programs. Word processors, games, browsers, and other user programs and applications are handled by this layer of an operating system. Because it deals with application programs, you may also refer to this as the application layer.
Advantages of Layered Operating System
After examining the many tiers of the Layered Operating System's architecture, let's examine its benefits:
Abstraction
A layer is good for debugging techniques since it doesn't care how the other layers in the structure work.
Modularity
The operating system is composed of multiple parts, each of which efficiently completes its assigned mission.
Better Maintenance
Any updates or changes will just affect the current layer and have no effect whatsoever on the other layers.
Debugging
Compared to unreliable monolithic systems, debugging can be effectively carried out, and the layer being debugged will be rectified because the layers below are already operating correctly.
Disadvantages of Layered Structure
While this system offers a number of benefits over the Monolithic and Simple design, it also has certain drawbacks. These include:
Implementation is intricate and meticulous since each layer can access the services of the levels below it, therefore layer placement is crucial. For instance, the memory management layer's services are utilized by the backup storage layer. Thus, it needs to be maintained below the layer of memory management. Consequently, high modularity begets intricate implementation.
- Execution was slower: A layer requests to move across every layer in between the two interacting layers in order to communicate with the other layer. As a result, it takes longer to respond than the Monolithic system, which is quicker. As a result, adding more layers could result in a extremely inefficient design.
- Functionality: Dividing the functionalities is not always feasible. They are frequently inextricably linked and impossible to disentangle.
- Communication: There is no communication between layers that are not contiguous.
What does an operating system's system structure mean?
We desire an easy-to-understand structure for operating systems because they contain complicated structures, making it possible to customize an operating system to match our unique requirements. Building an operating system piecemeal is easier, much as we decompose bigger issues into smaller, more manageable sub-problems. Every segment has an operating system component. An operating system structure is the method used by the kernel to integrate various operating system components. Operating systems are implemented using a variety of structures, as will be covered in more detail below.
Simple/Monolithic structure
These operating systems are compact, straightforward, and restricted; their architectures are not clearly specified. There is a lack of separation between the functionality tiers and interfaces. The operating system MS-DOS is one instance of this type.
Application programs can access the basic I/O routines in MS-DOS. If one of the user programs on these kinds of operating systems malfunctions, the entire system crashes.
Advantages of Simple/Monolithic Structure
- The few interfaces between the application program and the hardware allow for improved application performance.
- Such an operating system is easy for kernel developers to create.
Disadvantages of Simple/Monolithic Structure
- The lack of distinct divisions between modules makes the structure exceedingly complex.
- It does not mandate that data be hidden within the operating system.
Micro-kernel Structure
By deleting all unnecessary parts from the kernel and implementing them as system and user applications, this arrangement creates the operating system. The micro-kernel, a tiny kernel, is the product of this. This structure has the advantage that no new services need to be introduced to the kernel; instead, they can be added to user space. Because the remainder of the operating system is unaffected if a service fails, it is therefore more dependable and safe. One example of this kind of OS is Mac OS.
Advantages of Micro-kernel Structure
- It allows the OS to be portable across many platforms.
- Since microkernels are tiny, it is possible to test them successfully.
Disadvantages of Micro-kernel Structure
- System performance suffers when intermodular communication increases.
Hybrid-Kernel Structure
All that a hybrid kernel structure consists of is a blend of micro- and monolithic-level organization. In essence, it creates a more sophisticated and useful method by combining the characteristics of both monolithic and micro-kernel systems. It implements the modularity, stability, speed, and design of a monolithic micro-kernel framework.
Advantages of Hybrid-Kernel Structure
- Due to its incorporation of the benefits of both structures, it provides good performance.
- Numerous devices and applications are supported by it.
- Through the use of the micro-kernel technique, it offers improved isolation and security.
- By isolating crucial operations into a micro-kernel for upkeep and debugging, it improves overall system stability.
Disadvantages of Hybrid-Kernel Structure
- By using both monolithic and microstructure, it makes the system harder to understand and raises its overall complexity.
- When compared to a monolithic kernel, the layer of communication between the micro-kernel and other components diminishes performance and adds time complexity.
Exo-Kernel Structure
MIT developed the operating system Exokernel to enable hardware resource management at the application level. The goal of the exokernel design is to allow for application-specific customization by separating resource management and protection. Exokernel size usually tends to be small due to its limited operability.
Because the OS is between the software and the hardware, it will always have an effect on the functionality, performance, and range of apps that are developed for it. In an effort to tackle this issue, the exokernel operating system rejects the idea that an operating system has to offer abstractions for applications to be built upon. The goal is to provide developers as much freedom as possible while limiting their use of abstractions.
Advantages of Exo-kernel
- Assistance with enhanced application control.
- keeps security and management apart.
- The application's performance is enhanced by it.
- Accurate resource allocation and revocation enable a more economical use of hardware resources.
- Building and testing new operating systems is easier.
- It is permitted for any user-space software to use its own memory management scheme.
Disadvantages of Exo-kernel
- A decrease in reliability.
- Interfaces between excokerels are intricately designed.
Applications of Layered Operating System
A layered software architecture, or layered operating system, is an approach to operating system design that separates functionality into discrete layers. Every layer uses services from the layer below it as well as services from the layer above it. Numerous benefits of its modular architecture contribute to its widespread use in a wide range of applications. There are several uses for a layered operating system, such as:Due to the decoupling of the layers, communication between them can be difficult and necessitates meticulous preparation and coordination.
Frequently Asked Questions
What is a Microkernel?
An operating system design known as a microkernel attempts to maintain the kernel's compact size and light weight. It moves the majority of non-essential services, such as device drivers, into user space and only offers necessary services, such process scheduling and inter-process communication.
What advantages come with utilizing an operating system with layers?
Modular design and improved code organization are two of the main advantages of a layered operating system. Because modifications to one layer can be made without affecting other layers, it also facilitates system upkeep and updates. Furthermore, because higher levels can be segregated from the underlying hardware and lower layers can have access restrictions, layered architectures can offer increased security.
What is an example of a layered structure?
A three-tier system with a data management layer (which includes one or more database servers), a client tier (which includes interface functionality), and an application tier (which includes business logic) is the most typical example of multi-tier architecture.
What are the disadvantages of layered structure?
Disadvantages. Using a layered architecture has the primary drawback of potentially increasing system complexity. Due to the decoupling of the layers, communication between them can be difficult and necessitates meticulous preparation and coordination.
.
.