The operating system structure illustrates the organization of modules inside it. The structure of the operating system varies from system to system. Engineers design it more carefully. So that the operating system functions properly and adopts the modification easily.
We will be discussing different structures of the operating systems. We will learn how are modules organized in each operating system. How does the system work? And what is the use of each system?
Content: Types of Operating System Structure
- Monolithic Systems
- Layered Systems
- Microkernels Systems
- Client-Server Systems
- Virtual Systems
- Exokernel Systems
In the monolithic system, the entire operating system is a large binary program in a kernel mode. This program consists of several procedures. And these procedures are linked. Such that each procedure in the program can call any other procedure without any restriction.
When a procedure calls another procedure. The called procedure provides some useful computation needed by the calling procedure.
As we said that every procedure is free to call other procedures without any restriction. And we have for suppose, thousands of procedures in the operating system program.
Then such a kind of operating system is difficult to understand. And is even unmanageable. If one of the procedures crashes while executing. It may crash the entire operating system.
To overcome this drawback of monolithic structure it was further modified. So the procedures are organized as you can see in the figure below:
- The main procedure invokes the requested service procedure.
- The requested service procedure carries out the system call.
- The utility procedure supports the service procedure to carry out the system call.
In this structure, for each system call there is is a distinct procedure. And utility procedure helps the service procedure in carrying out that particular system call.
The layered operating system organizes the operating system as a hierarchy of layers. The first system designed in such a way was THE system i.e., Technische Hogeschool Eindhoven. It was designed by E.W. Dijkstra and his student.
THE system has six layers as described below:
- Layer 0 – This layer handles allocating the processor to the processes. It switches the processes when any interrupt occurs or if the process timer gets expired. This layer also provides multiprogramming.
- Layer 1 – This layer handles memory management. It allocates the main memory to the processes. Along with main memory, this layer provides a 512K word drum. That holds the parts of the process that we also refer to as pages.
Here the process does not have to worry about whether it is on the main memory or on the drum. It is the responsibility of layer 1 to allocate the memory to the process when required. And deallocate the memory when there is no need.
- Layer 2 – This layer deals with the communication between the process and its operator i.e. the user.
- Layer 3 – It manages the I/O devices. And also manages the information stream between the user program and I/O devices. And between I/O devices and the process.
- Layer 4 – It consists of the user program.
- Layer 5 – It holds the system operator process.
In layered structure, the designer can decide the kernel mode and user mode boundary. However, traditionally all the layers of the operating system lie in kernel mode.
The microkernels structure divides the operating system into small modules. Among these several small modules, only one module runs in the kernel mode and we refer to it as a microkernel. And rest of the modules run as user processes.
Now when you run a device driver or a file system as a separate user process. And if there occurs a bug in any one of them. Then it would only crash that particular component rather crashing your entire system.
In contrast, in a monolithic structure, all the modules can call other modules without any restriction. Then a failure of one module may crash your entire system. Thus, the structure of the microkernel operating system achieves high reliability.
The microkernel structure is not used to design the desktop operating system. Instead, it is used to design:
- The real-time OS
- Industrial OS,
- Avionics OS,
- Military applications etc.
That means the microkernel structure is used to design an operating system that has high reliability.
The structure of the client-server system is a slight variation of a microkernel. Here the modules or the processes are classified into two categories.
- One category has processes that provide some kind of service. We refer to it as servers.
- The other has the processes that consume the services provided by the server. We refer to such processes as clients.
This structure of the operating system is a client-server system.
Working of Client-Server System
The client and server processes communicate with each other by passing messages.
- The client process initiates by constructing a message. And send it to the intended service process. The message illustrates what the client requires.
- The service process receives the message created by the client process. And performs the service requested by the client. And then sends the result to the requesting client process in the form of a message.
If both client and server processes are executing on the same machine. Then a certain amount of optimization is possible.
However, even if the client and the server process are running on the different systems connected using LAN or WAN. Then also the client process does not have to worry about whether the message is handled by their own system. Or the message is carried over the network to the server running on another system.
From the client’s point of view, the same thing happens in both cases:
- If the client and server are running on the same system.
- If client and server are running on different systems connected by the network.
The client sends a request message to the server and the server replies back. The operating system with a client-server structure connects to form a network.
The structure of the virtual system is a logical approach to the layered structure. Here the components of the systems such as CPU, memory, disk drives, network interface card, etc. all are running in different execution environments.
In this way, the virtual system creates an illusion for the user. That the entire system is running in its own private computer. Thus, the user is able to share the same hardware to run different execution environments. These executing environments are nothing but operating systems.
Exokernel structure divides the resources. And provide each user with a separate subset of resources. Thus, each virtual machine runs its own operating system.
Exokernel is a program in the kernel that keeps a check. That no virtual machine is trying to access the resources of another virtual machine.
So these are the different structures that can be used while designing an operating system.
Leave a Reply