2.20 It is sometimes difficult to achieve a layered approach if two components of the operating system are dependent on each other. Identify a scenario in which it is unclear how to layer two system components that require tight coupling of their functionalities. Modular approach to decompose overall services involving top down method makes system more manageable and controllable. For example, in structural programming if we implement a program dividing into modular functions, then it will be easier to write, debug and test the program. Same concept can be applied while making an operating system. One approach to achieve this is to use layered approach as shown in Figure 1. It enables operating system to be divided into smaller pieces or layers which are easier to manage and control and allows implementers flexibility in changing the inner workings of the operating system and in creating modular operating system. The bottom layer also called layer 0 is the hardware; the top layer which is layer N is the user interface. This layered approach allows information hiding. Each layer consists of data structures and a set of operations that can be invoked by upper layer and each layer in turns can also call operations on lower-level layers. This allows abstraction and help to write, debug and verify the system as a layer does not need to know how the operations are implemented, in needs to know only what these operations do hiding the existence of certain data structures, operations, and hardware from higher-level layers. However, this layered approach become problematic if operating system components requires tight coupling of functionalities of each other. Let us consider a scenario of memory management operations. Due to the limited capacity of main memory, memory management requires to make use of virtual memory to transfer data temporarily to disk storage which means memory management functions should be at upper layer compared to functions handling backing store. During execution time many systems maps files into virtual space memory of an executing process. On the other hand, virtual memory normally uses the storage system to provide backup for pages that is not currently residing in memory. Sometimes, updates to the file system are temporarily stored in physical memory before being transferred to disk. Which means there is a tight coupling between virtual memory system and the storage system for the usage of memory and needs a careful consideration is required to define various layers. Sources: [1] A. Silberschatz, P. B. Galvin and G Gagne “Operating System Concepts”, John Wiley & Sons, Inc. 9th edition, 2018, ISBN 978-1-118-06333-0 Submitted By: Bimal Ghimire Student ID: @02961369 Spring 2020