Menus

Jun 4, 2016

Operating System Structure

UNIT 2
Operating System Structure
System Call:
A system call is a mechanism that is used by the application program to request a service from the operating system i.e. a system call is how a program requests a service from an operating system's kernel. 

This may include hardware related services (e.g. accessing the hard disk), creating and executing new processes, and communicating with integral kernel services (like scheduling). System calls provide an essential interface between a process and the operating system.


System calls provide the interface between a process and the operating system.
System calls can be roughly grouped into five major categories:
(PFDIC)
1.   Process Control
·         load
·         execute
·         create process
·         terminate process
·         get/set process attributes
·         wait for time, wait event, signal event
·         allocate, free memory

2.   File management
·         create file, delete file
·         open, close
·         read, write, reposition
·         get/set file attributes

3.   Device Management
·         request device, release device
·         read, write, reposition
·         get/set device attributes
·         logically attach or detach devices

4.   Information Maintenance
·         get/set time or date
·         get/set system data
·         get/set process, file, or device attributes

5.   Communication
·         create, delete communication connection
·         send, receive messages
·         transfer status information
·         attach or detach remote devices
Kernel of Operating System
Shell and the kernel are the parts of the Operating system. These both parts are used for performing any operation on the system. When a user gives his command for performing any operation, then the request will goes to the shell parts, the shell parts is also called as the interpreter which translate the human program into the machine language and then the request will be transferred to the kernel that means shell is just as the interpreter of the commands which converts the request of the user into the machine language. 

Kernel is also known as heart of operating system and the every operation is performed by using the kernel, when the kernel receives the request from the shell then this will process the request and display the results on the screen. The various types of operations those are performed by the kernel are as followings:-
·         It controls the state of the process means it checks whether the process is running or process is waiting for the request of the user.

·         It provides the memory for the processes those are running on the system means kernel runs the allocation and de-allocation process , first when we request for the service then the kernel will provides the memory to the process and after that it also release the memory which is given to a process.

·         The kernel also maintains a time table for all the processes those are running means the kernel also prepare the schedule time means this will provide the time to various process of the CPU and the kernel also puts the waiting and suspended jobs into the different memory area.

·         When a kernel determines that the logical memory doesn’t fit to store the programs. Then he uses the concept of the physical memory which will store the programs into temporary manner i.e. virtual memory.

·         Kernel also maintains all the files those are stored into the computer system and the kernel also stores all the files into the system as no one can read or write the files without any permission. So that the kernel system also provides us the facility to use the passwords and also all the files are stored into the particular manner.

 
Operating system structure
An operating system might have many structures. According to the structure of the operating system; operating systems can be classified into many categories. Some of the main structures used in operating systems are:
(MLCV)
·         Monolithic architecture
·         Layered architecture
·         Client-Server architecture
·         Virtual machine architecture

Monolithic System (Monolithic architecture)
It is the oldest architecture used for developing operating system. Operating system resides on kernel for anyone to execute i.e. 

A monolithic kernel is an operating system architecture where the entire operating system is working in the kernel space and alone as supervisor mode. System call is involved that means switching from user mode to kernel mode and transfer control to operating system shown as event.

A monolithic kernel is an operating system software framework that holds all privileges to access file system, inter-process communication, fundamental process management, input/output (I/O) devices, memory, hardware interrupts and the CPU stack.

1)   Many CPU has two modes, kernel mode, for the operating system in which all instruction are allowed and user mode for user program in which I/O devices and certain other instruction are not allowed.  Two operating systems, then examines the parameter of the call to determine which system call is to be carried out shown in event
2)   Next, the operating system index’s into a table that contains procedure that carries out system call. This operation is shown in events.
3)   Finally, it is called when the work has been completed and the system call is finished, control is given back to the user mode as shown in event 4.
Layered System

The layered Architecture of operating system was developed in 60’s in this approach; the operating system is broken up into number of layers. The bottom layer (layer 0) is the hardware layer and the highest layer (layer n) is the user interface layer as shown in the figure.

The layered are selected such that each user functions and services of only lower level layer. The first layer can be debugged without any concern for the rest of the system. It user basic hardware to implement this function once the first layer is debugged., it’s correct functioning can be assumed  while the second layer is debugged & soon . If an error is found during the debugged of particular layer, the layer must be on that layer, because the layer below it already debugged. Because of this design of the system is simplified when operating system is broken up into layer.

Example: Os/2 operating system, earlier version of Windows NT.

The main disadvantage of this architecture is that it requires an appropriate definition of the various layers & a careful planning of the proper placement of the layer.

The system had 6 layers and the layers are as follows:

Layer
Function
5
The Operator
4
User Programs
3
Input / Output management
2
Operator – process communication (Device driver)
1
Memory and drum management
0
Processor allocation and multiprogramming

