Operating System Tutorial

Operating System Tutorial Types of Operating System Evolution of Operating System Functions of Operating System Operating System Properties Operating System Services Components of Operating System Needs of the Operating System

Operating Systems

Linux Operating System Unix Operating System Ubuntu Operating System Chrome Operating Systems Fedora Operating System MAC Operating System MS Windows Operating System Solaris Operating System Cooperative Operating System CorelDRAW Operating System CentOS FreeBSD Operating Systems Batch Operating System MS-DOS Operating System Commercial Mobile Operating Systems


Difference Between Multi-programming and Multitasking Difference between C-LOOK and C-SCAN Difference between Rotational Latency and Disk Assess Time Trap vs Interrupt Difference between C-SCAN and SSTF Difference between SCAN and FCFS Difference between Seek Time and Disk Access Time Difference between SSTF and LOOK Difference between Process and Program in the Operating System Difference between Protection and Security in Operating System

How To

How to implement Monitors using Semaphores How to Install a Different Operating System on a PC


What is Kernel and Types of Kernel What is DOS Operating System What is Thread and Types of Thread What is Process Scheduler and Process Queue What is Context Switching What is CPU Scheduling What is Producer-Consumer Problem What is Semaphore in Operating System Monitors in Operating System What is Deadlock What is Paging and Segmentation What is Demand Paging What is Virtual Memory What is a Long term Scheduler What is Page Replacement in Operating System What is BSR Mode What is Convoy Effect What is Job Sequencing in Operating System Why is it critical for the Scheduler to distinguish between I/O-bound and CPU-bound programs Why is there a Need for an Operating System


Process Management Process State Scheduling Algorithm FCFS (First-come-First-Serve) Scheduling SJF (Shortest Job First) Scheduling Round-Robin CPU Scheduling Priority Based Scheduling HRRN (Highest Response Ratio Next) Scheduling Process Synchronization Lock Variable Mechanism TSL Mechanism Turn Variable Mechanism Interested Variable Mechanism Deadlock Avoidance Strategies for Handling Deadlock Deadlock Prevention Deadlock Detection and Recovery Resource Allocation Graph Banker’s Algorithm in Operating System Fixed Partitioning and Dynamic Partitioning Partitioning Algorithms Disk Scheduling Algorithms FCFS and SSTF Disk Scheduling Algorithm SCAN and C-SCAN Disk Scheduling Algorithm Look and C-Look Disk Scheduling Algorithm File in Operating System File Access Methods in Operating System File Allocation Method Directory Structure in Operating System N-Step-SCAN Disk Scheduling Feedback Queue in Operating System Contiguous Memory Allocation in Operating System Real-time Operating System Starvation in Operating System Thrashing in Operating System 5 Goals of Operating System Advantages of Operating System Advantages of UNIX Operating System Bit Vector in Operating System Booting Process in Operating System Can a Computer Run Without the Operating System Dining Philosophers Problem in Operating System Free Space Management in Operating System Inter Process Communication in Operating System Swapping in Operating System Memory Management in Operating System Multiprogramming Operating System Multitasking Operating Systems Multi-user Operating Systems Non-Contiguous Memory Allocation in Operating System Page Table in Operating System Process Scheduling in Operating System Segmentation in Operating System Simple Structure in Operating System Single-User Operating System Two Phase Locking Protocol Advantages and Disadvantages of Operating System Arithmetic operations in binary number system Assemblers in the operating system Bakery Algorithm in Operating System Benefits of Ubuntu Operating System CPU Scheduling Criteria in Operating System Critical Section in Operating System Device Management in Operating System Linux Scheduler in Operating System Long Term Scheduler in Operating System Mutex in Operating System Operating System Failure Peterson's Solution in Operating System Privileged and Non-Privileged Instructions in Operating System Swapping in Operating System Types of Operating System Zombie and Orphan Process in Operating System 62-bit operating system Advantages and Disadvantages of Batch Operating System Boot Block and Bad Block in Operating System Contiguous and Non - Contiguous Memory Allocation in Operating System Control and Distribution Systems in Operations Management Control Program in Operating System Convergent Technologies in Operating System Convoy Effect in Operating System Copy Operating Systems to SSD Core Components of Operating System Core of UNIX Operating System Correct Value to return to the Operating System Corrupted Operating System Cos is Smart Card Operating System Cosmos Operating Systems Examples Generation of Operating System Hardware Solution in Operating System Process Control Block in Operating System Function of Kernel in Operating System Operating System Layers History of Debian Operating Systems Branches and Architecture of Debian Operating Systems Features and Packages of Debian Operating Systems Installation of Operating System on a New PC Organizational Structure and Development in Debian Operating Systems User Interface in Operating System Types Of Memory in OS Operating System in Nokia Multilevel Paging in OS Memory Mapping Techniques in OS Memory Layout of a Process in Operating System Hardware Protection in Operating System Functions of File Management in Operating System Core of Linux Operating System Cache Replacement Policy in Operating System Cache Line and Cache Size in Operating System What is Memory Mapping? Difference Between Network Operating System And Distributed Operating System What is the difference between a Hard link and a Soft Link? Principles of Preemptive Scheduling Process Scheduling Algorithms What is NOS? What is the Interrupt I/O Process? What is Time Sharing OS What is process termination? What is Time-Sharing Operating System What is Batch File File system manipulation What is Message-passing Technique in OS Logical Clock in Distributed System

