Educational Blog Sites

Monday, July 31, 2017

Operating System Structure


Lesson 3 : Operating System Structure

3.1. Learning Objectives
On completion of this lesson you will know :
I)  different types of OS system structure
II) how a system call can be made
III) micro kernel.
3.2. Operating System Structure
A number of approaches can be taken for configuring the components of an operating system, ranging from a monolithic to a virtual machines. To conclude the introduction, we identify several of the approaches that have been used to build OS. There are four different structures of operating system, but in this lesson we will discuss only three of them.
3.2.1. Monolithic System
The monolithic organization does not attempt to implement the various functions process, file, device and memory management in distinct modules. Instead, all function are implemented within a single module that contains all system routines or process and all operating system data structure.
The operating system is written as a collection of procedures, each can call any of the other ones whenever it needs to. When this technique is used, each procedure in the system has a well defined interface in terms of parameters and results, and each one is free to call any other one, if the latter provides some useful computation that the former needs.
In monolithic systems, it is possible to have at least a little structure. The services (system calls) provided by the operating system are requested by putting the parameters in well-defined places, such as in registers or on the stack, and then executing a special trap instruction known as a kernel call or supervisor call.
This instruction switches the machine from user mode to kernel mode (also known as supervisor mode), and transfers control to the operating system, shown as event 1 in Fig. 2.3. Most CPUs have two modes; kernel mode, for the operating system, in which all instructions are allowed; and user mode, for user programs, in which I/O and certain other instructions are not allowed.
The operating system then examines the parameters of the call to determine which system call is to be carried out, shown as 2 in Fig. 2.3. Next the operating system indexes into a table that contains in slot x a pointer to the procedure that carries out system call x. This operation, shown as 3 in Fig..2.3, identifies the service procedure, which is then called. Finally, the system call is finished and control is given back to the user program.
How a system call can be made?
1. User program traps to kernel.
2. OS determines service number required.
3. Service is located and executed.
4. Control returns to user program.
This organization suggests a basic structure for the operating system :
i)  A main program that invokes the requested service procedure.
ii) A set of service procedures that carry out the system calls.
iii)  A set of utility procedures that help the service procedures.
In this model, for each system call there is one service procedure that takes care of it. The utility procedures do things that are needed by several service procedures, such as fetching data from user programs.
3.2.2. Client / Server or Micro-Kernel Approach
A micro-kernel is a "new" way of structuring an operating system. Instead of providing all operating system services (as do most current kernels) a micro-kernel provides a much smaller subset. Services usually provided are memory management, CPU management and communication primitives. Typically a micro-kernel will provide the mechanisms to perform these duties rather than the policy of how they should be used. Other operating system services are moved into user level processes that use the communication primitives of the micro-kernel to share information. In this system, the OS responsibilities are separated out into separate programs.

Difference between monolithic and micro kernel system
A monolithic operating system contains all the necessary code in the one kernel. This means that if any changes are made to the kernel the whole system must be rebooted for the changes to take effect.
A micro-kernel operating system contains a much reduced set of code in the kernel of the operating system. Most of the service provided by the OS are moved out into separate user level processes.
All communication within a micro-kernel is generally via message passing whereas a monolithic kernel relies on variables and local procedure calls. These attributes of a micro-kernel mean:
i) that it is easier to develop the user level parts of the micro-kernel as they can be built on top of a fully working operating system using programming tools,
ii) the user level processes can be recompiled and installed without rebooting the machine,
iii) different service can be moved to totally different machines due to the message passing nature of communication in s micro-kernel operating system.
Share:

0 comments:

Post a Comment

Translate

Total Pageviews

Search This Blog

Blog Archive

Recent Posts