当前位置:
文档之家› 操作系统-精髓与设计原理英文ppt-Chapter02
操作系统-精髓与设计原理英文ppt-Chapter02
8
9
Ease of Evolution of an Operating System
• Hardware upgrades plus new types of hardware • New services
– in response to user demand or in response to the needs of system managers
3
Layers of Computer System
4
Services Provided by Operating Systems
• Program development
– Editors and debuggers
• • • •
Program execution Access to I/O devices Controlled access to files System access
• Accounting
– – – – Collect usage statistics Monitor performance Used to anticipate future enhancements Used for billing purposes
7
Operating Systems as Resource Managers
Operating System Overview
Chapter 2
1
Operating System
• A program that controls the execution of application programs
– A resource management software – Designer viewpoint
5
Services Provided by Operating Systems
• Error detection and response
– Internal and external hardware errors
• Memory error • Device failure
– Software errors
25
Time Sharing
• Using multiprogramming to handle multiple interactive jobs • Processor’s time is shared among multiple users • Multiple users simultaneously access the system through terminals
• Deadlocks
31
Process
• Consists of three components
– An executable program – Associated data needed by the program – Execution context of the program
• All information the operating system needs to manage the process
• Arithmetic overflow • Access forbidden memory locations
– Operating system cannot grant request of application
6
Services Provided by Operating Systems
• Efficiency
– Allows computer system resources to be used in an efficient manner
• Ability to evolve
– Permit effective development, testing, and introduction of new system functions without interfering with service
12
13
Job Control Language (JCL)
• Special type of programming language • Provides instruction to the monitor
– What compiler to use – What data to use
14
• Protection and access control
– Sharing when desirable should be permitted, although it threatens the integrity of the data or even the OS itself
20
Multiprogramming
21
22
Example
1 CPU, 250MB, 1 Disk, 1 Terminal, 1 Printer
23
Utilization Histograms
24
Effects of Multiprogramming
20% 33%
40%
(Mean Turnaround Time)
28
Major Achievements
• • • • • Processes Memory Management Information protection and security Scheduling and resource management System structure
29
Processes
• A program in execution • An instance of a program running on a computer • The entity that can be assigned to and executed on a processor • A unit of activity characterized by a single sequential thread of execution, a current state, and an associated set of system resources
• Fixes
– any OS has faults
10
Evolution of Operating Systems
• Serial Processing
– No operating system – Machines run from a console with display lights, toggle switches, input device, and printer – Schedule time – Setup included loading the compiler, source program, saving compiled program, and loading and linking
32
Process
33
Memory Management
• Process isolation • Automatic allocation and management • Support of modular programming
– Programmer should be allowed to define program modules, their dynamical creation, destruction and size variations
16
Memory Protection
• User program executes in user mode
– Certain instructions may not be executed
• Monitor executes in system mode
– Kernel mode – Privileged instructions are executed – Protected areas of memory may be accessed
26
Batch Multiprogramming versus Time Sharing
27
Compatible Time-Sharing System (CTSS)
• First time-sharing system developed at MIT
Memory: 32000 words Monitor: 5000 words
17
I/O Devices Slow
18
Uniprogramming
• Processor must wait for I/O instruction to complete before preceding
19
Multiprogramming
• When one job needs to wait for I/O, the processor can switch to the other job
30
Difficulties with Designing System Software
• Improper synchronization
– Ensure a process waiting for an I/O device receives the signal
• Failed mutual exclusion • Nondeterminate program operation
11
Evolution of Operating Systems
• Simple Batch Systems
– Monitors