Operating System Layers

Many structures can be used to implement the operating system. How the different operating system's common parts are connected and integrated into the kernel largely determines how the OS is structured. In light of this, we must adhere to the operating system's architecture.

The operating system is divided into levels using the layered structure concept, giving the system administrator far more control. The hardware is located at layer 0's bottom, while the user interface is at layer N's top. Each of these levels solely utilizes the features of the lower-level layers due to how they are constructed. It streamlines the debugging process by simulating the troubleshooting of lower-level layers with an error. Since the lower-level layers have previously undergone debugging, the issue can only be on that layer.

What an operating system with layers is:

A layered operating system uses several layers to manage user applications and system software. The lower levels handle core system software, while the upper layers deal with application software. Only the layer above or below a given layer can communicate with that layer.

Only the layers above and below each other in the operating system may interact. The top layer handles the user applications, while the lowest layer governs the hardware.

The various operating system functions are divided into layers in a layered structure, each responsible for a clearly defined job. It was developed to enhance previously established frameworks such as the Monolithic (UNIX) and the Simple (MS-DOS) frameworks.

There were two sorts of systems existing before the layered structure:

  1. Monolithic building (UNIX)
  2. Easy structure (MS-DOS)

Examples of an operating system with layers:

- Windows NT as a working environment

Operating System Layers

Layered Structure Design of operating system

The early monolithic systems were replaced with this kind of operating system. The layered operating system is divided into numerous levels, each with unique capabilities. The following are some guidelines for implementing the levels.

  1. A layer can access all layers below it, but it cannot access those layers. Layer n-1 can reach all levels from n-2 to 0 but cannot access layer n.
  2. Layer 0 is responsible for assigning processes and moving between them when there are delays or when the timer runs out. It also covers the CPU's fundamental multiprogramming.

Therefore, the answer will pass through all the layers from n-1 to 1 if the user layer wishes to communicate with the hardware layer. The implementation and planning of each layer must be done only to require the services offered by the levels below it.

Design Analysis:

The picture shows that the entire operating system is divided into levels ranging from 0 to n. Each component needs to fulfill a particular task that is unique to it. The following are some guidelines for implementing the levels.

  1. The User Experience component must be the topmost layer.
  2. The hardware component must be the deepest layer.

A specific layer can access every layer beneath it, but it cannot access the layers above it. In other words, layer n-1 can reach all levels from n-2 to 0 but not layer n.

The operating system's layers

The levels of an operating system are listed below:

Operating System Layers

Process management layer:

This layer handles processes, including how many functions will remain in the waiting timetable and which method will be performed next. In this layer, the operations' priorities are also handled.

This layer handles the processes, which include choosing how many functions will remain in the waiting plan and allocating the CPU to each method. In this layer, the operations' priorities are also handled. First-come, first-served (FCFS), SJF (shortest task first), priority scheduling, round-robin scheduling, and others are some of the various algorithms used for process scheduling.

Personal programs layer:

This layer is connected to applications used by users, such as Microsoft Word, Google Chrome, calculators, music players, etc. This stratum oversees the management of all projects. Given that it is focused on application programs, you could also refer to this as an application layer.

