Chapter 14 - Structure of operating systems. This chapter discusses three methods of structuring an operating system. The layered structure of operating systems simplifies coding, the kernel-based structure provides ease of implementation on different computer systems, and the microkernel-based structure permits modification of an operating system’s features to adapt to changes in the computing environment and also provides ease of implementation on different computer systems.
PROPRIETARY MATERIAL. © 2007 The McGrawHill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGrawHill for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission. Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 1 Copyright © 2008 Functions performed by an OS • An OS performs the following functions – – – – – – • User interface Process management Memory management I/O management File management Protection and Security OS should be structured so that it can cope with changes in computer systems and computing environments Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 2 Copyright © 2008 Operation of an OS • Three key aspects of OS operation are – Booting * Determines configuration of the system, viz CPU, I/O devices, etc * Loads the kernel, initializes its data structures and hands over control – Interrupt handling * Events are handled to perform resource allocation, I/O and initiation / termination of programs – Scheduling * A process is chosen for servicing Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 3 Copyright © 2008 Interrupt handling • An event causes an interrupt, which passes control to the kernel • An appropriate interrupt handler is invoked to handle the event • The scheduler selects the process to be serviced next Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 4 Copyright © 2008 A view of OS operation • The memory is divided into ‘system area’ and ‘user area’ • Some components of OS reside permanently in memory; others are loaded as needed Chapter 14: Structure of Operating Systems Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:5 Copyrightâ2008 Policies and Mechanisms An OS function involves – Policy * A guiding principle that should be used to manage a class of entities * For example, round-robin scheduling – Mechanism * A specific operation needed to implement a policy * For example, dispatching Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 6 Copyright © 2008 Portability and extensibility of OS • For cost-effectiveness, OS lifetime should be >10 years – Several changes take place during this time * Computer architecture, I/O device technology, computing environments change – The OS should be able to cope with these changes * Portability Ease with which an OS can be implemented on a computer system with a different architecture Architecture-dependencies affect portability * Extensibility It should be possible to adapt to changes For example, modify OS functionalities or add new ones Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 7 Copyright © 2008 Problems with monolithic OS structure • OS code did not have modules with well-defined interfaces – Functionalities knew each other’s data and could access directly – The OS layer had both architecture dependent and architecture independent code * Hence portability was poor Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 8 Copyright © 2008 Alternative OS structures • Problems with monolithis structure led to developments of three methods of structuring – Layered structure * Reduces complexity and cost of developing an OS – Kernel-based structure * Confines machine dependencies to a small section of OS code – Microkernel-based structure * Provides benefits of kernel-based structure and also provides extensibility Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 9 Copyright © 2008 Layered design of operating systems • An OS is structured into a number of layers – Each layer provides a set of services – A higher layer uses the services of the immediate lower layer * Helps in controlling complexity and cost of developing and maintaining an OS by reducing the semantic gap Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 10 Copyright © 2008 Semantic gap Machineinstructionsimplementmachineưlevelprimitiveoperations OSmoduleswishtoperformOSưlevelprimitiveoperations,e.g.,contextsave Thismismatchiscalledasemanticgap Chapter14:Structureof OperatingSystems Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:11 Copyrightâ2008 Layered design of operating systems • The lower layer implements OSlevel primitives, thus providing an extended machine which is a more capable machine • OS modules use operations of the extended machine, thus reducing semantic gap Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 12 Copyright © 2008 Layers of THE multiprogramming system • Layers 0 and 1 perform processor and memory management, respectively • Layer 3 hides intricacies of devicelevel I/O Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 13 Copyright © 2008 Virtual machine operating system (VM OS) • A VM OS operates as follows: – It creates several virtual machines * A virtual machine is like a virtual resource * It has the same architecture as the real computer, i.e the host machine, but does not contain some of its features For example, it may not support some instructions of the host computer – VM OS interleaves operation of several virtual machines * Instructions of the selected virtual machine are executed on the host machine, which ensures efficiency of its operation – Each virtual machine has its own operating system, called a guest OS – This way, several operating systems can operate on the host computer concurrently Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— AConceptưBasedApproach,2ed SlideNo:14 Copyrightâ2008 VM OS VM/370isanearlywidelyknownVMOS;itworkedonIBM/370 Chapter14:Structureof OperatingSystems Dhamdhere:OperatingSystems AConceptưBasedApproach,2ed SlideNo:15 Copyrightâ2008 VM OS Operation of a VM OS – VM OS schedules guest OSs; a guest OS schedules one of the application processes * VM OS may not be able to differentiate between a guest OS and an application process * Application processes uses the capabilities of a virtual machine – Virtualization is the process by which capabilities of host machine are made available in virtual machine (VM) * Full virtualization: all capabilities of host are available in VM May lead to lack of security as VM OS cannot prevent an application process from using privileged instructions * If full virtualization is not used, guest OS must invoke the VM OS to use some capabilities of the host machine Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 16 Copyright © 2008 Uses of VM OS • A VM OS can be used in following ways – Server consolidation * Instead of having a separate machine for each server, several servers can be made to use the same machine – Disaster management * Transfer a virtual machine from one computer to another for planned and unplanned shutdowns Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed SlideNo:17 Copyrightâ2008 Kernel-based operating systems Thekernelcontainsarchitectureưdependentcode,whichtypicallyconstitutes variousmechanisms Thenonưkernelmodulesdonotcontainarchitectureưdependentcode ThisarrangementfacilitatesportabilityofanOS Chapter14:Structureof Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 18 Copyright © 2008 Mechanisms in a kernel Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 19 Copyright © 2008 Dynamically loadable kernel modules • Kernel modules have well-specified interfaces – Facilitates dynamic loading of kernel modules * Conserves memory by loading only the required modules * Provides extensibility as kernel modules can be modified separately Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 20 Copyright © 2008 Microkernel-based operating systems • A microkernel is the essential core of OS code; it contains few mechanisms and system calls, e.g., memory management, so it can be very small in size • Less essential parts of code exist outside the microkernel; they operate as servers • This organization facilitates reliability, portability and extensibility Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— AConceptưBasedApproach,2ed SlideNo:21 Copyrightâ2008 Kernels of Unix and Linux DiagramshowsstructureofUnixkernel,whichismonolithicinnature • Linux kernel has an analogous structure; however, it supports dynamically loadable kernel modules, is more responsive and supports architectures not having an MMU Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 22 Copyright © 2008 Architecture of Windows • The HAL provides abstractions of I/O interfaces, interrupt controllers and interprocess communication processes in a multiprocessor system • HAL and the kernel are together equivalent of the conventional kernel • Environments subsystems support execution of MSDOS, Win32 and OS/2 programs Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed Slide No: 23 Copyright © 2008 ... which capabilities of host machine are made available in virtual machine (VM) * Full virtualization: all capabilities of host are available in VM May lead to lack of security as VM OS cannot... complexity and cost of developing and maintaining an OS by reducing the semantic gap Chapter 14: Structure of Operating Systems Dhamdhere: Operating Systems— A ConceptBased Approach, 2 ed... Instead of having a separate machine for each server, several servers can be made to use the same machine – Disaster management * Transfer a virtual machine from one computer to another for planned