Operating Systems

Download Report

Transcript Operating Systems

Operating Systems
Chapter 1
Introduction
Text book: Applied Operating System Concepts
by Silberschatz, Galvin, and Gagne
Module 1: Introduction
What is an operating system?
Simple Batch Systems
Multiprogramming Batched Systems
Time-Sharing Systems
Personal-Computer Systems
Parallel Systems
Distributed Systems
Real -Time Systems
2
What is an Operating System?
§ 1.1
A program that acts as an intermediary between a
user of a computer and the computer hardware.
Purpose: provide an environment in which a user
can execute programs.
Primary goals:
Execute user programs and make solving user
problems easier.
Make the computer system convenient to use.
Secondary goal:
Use the computer hardware in an efficient manner.
3
Computer System Components
1. Hardware – provides basic computing resources (CPU,
memory, I/O devices).
2. Operating system – controls and coordinates the use of
the hardware among the various application programs
for the various users.
3. Applications programs – define the ways in which the
system resources are used to solve the computing
problems of the users (compilers, database systems,
video games, business programs).
4. Users – trying to solve different problems (people,
machines, other computers).
4
Abstract View of System
Components
5
Operating System Definitions
資源配置
Resource allocator – manages and
allocates resources. (CPU time, memory
space, file-storage space, I/O devices…)
Since there maybe many – possibly
conflicting – requests for resources, the OS
must decide which requests are allocated
resources so that it can operate the
computer system efficiently and fairly.
6
Operating System Definitions
Control program – controls the execution of
user programs to prevent errors and improper
use of the computer.
It is especially concerned with the
operation and control of I/O devices .
Kernel – the one program running at all times
(all else being application programs).
核心程式
7
Computer Architecture can help
The primary goal of OS – convenient for the
user – and the second goal – efficient – are
sometimes contradictory.
計算機結構
Operating systems and computer architecture
have had a great deal of influence on each other.
As OS were designed and used, it become
obvious that changes in the design of the
hardware could simplify them.
8
Simple Batch Systems
§ 1.2
控制台
Early computers were (physically) enormously
large machines run from a console. The common
input devices were card readers and tape drives.
The major task of OS was to transfer control
automatically from one job to the next.
The OS was always resident in memory.
To speed up processing, operators batched
together jobs with similar needs and ran them
through the computer as a group.
9
Memory Layout for
a Simple Batch System
10
Improving batch system
閒置
In batch system, the CPU is often idle, because
the speeds of the mechanical I/O devices are
本質上 intrinsically slower than are those of electronic
devices.
Disk technology allowed the OS to keep all jobs
on a disk and access them directly. It could do
job scheduling to use resources and perform
tasks efficiently. 工作排程
The most important aspect of job scheduling is
the ability to multiprogram.
11
Multiprogrammed Batch Systems
多程式批次系統
Several jobs are kept in main memory at the
same time, and the CPU is multiplexed among
多路傳輸,多工
them.
Multiprogramming
increases CPU utilization
by organizing jobs such
that the CPU always has
one to execute.
12
OS Features Needed for
Multiprogramming
Job Scheduling – If several jobs are ready to be
brought into memory, and if there is not enough
room for all of them, the the system must choose
among them.
Memory management – the system must
allocate the memory to several jobs.
CPU scheduling – the system must choose
among several jobs ready to run at the same
time.
13
Time-Sharing Systems
分時系統
§ 1.3
多工
Time sharing, or multitasking, is a logical
extension of multiprogramming.
An interactive, or hands-on, computer system
provides direct communication between the user
and the system.
A time-shared OS allows the many users to
share the computer simultaneously. As the
system switches rapidly from one user to the
next, each user is given the impression that the
entire computer system is dedicated to her use.
奉獻,專用
14
Time-Sharing Systems
A program that is loaded into memory and is 程序
executing is commonly referred to as a process.
When a process executes, it typically executes
for only a short time before it either finishes or
needs to perform I/O.
Rather than let the CPU sit idle when I/O takes
place, the OS will rapidly switch the CPU to the
program of some other user.
Although some batch processing is still done,
most systems today are time sharing.
15
Personal-Computer Systems
§ 1.4
Personal computers – computer system dedicated to a
single user. Example OS: Microsoft Windows, Apple
Macintosh, OS/2, Linux.
Features that were at one time available on only main
frames have been adopted by microcomputers.
Example: MULTICS.
Personal workstation is a large PC – for example, the
Sun SPARCstation, the HP/Appolo, the IBM RS/6000,
or the Intel Pentium system running Windows NT or a
UNIX derivatives.
16
Migration of Operating-System Concepts
and Features
17
Parallel Systems
§ 1.5
Multiprocessor systems with more than one CPU in
close communication.緊密耦合
Tightly coupled system – processors sharing the
computer bus, the clock, and sometimes memory and
peripheral devices. 匯流排
Advantages of parallel system:
Increased throughput
Economical: can share peripherals, mass storage, and power
supplies.
Increased reliability


graceful degradation
Fault tolerant.
18
Symmetric Multiprocessing (SMP)
Each processor runs an identical copy of the
operating system, and these copies
communicate with one another as needed.
Many processes can run at once without
performance deterioration.
Most modern operating systems support SMP
19
Asymmetric Multiprocessing
非對稱
Each processor is assigned a specific task;
master processor schedules and allocates work
to slave processors.
This scheme defines a master-slave relationship.
More common in extremely large systems
20
Off-load to back-ends
As microprocessors become less expensive and
more powerful, additional OS functions are offloaded to slave processors, or back-ends.
For example: add a microprocessor with its own
memory to manage a disk system.
This use of microprocessors has become so
common that it is no longer considered
multiprocessing.
21
Real-Time Systems
§ 1.6
Used when there are rigid time requirements on the
operation of a processor or the flow of data.
Often used as a control device in a dedicated
application such as controlling scientific experiments,
medical imaging systems, industrial control systems,
and some display systems.
Processing must be done within the defined constraints,
or the system will fail.
A real-time system is considered to function corretly
only if it returns the correct result within any time
constraints.
Well-defined fixed-time constraints.
22
Real-Time Systems
即時系統
§ 1.6
Hard real-time system.
Secondary storage limited or absent, data stored in
short-term memory, or read-only memory (ROM)
Conflicts with time-sharing systems, not supported
by general-purpose operating systems.
Soft real-time system
A critical real-time task gets priority over other tasks.
Limited utility in industrial control or robotics
Useful in applications (multimedia, virtual reality)
requiring advanced operating-system features.
23
Distributed Systems
分散式系統
Distribute the computation among several physical
processors.
Loosely coupled system – each processor has its own
local memory; processors communicate with one
another through various communications lines, such as
high-speed buses or telephone lines.
Advantages of distributed systems.
Resources Sharing
Computation speed up – load sharing
Reliability
Communications
24
Distributed Systems
Network Operating System
網路作業系統
provides file sharing
provides communication scheme
runs independently from other computers on the
network
Distributed Operating System
分散式作業系統
less autonomy between computers
gives the impression there is a single operating
system controlling the network.
25