In the tiered operating system, this layer is the topmost. Word editors, sports, browsers, and other user programs and apps that are active within an operating system are handled by this layer. Given that it is focused on application programs, you could also refer to this as an application layer.

CPU scheduling layer:

This layer manages all CPU (central processing unit) scheduling. This component controls the number of tasks that will be assigned to the CPU and the number that will be kept outside of the CPU.

This tier handles the CPU task scheduling. To manage operations, many scheduling lines are employed. The processes are added to the work queue when they reach the system.

The ready queue is used to store programs that are prepared to run in primary memory. This layer controls how many tasks will be assigned to the Processor and which ones will not.

Memory management layer:

This layer is responsible for all aspects of memory administration. As you know, a computer has many different kinds of storage, including RAM and ROM. When RAM (random access memory) is used, memory moving in and out is problematic. When our computer operates, some tasks are transferred to the main memory (RAM) for processing. When applications (such as the calculator) are closed, they are removed from the main memory. This stratum is responsible for managing such activities.

Memory and process transfer from disc to main memory for processing and return are handled in memory management. The third component of the operating system is in charge of managing this. The entire memory management system is connected to this component. The computer has a variety of storage, including RAM and ROM.

If that makes sense, RAM is involved with moving in and out of memory. When our computer operates, some tasks are transferred to the main memory (RAM) for processing. When applications, like the calculator, are closed, they are also deleted from the main memory.

I/O buffer layer:

Assume you are using a computer to type. A keyboard buffer that is connected to the keypad temporarily saves data. In a similar vein, every input/output device has a cache of some kind attached to it. This is due to the sluggish working and storing speeds of the input/output devices. The computer uses buffers to keep the proper timing pace of the CPU and input/output devices. In this stratum, the pads are handled.

I/O hardware plays a crucial role in computer networks. They offer customers ways to communicate with the machine. The I/O device caches are managed by this component, ensuring proper operation.

Let's say you are using a keypad to type. The keypad has a connected keyboard buffer, which temporarily saves data. Similarly, every input/output device has a cache connected to it. This is due to the working and storage speeds of the input/output devices. The computer uses buffers to keep the input/output devices and the Processor's excellent timing performance.

Hardware layer:

The computer can be connected to many devices, such as a keypad, mouse, printer, and scanner. The hardware layer controls these kinds of physical components. The hardware component has the most power and is immediately connected to the system's brain.

This layer integrates with all peripheral devices, including a printer, mouse, keypad, scanner, etc., and works with the system hardware. The hardware layer controls these kinds of physical components.

The hardware layer is the lowest and most powerful component in the layered operating system design. It is immediately connected to the system's brain.

Benefits of the layered operating system:

The layered framework of operating system architecture has several benefits, including:

  1. Modularity: This design encourages modularity because each component only performs assigned duties.
  2. Simple debugging: Because the levels are distinct, debugging is very simple. There needs to be a solution to the Processor scheduling mechanism. In contrast to the Monolithic system, where all the services are available, the coder can only explore that specific layer to debug.
  3. Simple update: Modifications made to one layer won't impact those made to subsequent levels.
  4. Hardware layer cannot be accessed directly: The hardware layer is the innermost component in the architecture. So, unlike the Simple system, where the user had direct access to the hardware, a user can use the services of hardware but cannot directly change or access it.
  5. Abstraction: Each component considers how it performs. Therefore, the other levels' methods and functions are abstract to it.

Drawbacks of the layered operating system:

Even though this system has several benefits over the monolithic and straightforward design, it also has some drawbacks, including:

  1. Complicated and meticulous implementation: Because a layer can access the services of levels below it, the layers' organization must be done with care. For instance, the backing store layer uses the memory management layer's functions. The memory control layer must be maintained below it—consequently, complicated execution results from massive modularity.
  2. Execution is slower: When two levels want to communicate, each layer asks to pass through every other layer that exists in between them. As a result, reaction times lengthen, in contrast to the Monolithic method, which is quicker in this regard. Therefore, adding more levels could result in more efficient construction.
  3. Functionality: Dividing the features is only sometimes feasible. They frequently interact with one another and cannot be divided.
  4. Communication: Non-adjacent levels cannot communicate with one another.