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.