Architecture of Operating System
Architecture is the fundamental structure of an operating system that defines the interconnection between the system components. An operating system can have different architectures:
- Monolithic architecture
- Layered architecture
- Virtual machine architecture
- Exokernel architecture
- Client server architecture
1. Monolithic Architecture
- It is the oldest architecture used for developing an operating system in which modules are not organized in well-defined manner.
- It consists of a single layer that performs all the functions of the operating system.
- The concept of information hiding is absent in this architecture, therefore different users are able to observe and call procedures of each other Moreover, one module can call any other module without any major restriction.
- In this architecture, the kernel interacts directly with the hardware
- There is no distinction between user mode and kernel mode by operating system while executing an application program.
- Monolithic kernel is also not very portable and gets loaded completely into memory at boot time.
- MS-DOS and Novell Netware operating systems are the examples of monolithic architecture
- The operating system provides services to users in form of system calls. These system calls provide functions, such as positioning of procedural parameters on the stack and executing trap instruction. This instruction transfers the control to the OS by swapping the control from user mode to kernel mode.
- The operating system checks the parameters and calls the service procedure, which in turn calls the utilities
- Utilities return the control back to user program in user mode.
- As there are very few interfaces between the application programs and the underlying hardware, monolithic architecture delivers good performance
The limitations of an operating system using monolithic architecture are
- It is difficult to modify as a whole because the operating system has to be redesigned
- Failure of single program crashes the entire system
- Modules are not organized in well defined manner
2. Layered Architecture
- Layered architecture organizes operating system into different layers that communicate using standard function calls.
- Each layer has clearly defined functionality.
- The lavers are built one above the other in such a way that each layer uses services and functions of its lower layer.
- The main advantage of this approach is modularity. Thus all the benefits of modular programming can be achieved with this architecture.
The various layers of operating system are :
1. Hardware :
It consists of various I/O devices, CPU and the memory. The hardware acts as a platform for an operating system. It provides computing resources for executing various application programs.
2. Kernel :
It is the core of all the operating systems. Kernel directly interacts with hardware and schedules the execution of various tasks. It also performs low level functions such as reading the input from keyboard and displaying the output on the monitor. In addition, a kernel also performs other functions such as memory management, file management, scheduling and system accounting of various processes.
3. Service layer :
It interacts with the kernel and the drivers. Drivers are a set of specialized programs used for communicating with hardware. Service layer is responsible for maintaining security of user’s file and objects.
4. Applications/shell :
User create different applications and executes these applications through shells. Shell is a utility that is stored on the hard disk and is loaded into the memory when the kernel is invoked. It acts as the interface between the use and the operating system.
The various advantages of having layered architecture are:
- It provides modular approach of the system.
- It simplifies the task of debugging and system verification. The bottom layer consists of basic hardware that is easy to debug. If an error appears in a particular layer, then only that layer is modified as lower layers are already debugged.
- It implements the concept of information hiding. The contents of lower-level layers, such as hardware, data structures are hidden from higher level layers.
The various disadvantages of layered architecture are:
- Each layer adds an operating cost to its higher layer. Therefore it is less efficient than other architectures.
- It requires careful planning for designing the layers as a higher layer can use the functionalities of only the lower layers.
The examples of layered architecture are UNIX and VAX/VMS.
3. Virtual machine architecture
- Virtual machine architecture is also known as enterprise system architecture.
- It is built on the virtual storage concept to subdivide a single computer system into multiple, virtual computer systems, each with its own processor, disk storage, tape storage and other I/O devices. Thus it creates an illusion of a real machine.
- Thus, virtual machine uses software techniques to make a single computer appear to be multiple smaller computer systems.
- Each of these small computers, simulated in software, acts as an independent and complete computer system.
- Each of these computer system consists of a set of virtual instructions. The function of virtual machine is to map the virtual instruction set to real instruction set of the computer.
- Virtual machine contains a software layer called Virtual Machine Monitor (VMM) that creates the exact copies of hardware resources and exports the hardware interface.
- VM/370 operating system is an example of virtual machine architecture. It supports multiple virtual machines that run concurrently on IBM/370 computer.
The various advantages of using virtual machine are:
- It facilitates the sharing of hardware resources.
- Virtual machine provide better security as various virtual machines are completely isolated from one another.
- It simplifies the system development as system can be implemented without disrupting normal system operation. As a result development time is also reduced.
- It also helps in solving the problem of system compatibility.
The disadvantage of virtual machine is that the virtual machine software requires a lot of disk space for providing virtual memory and spooling.
4. Exokernel architecture
- Like virtual machine architecture, exokernel architecture is also based on the principle of creating duplicate copies of operating system.
- The exokernel architecture contains a program called exokernel that resides in the bottom layer of the operating system.
- Exokernel performs the function of resource allocation to virtual machines and maintains authorized and secure use of their resources.
- The main advantages of using exokernel architecture is that it eliminates the requirement of the mapping layer. It not only monitors the resources allocated to virtual machines but also separates the system code running in user space from the multiprogramming concept of exokernel.
5. Client-server architecture
- Client server architecture consist of two different programs-client and server.
- Client sends a service request to the sever for accessing various resources.
- The server fulfills the request by providing shared access to resources such as printed database and modem.
- Client server architecture is mainly used in a network for efficient distribution resources across different clients.
- Client and server processes use Application Program Interface (API) and Remote Procedure Calls (RPC).
- API is a set of software functions implemented as a library used by an application program as a means for providing access to an operating system’s capabilities.
- RPC is a method of calling the procedure located at remote location by sending service request to server.
There are 3 major components of client-server architecture :
- Client contains components such as GUI, DBMS and operating system.
- Network is used for communicating clients with the server. It can be LAN, WAN or Internet.
- Server contains components such as authentication module, network communication package, database package and operating system.