1 / 65

Chapter 7

Chapter 7. Operating Systems. O BJECTIVES. Understand the components of an operating system. Understand the concept of virtual memory. Understand the concept of deadlock and starvation. List some of the characteristics of popular operating systems such as Windows 2000, UNIX, and Linux.

Download Presentation

Chapter 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 7 Operating Systems

  2. OBJECTIVES Understand the components of an operating system. Understand the concept of virtual memory. Understand the concept of deadlock and starvation. List some of the characteristics of popular operating systemssuch as Windows 2000, UNIX, and Linux. Define the purpose and functions of an operating system. After reading this chapter, the reader should be able to:

  3. Figure 7-1 Computer System Control the access of hardware by users Used computers Hardware to solve users’ problems.

  4. 7.1 DEFINITION

  5. Operating System A program (set of program) that facilitates the execution of OTHER programs As an INTERFACE between H/W of computer and the user (program/humans) Act as general manager supervising activities of component in computer system

  6. Note: An operating system is an interface between the hardware of a computer and the user (program or human) that facilitates the execution of the other programs and the access to hardware and software resources.

  7. Goals of OS Efficient use of hardware Easy to use resources

  8. 7.2 EVOLUTION

  9. OS evolution Batch Systems Designed in 1950 • control mainframes computers • Input = punched cards Program to be executed = JOB • Output = line printer OS only ensured that all resources transferred form one job to the next • Secondary storage = tape devices

  10. JOB EXECUTION IN BATCH SYSTEM OPERATOR PROGRAMMER Sent a request to OPERATING ROOM JOB Process PUNCH CARD – contains program and data SUCCESS? Result ERROR- printout

  11. Programmable: punch cardsJoseph Jacquard (1752-1834): punch card loom punch card tabulator

  12. TIME SHARING SYSTEMS Use resources efficiently Multiprogramming Time sharing = resources can be shared between different jobs Allocate resources to different program Hold several jobs in memory scheduling Decide which program should use which resource when Only assign a resources to a job that need it  resources availability

  13. INTERACT DIRECLTY user system PROGRAM JOB PROCESS PROGRAM TO BE RUN PROGRAM IN MEMORY AND WAITING FOR RESOURCES

  14. PERSONAL SYSTEMS Single-User Operating Systems DOS= Disk Operating System

  15. PARALLEL SYSTEMS Complex OS More SPEED and efficiency Serve 1 program/part of program MULTIPLE CPUs on same Machine Many tasks can be accomplished in parallel instead of serially

  16. DISTRIBUTED SYSTEMS Networking Internetworking JOB PROGRAM previous now Internet Done all on 1 PC Can be shared between computers (miles apart) RUN partially in one/another pc Need file located everywhere Resources can be distributed

  17. 7.3 COMPONENTS

  18. Essential managers of an operating system: Memory Manager Processor Manager Device Manager File Manager Each manager both works closely with the other managers and performs its unique role User Command Interface is unique to each operating system responsible for communication outside the OS Operating System Software

  19. Operating System Software (continued) Figure 1.1: Model of a non-networkedoperatingsystem

  20. Figure 7-2 Components of an operating system

  21. Each subsystem managermust perform the following tasks: Monitor its resources continuously Enforce the policies that determine who gets what, when, and how much Allocate the resource when it’s appropriate Deallocate the resource when appropriate Operating System Software (continued)

  22. Operating System Software (continued) Figure 1.2: Subsystems managers at the base of a pyramid

  23. MEMORY MANAGER MEMORY Management MEMORY allocation = prevent “running out of memory” syndrome Monoprogramming MEMORY Management Multiprogramming

  24. Figure 7-3 Monoprogramming Belongs to the past, its help you to understand multiprogramming Memory capacity dedicated to ONE single program; only small part needed to hold the OS Whole program is in MEMORY for execution When program finished; replaced by another program

  25. MEMORY MANAGER Load program into memory Runs it Replace with next program PROBLEMS Program must fit memory or CANNOT run No other program can be executed I/O devices slow compared to CPU Inefficient use of memory and CPU If there are I/O operation = CPU idle

  26. Memory Manager: In charge of main memory (RAM) Responsibilities include: Preserves the space in main memory occupied by the operating system Checks the validity of each request for memory space Sets up a table to keep track of who is using which section of memory in a multiuser environment Deallocates memory when the time comes to reclaim the memory Operating System Software (continued)

  27. Figure 7-4 Multiprogramming More than one program in memory at the same time Executed concurrently CPU switches between programs During execution; program can be swapped between memory and disk one or more times.

  28. Figure 7-5 Categories of multiprogramming

  29. Technique used in multiprogramming Memory divided into variable length sections Each sections or program holds one program The CPU switches between program Partitioning

  30. Figure 7-6 Partitioning execution start CPU save address of memory location CPU moves back to 1st program

  31. Issues in Partitioning If size large = might some holes Size of partition determined beforehand by the Memory Mgr If size small = prog cannot loaded into RAM If even perfect= may be some holes after program replaced by other When many holes = MM compact the partition to removes hole But this create overhead on the system

  32. Paging PAGE FRAMES Improves efficiency of partitioning same and equal to block size used by system to retrieve I from storage devices MEMORY divided EQUALLY size section called FRAMES PROGRAM MEMORY PROGRAM divided EQUALLY size section called PAGES FRAME PAGE PAGE PAGE PAGE

  33. Figure 7-7 Paging PROGRAM not contiguous in MEMORY location Adv: NO need for new program to wait until six contiguous frames are free Whole program still needs to be in memory b4 executed

  34. Demand Paging Program divided into pages Pages load into memory 1 by 1; executed and replaces by another page Memory hold one program from multiple program at same time Consecutive pages from same program do not have to be load into same frame Page can be load into any free frame

  35. Demand Segmentation Program divided into segments that match the programmers’ vies Pages load into; executed and replaced by another module from same or different program

  36. Demand Paging and Segmentation Combined to further improved efficiency of the system Memory divide into frames, a module divides into pages The pages module can the be load into memory one by one and executed

  37. Disadvantages of early schemes: Required storing entire program inmemory Fragmentation Overhead due to relocation Evolution of virtual memory helps to: Remove the restriction of storing programs contiguously Eliminate the need for entire program to reside in memoryduring execution Memory Management:Virtual Memory

  38. Figure 7-8 Virtual memory VM= implies demand paging, demand segmentation, or both

  39. State diagram with the boundaries between a program, a job, and a process Figure 7-9 Written by a programmer; store on disk Become a job from the moment it is selected for execution Every JOB is a PROGRAM, but not every PROGRAM is a JOB Program in execution; has started but not finished; a job residing in RAM Every PROCESS is a JOB, but not every JOB is a process

  40. Figure 7-10 Job scheduler Moves a job from the hold state to ready state ; or form running to terminated state Responsible for creating a process from job and terminating process

  41. Figure 7-11 Process scheduler Moves a process from one state to another; running state to waiting state When CPU ready to run the process, PS move the process from ready state to running state

  42. Figure 7-12 Queues for process management Waiting lists: associated with each job or process is a Job Control Block (JCB) or Process Control Block(PCB) that stores information about that job or process Hold process that are in memory; ready to run; waiting for CPU Hold jobs waiting for memory Hold process waiting for I/O device

  43. Figure 7-13 Deadlock

  44. Figure 7-14 Deadlock on a bridge

  45. Condition For Deadlocks Mutual exclusion : only 1 process can hold a resources Resource holding : a process hold a resource even though it cannot use until other resources are available No-preemption: the OS cannot temporarily reallocate a resources Circular waiting: all process and resources involved form a loop

  46. Note: Deadlock occurs when the operatingsystem does not put resource restrictionson processes.

  47. Figure 7-15.a Starvation

  48. Figure 7-15.b Starvation

  49. Figure 7-15.c Starvation

  50. Figure 7-16 Dining philosophers

More Related