1)   Layer 0 deals with allocation of the processor, switching between processes when interrupts occurred or timers expired. Above layer 0, the system consisted of sequential processes, each of which could be programmed without having to worry about the fact that multiple processes were running on a single processor i.e. the Layer 0 provided the basic multiprogramming of the CPU.

2)   Layer 1 deal with the memory management. It allocated space for process in main memory and on a 512K word drum used for holding parts of processes (pages) for which there was no room in main memory. Above layer 1, processes did not have to worry about whether they were in memory or on the drum; Layer 1 software took care of making sure pages were brought into memory whenever they were needed.

3)   Layer 2 handled communication between each process and the operator console. Above this layer each process effectively had its own operator console.

4)   Layer 3 took care of managing I/O devices and buffering the information streams to and from them. Above layer 3, each process could deal with abstract I/O devices with nice properties, instead of real devices with many peculiarities.

5)   Layer 4 was where the user programs were found. They did not have to worry about process, memory, console or I/O management.
6)   The system operator process was located in layer 5.

Client-server Model
A trend in modern operating system is to move maximum code into the higher level and remove as much as possible from operating system, minimizing the work of the kernel. 

The basic approach is to implement most of the operating system functions in user processes to request a service, such as request to read a particular file, user send a request to the server process, server checks the parameter and finds whether it is valid or not, after that server does the work and send back the answer  to client server model works on request- response technique i.e. Client  always send request to the side in order to perform the task, and on the other side, server gates complementing that request send back response. 

The figure below shows client server architecture.

In this model, the main task of the kernel is to handle all the communication between the client and the server by splitting the operating system into number of ports, each of which only handle some specific task i.e. file server, process server, terminal server and memory service.

Another advantage of the client-server model is it’s adaptability to user in distributed system. If the client communicates with the server by sending it the message, the client need not know whether it was send a ……. Is the network to a server on a remote machine? As in case of client, same thing happen and occurs in client side that is a request was send and a reply come back.
Virtual Machines
Virtual machine (VM) applies a virtualization technology which creates independent environments for the operating systems and applications which are designed to run directly on server or client hardware i.e. virtual machine is an illusion of a real machine. 

It is created by a real machine operating system, which make a single real machine appears to be several real machine. In such architecture, multiple operating systems can run on a machine concurrently. The architecture of virtual machine is shown above.


The best example of virtual machine architecture is IBM 370 computer. In this system each user can choose a different operating system. Actually, virtual machine can run several operating systems at once, each of them on its virtual machine. Its multiprogramming shares the resource of a single machine in different manner.

The concepts of virtual machine are:-
a)   Control program (cp):- cp creates the environment in which virtual machine can execute. It gives to each user facilities of real machine such as processor, storage I/0 devices.

b)   Conversation monitor system (cons, CMS):- cons is a system application having features of developing program. It contains editor, language translator, and various application packages.

c)   Remote spooling communication system (RSCS):- provide virtual machine with the ability to transmit and receive file in distributed system.

d)   IPCS (interactive problem control system):- it is used to fix the virtual machine software problems

The idea of a virtual machine is used now days in a different context: Running old MS-DOS programs on a Pentium. When designing the Pentium and its software, both Intel and Microsoft realized that there would be a big demand for running old software on new hardware.

 For this reason, Intel provided a virtual 8086 mode on the Pentium. In this mode, the machine acts like an 8086, including 16-bit addressing with a 1 MB limit.
This mode is used by windows, and other OS for running old MS-DOS programs.

Microkernel 
Microkernel is smaller kernel. This method structures the operating system by removing all nonessential components from the kernel and implementing them as system and user-level program. Microkernel provides minimal process and memory management.

·         The main function of microkernel is to provide a communication facility between the client program and various services that are also running in user space. Communication is provided by message passing. For example, if the client program wishes to access a file, it must interact with the file server. The client program and service never interact directly. Rather they communicate indirectly by exchanging messages with the microkernel.

·         It can extend the operating system. All the new services are added to user space and consequently do not require modification of kernel.

·         It also provides more security and reliability, if a server fails, the rest of the operating system remains untouched, because most of the services are running as user processes.

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

Example: Andrew Tanenbaum's Minix, Mach, etc
Exokernels.
It is new approach of designing an operating system. This architecture's main characteristic is to minimize the kernel and the transfer of traditional kernel functionality outside the kernel in application-level modules. 

The goal of an exokernel is to give efficient control of resources to un-trusted applications in a secure, multi-user system.

Advantages:
·         The number of kernel crossings is reduced because more things are done in application-space.

·         The cost of a kernel crossing itself is reduced as the kernel internal state and data structures are minimal.

·         The flexibility of the system increases.

1 comment:

Contact Form

Name

Email *

Message *