Khoa học máy tính - Chapter 4: Structure of operating systems

Layered design used the principle of abstraction to control complexity of designing the OS The virtual machine operating system (VM OS) supported operation of several OSs on a computer simultaneously Create a virtual machine for each user In a kernel-based design, kernel is the core of the OS, which invokes the nonkernel routines to implement operations on processes and resources A microkernel is the essential core of OS code Policy modules implemented as server processes

ppt35 trang | Chia sẻ: nguyenlam99 | Lượt xem: 820 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu Khoa học máy tính - Chapter 4: Structure of operating systems, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
Chapter 4Structure of Operating SystemsCopyright © 20081Operating Systems, by Dhananjay Dhamdhere*IntroductionOperation of an OSStructure of an Operating SystemOperating Systems with Monolithic StructureLayered Design of Operating Systems2Operating Systems, by Dhananjay Dhamdhere*Introduction (continued)Virtual Machine Operating SystemsKernel-Based Operating SystemsMicrokernel-Based Operating SystemsCase Studies3Operating Systems, by Dhananjay Dhamdhere*Operation of an OSWhen a computer is switched on, boot procedureanalyzes its configuration—CPU type, memory size, I/O devices, and details of other hardwareLoads part of OS in memory, initializes data structures, and hands it control of computer systemDuring operation of the computer, interrupts caused by:An event: I/O completion; end of a time sliceSystem call made by a process (software interrupt)Interrupt servicing routine:Performs context saveActivates event handlerScheduler selects a process for servicing4Operating Systems, by Dhananjay Dhamdhere*Operation of an OS (continued)5Operating Systems, by Dhananjay Dhamdhere*Operation of an OS (continued)6Operating Systems, by Dhananjay Dhamdhere*Structure of an Operating SystemPolicies and MechanismsPortability and Extensibility of Operating Systems7Operating Systems, by Dhananjay Dhamdhere*Policies and MechanismsIn determining how OS will perform a function, designer needs to think at two distinct levels:Policy: Principle under which OS performs functionDecides what should be doneMechanism: Action needed to implement a policyDetermines how to do it and actually does itExample:Round-robin scheduling is a policyMechanisms: maintain queue of ready processes and dispatch a process8Operating Systems, by Dhananjay Dhamdhere*Portability and Extensibility of Operating SystemsPorting: adapting software for use in a new computer systemPortability: ease with which a software program can be portedInversely proportional to the porting effort Porting an OS: changing parts of its code that are architecture-dependent to work with new HWExamples of architecture-dependent data and instructions in an OS:Interrupt vector, memory protection information, I/O instructions, etc.9Operating Systems, by Dhananjay Dhamdhere*Portability and Extensibility of Operating Systems (continued)Extensibility: ease with which new functionalities can be added to a software systemExtensibility of an OS is needed for two purposes:Incorporating new HW in a computer systemTypically new I/O devices or network adaptersProviding new features for new user expectationsEarly OSs did not provide either kind of extensibilityModern OSs facilitate addition of a device driver They also provide a plug-and-play capability10Operating Systems, by Dhananjay Dhamdhere*Operating Systems with Monolithic StructureEarly OSs had a monolithic structureOS formed a single software layer between the user and the bare machine (hardware)11Operating Systems, by Dhananjay Dhamdhere*Operating Systems with Monolithic Structure (continued)Problems with the monolithic structure:Sole OS layer had an interface with bare machineArchitecture-dependent code spread throughout OSPoor portabilityMade testing and debugging difficultHigh costs of maintenance and enhancementAlternative ways to structure an OS:Layered structureKernel-based structureMicrokernel-based OS structure12Operating Systems, by Dhananjay Dhamdhere*Layered Design of Operating SystemsSemantic gap is reduced by:Using a more capable machineSimulating an extended machine in a lower layer13Operating Systems, by Dhananjay Dhamdhere*Layered Design of Operating Systems (continued)Routines of one layer must use only the facilities of the layer directly below itThrough its interfaces only14Operating Systems, by Dhananjay Dhamdhere*Example: Structure of the THE Multiprogramming System15Operating Systems, by Dhananjay Dhamdhere*Layered Design of Operating Systems (continued)Problems:System operation slowed down by layered structureDifficulties in developing a layered designProblem: ordering of layers that require each other’s servicesOften solved by splitting a layer into two and putting other layers between the two halvesStratification of OS functionalitiesComplex designLoss of execution efficiencyPoor extensibility16Operating Systems, by Dhananjay Dhamdhere*Virtual Machine Operating SystemsDifferent classes of users need different kinds of user serviceVirtual machine operating system (VM OS) creates several virtual machinesA virtual machine (VM) is a virtual resource Each VM is allocated to one user, who can use any OSGuest OSs run on each VMVM OS runs in the real machineschedules between guest OSsDistinction between privileged and user modes of CPU causes some difficulties in use of a VM OS17Operating Systems, by Dhananjay Dhamdhere*Example: Structure of VM/37018Operating Systems, by Dhananjay Dhamdhere*Virtual Machine Operating Systems (continued)Virtualization: mapping interfaces and resources of a VM into interfaces and resources of host machineFull virtualization may weaken securityParavirtualization replaces a nonvirtualizable instruction by easily virtualized instructionsCode of a guest OS is modified to avoid use of nonvirtualizable instructions, done by:Porting guest OS to operate under VM OSOr, using dynamic binary translation for kernel of a guest OS19Operating Systems, by Dhananjay Dhamdhere*Virtual Machine Operating Systems (continued)VMs are employed for diverse purposes:Workload consolidationTo provide security and reliability for applications that use the same host and the same OSTo test a modified OS on a server concurrently with production runs of that OSTo provide disaster management capabilities A VM is transferred from a server that has to shutdown to another server available on the network20Operating Systems, by Dhananjay Dhamdhere*Virtual Machine Operating Systems (continued)VMs are also used without a VM OS:Virtual Machine Monitor (VMM)Also called a hypervisorE.g., VMware and XENProgramming Language Virtual MachinesPascal in the 70sSubstantial performance penaltyJavaJava virtual machine (JVM) for security and reliabilityPerformance penalty can be offset by implementing JVM in hardware21Operating Systems, by Dhananjay Dhamdhere*Kernel-Based Operating SystemsHistorical motivations for kernel-based OS structure were OS portability and convenience in design and coding of nonkernel routinesMechanisms implemented in kernel, policies outsideKernel-based OSs have poor extensibility22Operating Systems, by Dhananjay Dhamdhere*Kernel-Based Operating Systems (continued)23Operating Systems, by Dhananjay Dhamdhere*Evolution of Kernel-Based Structure of Operating SystemsDynamically loadable kernel modulesKernel designed as set of modulesModules interact through interfacesBase kernel loaded when system is bootedOther modules loaded when neededConserves memoryUsed to implement device drivers and new system callsUser-level device driversEase of development, debugging, deployment and robustnessPerformance is ensured through HW and SW means24Operating Systems, by Dhananjay Dhamdhere*Microkernel-Based Operating SystemsThe microkernel was developed in the early 1990s to overcome the problems concerning portability, extensibility, and reliability of kernelsA microkernel is an essential core of OS codeContains only a subset of the mechanisms typically included in a kernelSupports only a small number of system calls, which are heavily tested and usedLess essential code exists outside the kernel 25Operating Systems, by Dhananjay Dhamdhere*Microkernel-Based Operating Systems (continued) Microkernel does not include scheduler and memory handler They execute as servers26Operating Systems, by Dhananjay Dhamdhere*Microkernel-Based Operating Systems (continued)Considerable variation exists in the services included in a microkernelOSs using first-generation microkernels suffered up to 50% degradation in throughputL4 microkernel is second-generationMade IPC more efficient by eliminating validity/rights checking by default, and by tuning microkernel to HWOnly 5% degradationExokernel merely provides efficient multiplexing of hardware resourcesDistributed resource managementExtremely fast27Operating Systems, by Dhananjay Dhamdhere*Case StudiesArchitecture of UnixThe Kernel of LinuxThe Kernel of SolarisArchitecture of Windows28Operating Systems, by Dhananjay Dhamdhere*Architecture of Unix Original Unix kernel was monolithic Kernel modules were added later29Operating Systems, by Dhananjay Dhamdhere*The Kernel of LinuxProvides functionalities of Unix System V and BSD Compliant with the POSIX standardMonolithic kernelIndividually loadable modulesA few kernel modules are loaded on bootImprovements in Linux 2.6 kernel:Kernel is preemptibleMore responsive to users and application programsSupports architectures that do not possess a MMUBetter scalability through improved model of threads30Operating Systems, by Dhananjay Dhamdhere*The Kernel of SolarisSunOS was based on BSD UnixSolaris is based on Unix SVR4Since 1980s, Sun has focused on networking and distributed computingFeatures have become standardsRPCNFSLater, Sun focused on multiprocessor systems tooMultithreading the kernel, making it preemptible Fast synchronization techniques in the kernel31Operating Systems, by Dhananjay Dhamdhere*The Kernel of Solaris (continued)Solaris 7 employs the kernel-design methodology of dynamically loadable kernel modulesSupports seven types of loadable modules:Scheduler classesFile systemsLoadable system callsLoaders for different formats of executable filesStreams modulesBus controllers and device driversMiscellaneous modulesProvides easy extensibility32Operating Systems, by Dhananjay Dhamdhere*Architecture of Windows HAL interfaces with the bare machine Environment subsystems support execution of programs written for MS DOS, Win 32 and OS/233Operating Systems, by Dhananjay Dhamdhere*SummaryPortability: ease with which the OS can be implemented on a computer having a different architectureExtensibility: ease with which its functionalities can be modified or enhanced to adapt it to a new computing environmentAn OS functionality typically contains a policy, and a few mechanismsEarly OSs had a monolithic structure34Operating Systems, by Dhananjay Dhamdhere*Summary (continued)Layered design used the principle of abstraction to control complexity of designing the OSThe virtual machine operating system (VM OS) supported operation of several OSs on a computer simultaneouslyCreate a virtual machine for each userIn a kernel-based design, kernel is the core of the OS, which invokes the nonkernel routines to implement operations on processes and resourcesA microkernel is the essential core of OS codePolicy modules implemented as server processes35

Các file đính kèm theo tài liệu này:

  • pptchapter_04_3228.ppt
Tài liệu liên quan