Introduction to Operating Systems: Unit I: Introduction

Operating System Structures

Introduction - Introduction to Operating Systems

Modern operating system is complex in nature. Here we study different structure motto of the operating systems.

Operating System Structures

AU: May-17, 19, 22

• Modern operating system is complex in nature. Here we study different structure motto of the operating systems.

Simple Structure

• Microsoft-Disk Operating System (MS-DOS) is example of simple structure of operating system. Most of the commercial systems do not have well defined structure. Initially DOS is small and simple in size. When new versions are introduced, size goes on increasing.

• There is no CPU Execution Mode (user and kernel), and so errors in applications can cause the whole system to crash.

• MS-DOS is layered structure operating system. It consists of following layers: 

1.Application program layer

2. System program layer for resident

3. Device driver layer

4. ROM BIOS device driver layer.

• In DOS, application program directly interact with BIOS device driver. If user makes any changes in the BIOS device driver, it creates the problem and affects the whole system. Memory size is also limited so after use memory must be made free for other users.

• Another example of this type is UNIX operating system. Initially it provides limited hardware functionality. UNIX is divided into two parts : Kernel and system programs.

• Kernel provides system calls for CPU scheduling, I/O management, file management and memory management. System call uses application program interface in UNIX. API defines user interface by using set of system programs. Kernel supports an API and user interface.

• To support more advanced version of hardware, new UNIX operating system was developed. It is consists of different modules for controlling the hardware. Module will communicate with each other for proper operation. Designers are free to design operating systems which support all new versions of hardware and user requirements.

Layered Approach

• Second type of operating system design is layered approach. Operating system is divided into number of layers. Each layer boundary is properly defined. Bottom layer is called layer 0 and top most layer is called layer N. Layer N provides user interface.

• A function of layer is also fixed. Fig. 1.9.1 shows the operating system layer. Each layer consists of data structure and a set of routines. Layer provides services to upper and lower layers.

• Modularity is the advantage of the layered system. Number of layers are selected properly and each layer uses the services and functions of lower level layer (Below layer of the current layer). This type of design simplifies the debugging and system verification.

• First layer contains only basic hardware to implement function. So only first layer is debugged for checking the whole system. If error is not found then the system will works properly. If error is encounter while debugging second layer, then error is related to the second layer only. In this operating system is designed and implemented. It simplifies the design task of the operating system.

• Care should be taken while designing the layers. Which functions are added to which layer must be designing properly? Layer boundaries must be defined properly. Some of the function includes only in the lower layer. Device driver, memory management and input/output operation function must be included in the lower layer.

• Secondary storage is required for all operation. When CPU changes the process as per scheduling method, currently executing process is stored on the secondary storage. Disk space is required for this purpose. So CPU scheduling is includes in the above layer of the secondary storage layer.

• Each layer uses system calls for performing their operation. Layer adds overhead to the system call.

Monolithic Structure

• Traditional UNIX operating system uses monolithic kernel architecture. The entire operating system runs as a single program in kernel mode. Program contains operating system core function and device drivers.

• Most of the operation performed by kernel is via system call. Required system calls are made within programs and a checked copy of the request is passed through a system call. Fig. 1.9.2 shows monolithic kernel.

• LINUX operating system and FreeBSD uses modern monolithic kernel architecture. It loads the modules at run time. There is easy access of kernel function as required and minimize the code running in kernel space.

• Monolithic kernel used in Windows 95, Windows 98, Linux and FreeBSD etc.

Advantages:

1. Simple to design and implement.

2. Simplicity provides speed on simple hardware.

3. It can be expanded using module system.

4. Time tested and design well known.

Disadvantages :

1.Runtime loading and unloading is not possible because of module system.

2. If code base size increases, maintain is difficult.

3. Fault tolerance is low.

Microkernel

• Microkernel provides minimal services like defining memory address space, IPC and process management. It is small operating core. Hardware resource management is implemented whenever process is executing.

• The function of microkernel is to provide a communication facility between the client programs. It also provides facility to various services which are running in user space. Message passing method is for communication two processes.  

• Microkernel runs in kernel mode and rest run in normal user processes. Microkernel also provides more security and reliability. Most of the services are running as user rather than kernel processes.

• By running device driver and file system as a separate user process, a error in one can crash only single component. Fig. 1.9.3 shows microkernel.

• Mach operating system uses microkernel architecture. Microkernel in Windows NT operating system provides portability and modularity. The kernel is surrounded by a number of compact subsystems so that the task of implementing Windows NT on a variety of platform is easy.

• Microkernel architecture assigns only a few essential functions to the kernel, including address space, IPC and basic scheduling. QNX is a real time operating system that is also based upon the microkernel design.

• Main disadvantage is poor performance due to increased system overhead from message passing.

Advantages of microkernel:

1. Microkernel allows the addition of new services.

2. Microkernel architecture design provides a uniform interface on requests made by a process.

3. Microkernel architecture supports object oriented operating system.

4. Modular design helps to enhance reliability.

5. Microkernel lends itself to distributed system support.

6. Microkernel architecture support flexibility. User can add or subtract services according to the requirement.

Virtual Machine

• In a pure virtual machine architecture the operating system gives each process the illusion that it is the only process on the machine. The user writes an application as if only its code were running on the system.

• Each user interacts with the computer by typing commands to the virtual machine on a virtual system console and receiving results back from the machine as soon as they are computed.

• Each user directs the virtual machine to perform different commands. These commands are then executed on the physical machine in a multiprogramming environments.

• Virtualization is an abstraction layer that decouples the physical hardware from the operating system to deliver greater IT resource utilization and flexibility.

• It allows multiple virtual machines, with heterogeneous operating systems to run in isolation, side-by-side on the same physical machine. Fig. 1.9.4 shows virtual machine.

• Each virtual machine has its own set of virtual hardware (e.g., RAM, wol CPU, NIC, etc.) upon which an o operating system and applications The operating system creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory.

• The main components of virtual machine are the control program, conversational monitor system,remote spooling communication interactive problem control and system.

• The control program creates the environments in which virtual machines can executes. It also manages the real machines underlying the virtual machine environment.

• The java virtual machine is one of the most widely used virtual machines.

• Virtual machines tend to be less efficient than real machines because they access the hardware indirectly.

Benefits

1. There is no overlap amongst memory as each virtual memory has its own memory space.

2. Virtual machines are completely isolated from the host machine and other virtual machines.

3. Data does not leak across virtual machines.

Virtualization

Virtualization means running multiple machines on a single hardware. The "Real" hardware invisible to operating system. OS only sees an abstracted out picture. Only Virtual Machine Monitor (VMM) talks to hardware.

• It is "a technique for hiding the physical characteristics of computing resources from the way in which other systems, applications, or end users interact with those resources. This includes making a single physical resource appear to function as multiple logical resources; or it can include making multiple physical resources appear as a single logical resource."

• It is divided into two main categories :

1. Platform virtualization involves the simulation of virtual machines.

2. Resource virtualization involves the simulation of combined, fragmented, or simplified resources.

Comparison between Monolithic Kernel and Microkernel

University Questions

1. Explain the various structures of an operating system.  AU May-17, Marks 8

2. State the operating system structure. Describe the operating system operations in detail. Justify the reason why the lack of a hardware-supported dual mode can cause serious shortcoming in an operating system?  AU May-22, Marks 7

3. Explain in detail the different architectures of OS starting from simple structure, layered structure, micro kernels, modules and hybrid system with suitable example OS structures, including google's Android.   AU May-19, Marks 13

Introduction to Operating Systems: Unit I: Introduction : Tag: : Introduction - Introduction to Operating Systems - Operating System Structures