Sunday, February 22, 2009

Operating System Structure Part-2

In the last post we had seen the first method in which an operating system can be structured i.e Simple Structure.From the last post about simple structure it is very much clear that this method is not very much efficient and there may be other structuring techniques that are much more efficient than simple structure technique.The most important thing for the success of any operating system structure is its hardware support,if an operating system got the proper hardware support then it can be broken into pieces that are more smaller and more effective then that of simple structure.If this is done successfully then an operating system can have much more control over the computer and the applications that are used by computers.In this post we take a look at the other method of making an operating system more modular i.e Layered Approach.

Layered Approach:-In this method of structuring the whole operating system is divided into a number of layers,in which the lowest layer represents the hardware part and the highest layer represents its user interface part.Each layer in this model is an implementation of abstract object model that contains objects and the routines that are required to access these objects.In layered approach a layer can only invoked the operations of its lower level layers.This approach helps very much in simplifying debugging and system verification.The first layer can be debugged without any concern for the rest of the system because their is no layer below the first layer and underlying hardware are assumed to be functioned correctly.Once the first layer is debugged,we can assume its correct functioning and we can debugged the second layer and so on.If an error is found during debugging of that layer then that error belongs to that particular layer because all the underlying layer are already debugged.Thus, the design and implementation of the system is simplified.
The main problem that exists with the layered approach is in defining the functions of every layer because a layer can only use its lower level layers for its functioning.One more problem that exists with this layered approach is that they tend to be less efficient than other types.For instance consider an example,when an user program executes an I/O operation,it executes a system call that is trapped to the I/O layer,which then call the memory management layer,which in turn call the CPU scheduling layer and then passes to the hardware.In this whole process,the each layer add its corresponding overhead result in that system call takes more time in comparison to the non-layered approach.