Download presentation
Presentation is loading. Please wait.
Published byClifton Bradley Modified over 8 years ago
1
©Brooks/Cole, 2003 Chapter 7 Operating Systems
2
©Brooks/Cole, 2003 Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the concept of virtual memory. Understand the concept of deadlock and starvation. After reading this chapter, the reader should be able to: O BJECTIVES List some of the characteristics of popular operating systems such as Windows 2000, UNIX, and Linux.
3
©Brooks/Cole, 2003 Used computers Hardware to solve users’ problems. Figure 7-1 Computer System Control the access of hardware by users
4
©Brooks/Cole, 2003 DEFINITIONDEFINITION 7.1
5
Operating System As an INTERFACE between H/W of computer and the user (program/humans) A program (set of program) that facilitates the execution of OTHER programs Act as general manager supervising activities of component in computer system
6
©Brooks/Cole, 2003 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. Note:
7
©Brooks/Cole, 2003 Goals of OS Efficient use of hardware Easy to use resources
8
©Brooks/Cole, 2003 EVOLUTIONEVOLUTION 7.2
9
OS evolution Batch Systems Designed in 1950 control mainframes computers Input = punched cards Output = line printer Secondary storage = tape devices Program to be executed = JOB OS only ensured that all resources transferred form one job to the next
10
©Brooks/Cole, 2003 JOB EXECUTION IN BATCH SYSTEM PROGRAMMER Process PUNCH CARD – contains program and data OPERATOR Sent a request to OPERATING ROOM Result ERROR- printout JOB SUCCESS?
11
©Brooks/Cole, 2003 Programmable: punch cards Joseph Jacquard (1752-1834): punch card loom punch card tabulator
12
©Brooks/Cole, 2003 TIME SHARING SYSTEMS Use resources efficiently Multiprogramming Hold several jobs in memory Only assign a resources to a job that need it resources availability Time sharing = resources can be shared between different jobs Allocate resources to different program scheduling Decide which program should use which resource when
13
©Brooks/Cole, 2003 PROCESS user system JOB PROGRAM TO BE RUN PROGRAM IN MEMORY AND WAITING FOR RESOURCES INTERACT DIRECLTY PROGRAM
14
©Brooks/Cole, 2003 PERSONAL SYSTEMS Single-User Operating Systems DOS= Disk Operating System
15
©Brooks/Cole, 2003 PARALLEL SYSTEMS More SPEED and efficiency MULTIPLE CPUs on same Machine Serve 1 program/part of program Complex OS Many tasks can be accomplished in parallel instead of serially
16
©Brooks/Cole, 2003 DISTRIBUTED SYSTEMS Networking Internetworking JOB Can be shared between computers (miles apart) previous Done all on 1 PC now PROGRAM RUN partially in one/another pc Internet Resources can be distributed Need file located everywhere
17
©Brooks/Cole, 2003 COMPONENTSCOMPONENTS 7.3
18
Operating System Software 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
19
©Brooks/Cole, 2003 Operating System Software (continued) Figure 1.1: Model of a non-networked operating system
20
©Brooks/Cole, 2003 Figure 7-2 Components of an operating system
21
©Brooks/Cole, 2003 Operating System Software (continued) Each subsystem manager must 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
22
©Brooks/Cole, 2003 Operating System Software (continued) Figure 1.2: Subsystems managers at the base of a pyramid
23
©Brooks/Cole, 2003 MEMORY MANAGER MEMORY Management MEMORY allocation = prevent “running out of memory” syndrome MEMORY Management Monoprogramming Multiprogramming
24
©Brooks/Cole, 2003 Figure 7-3 Monoprogramming Memory capacity dedicated to ONE single program; only small part needed to hold the OS Belongs to the past, its help you to understand multiprogramming Whole program is in MEMORY for execution When program finished; replaced by another program
25
©Brooks/Cole, 2003 MEMORY MANAGER Load program into memory Runs it Replace with next program Program must fit memory or CANNOT run PROBLEMS No other program can be executed I/O devices slow compared to CPU If there are I/O operation = CPU idle Inefficient use of memory and CPU
26
©Brooks/Cole, 2003 Operating System Software (continued) 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
27
©Brooks/Cole, 2003 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
©Brooks/Cole, 2003 Figure 7-5 Categories of multiprogramming
29
©Brooks/Cole, 2003 Technique used in multiprogramming Memory divided into variable length sections Each sections or program holds one program The CPU switches between program Partitioning
30
©Brooks/Cole, 2003 Figure 7-6 Partitioning start execution CPU save address of memory location CPU moves back to 1 st program
31
©Brooks/Cole, 2003 Issues in Partitioning Size of partition determined beforehand by the Memory Mgr If size small = prog cannot loaded into RAM If size large = might some holes 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
©Brooks/Cole, 2003 Paging Improves efficiency of partitioning MEMORY divided EQUALLY size section called FRAMES PROGRAM divided EQUALLY size section called PAGES same and equal to block size used by system to retrieve I from storage devices PAGEFRAMES PAGE MEMORY FRAME PROGRAM PAGE
33
©Brooks/Cole, 2003 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
©Brooks/Cole, 2003 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 Page can be load into any free frame Consecutive pages from same program do not have to be load into same frame
35
©Brooks/Cole, 2003 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
©Brooks/Cole, 2003 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
©Brooks/Cole, 2003 Memory Management: Virtual Memory Disadvantages of early schemes: –Required storing entire program in memory –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 memory during execution
38
©Brooks/Cole, 2003 Figure 7-8 Virtual memory VM= implies demand paging, demand segmentation, or both
39
©Brooks/Cole, 2003 Figure 7-9 State diagram with the boundaries between a program, a job, and a process 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
©Brooks/Cole, 2003 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
©Brooks/Cole, 2003 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
©Brooks/Cole, 2003 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 jobs waiting for memory Hold process that are in memory; ready to run; waiting for CPU Hold process waiting for I/O device
43
©Brooks/Cole, 2003 Figure 7-13 Deadlock
44
©Brooks/Cole, 2003 Figure 7-14 Deadlock on a bridge
45
©Brooks/Cole, 2003 Condition For Deadlocks Mutual exclusion : only 1 process can hold a resources Circular waiting: all process and resources involved form a loop No-preemption: the OS cannot temporarily reallocate a resources Resource holding : a process hold a resource even though it cannot use until other resources are available
46
©Brooks/Cole, 2003 Deadlock occurs when the operating system does not put resource restrictions on processes. Note:
47
©Brooks/Cole, 2003 Figure 7-15.a Starvation
48
©Brooks/Cole, 2003 Figure 7-15.b Starvation
49
©Brooks/Cole, 2003 Figure 7-15.c Starvation
50
©Brooks/Cole, 2003 Figure 7-16 Dining philosophers
51
©Brooks/Cole, 2003 POPULAROPERATINGSYSTEMSPOPULAROPERATINGSYSTEMS 7.4
52
Brief History of Operating Systems Development 1940s: –Computers based on vacuum tube technology –No standard operating system software –Typical program included every instruction needed by the computer to perform the tasks requested –Machines were poorly utilized CPU processed data and made calculations for only a fraction of the available time –Early programs were designed to use the resources conservatively at the expense of understandability
53
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) Figure 1.6: Remains of the first computer “bug,” a moth
54
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) 1950s: –Placed importance on cost effectiveness – Computers were still very expensive IBM 7094 was priced at $200,000 –Two improvements were widely adopted Computer operators were hired to facilitate each machine’s operation Concept of job scheduling—groups together programs with similar requirements –Expensive time lags between CPU and I/O devices
55
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) Figure 1.7: The IBM 650 Magnetic Drum Data Processing System Machine
56
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) Factors that improved the performance of CPU: –Speed of I/O devices like tape drives, disks, and drums gradually became faster –Records were blocked before they were retrieved or stored –Access methods were developed and added to object code by the linkage editor –Buffer was introduced between I/O and the CPU to reduce the discrepancy in speed –Timer interrupts were developed to allow job- sharing
57
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) 1960s: –Faster CPUs, but their speed caused problems –Multiprogramming was introduced, which allowed loading many programs at one time –Program scheduling, which was begun with second- generation systems, continued at this time –Few advances were made in data management –Total operating system was customized to suit user’s needs
58
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) 1970s: –Faster CPUs, but their speed caused problems –Multiprogramming schemes to increase CPU use were limited by physical capacity of main memory Development of virtual memory to solve physical limitation issue –Database management software became a popular tool –A number of query systems were introduced –Programs started using English-like words, modular structures, and standard operations
59
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) Figure 1.8: Cray I supercomputer, introduced in 1976
60
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) 1980s: –Improvement in the cost/performance ratio of computer components –Hardware became more flexible –Introduction of multiprocessing, which allowed executing programs in parallel –Evolution of personal computers and high-speed communications –Introduction of distributed processing and networked systems
61
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) 1990s: –Demand for Internet capability sparked the proliferation of networking capability –Increased networking also created increased demand for tighter security to protect hardware and software –Multimedia applications, demanding additional power, flexibility, and device compatibility for most operating systems
62
©Brooks/Cole, 2003 Brief History of Operating Systems Development (continued) Figure 1.9: Linked information system by Tim Berners-Lee
63
©Brooks/Cole, 2003 Current Operating Systems Primary design features of current operating systems are based on providing support for –Multimedia applications –Internet and Web access –Client/server computing Computer systems are required to have –Increased CPU speed –High-speed network attachments –Increased number and variety of storage devices
64
©Brooks/Cole, 2003 System Architecture Improvements in system architecture –Use of object-oriented design Possible to modify and customize pieces of an operating system without disrupting the integrity of the remainder of the system Makes software development groups more productive –Reorganization of the operating system’s kernel Limited to a few essential functions
65
©Brooks/Cole, 2003 System Architecture (continued) Figure 1.10: (a) Early operating systems; (b) & (c) Modern object-oriented systems
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.