operating systems chapter 1 introduction text book: applied operating system concepts by...

35
Operating Systems Chapter 1 Introduction Text book: Applied Operating System Con by Silberschatz, Galvin, and Gagne

Post on 19-Dec-2015

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

Operating Systems

Chapter 1 Introduction

Text book: Applied Operating System Conceptsby Silberschatz, Galvin, and Gagne

Page 2: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

2

Module 1: Introduction

What is an operating system?Simple Batch SystemsMultiprogramming Batched SystemsTime-Sharing SystemsPersonal-Computer Systems Parallel SystemsDistributed SystemsReal -Time Systems

Page 3: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

3

What is an Operating System?

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:

Convenient to use.Efficient operation of the computer system.

§ 1.1

Page 4: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

4

Abstract View of System Components

Page 5: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

5

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).

Page 6: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

6

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.

資源配置

Page 7: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

7

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).

核心程式

Page 8: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

8

Mainframe Systems

Batch systemsMultiprogrammed SystemsTime-Sharing Systems

§ 1.2

Page 9: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

9

Batch Systems

Early computers were (physically) enormously large machines run from a console. The common input devices were card readers and tape drives, and card punches.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.

§ 1.2.1

控制台

Page 10: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

10

Memory Layout for a Simple Batch System

Page 11: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

11

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.

閒置

本質上

工作排程

Page 12: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

12

Multiprogrammed 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.

多程式系統

多路傳輸,多工

§ 1.2.2

Page 13: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

13

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.

Page 14: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

14

Time-Sharing Systems

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.

§ 1.2.3分時系統多工

奉獻,專用

Page 15: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

15

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.

程序

Page 16: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

16

Desktop Systems

MS-DOS from Microsoft has been substituted by Windows and IBM upgraded MS-DOS to the OS/2 multitasking system.Apple Macintosh, ported to more advanced hardware for virtual memory and multitasking.MacOS X, based on Mach and FreeBSD UNIX for scalability, performance and features.Linux

§ 1.3

Page 17: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

17

Multiprocessor Systems

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 throughputEconomical: can share peripherals, mass storage, and power supplies.Increased reliability

graceful degradation Fault tolerant.

§ 1.4

緊密耦合

匯流排

Page 18: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

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

Page 19: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

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

非對稱

Page 20: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

20

Off-load to back-ends

As microprocessors become less expensive and more powerful, additional OS functions are off-loaded 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.

Page 21: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

21

Distributed Systems

Distributed systems depend on networking, a communication path between two or more systems, for their functionality.Networks vary by

Protocols usedDistances between nodesTransport media

分散式系統 § 1.5

TCP/IPATM

Local-area network (LAN)Wide-area network (WAN)Metropolitan-area network (MAN)Small-area network

Copper wiresFiber strandsWireless transmission

Page 22: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

22

Client-Server Systems

Centralized systems today act as server systems to satisfy requests generated by client systems.

Server systems categorized:Compute-server systems

Clients send requests to perform an action and the server execute the action and send back results to the client.

File-server systemsClients can create, update, read and delete files.

§ 1.5.1

Page 23: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

23

Client-Server Systems

General Structure:

Page 24: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

24

Peer-to-Peer Systems

Networks consist of a collection of processors that do not share memory or clock and communicate through communication lines such as buses or phone lines --- loosely coupled systems (or distributed systems).Not only provide connectivity, a network operating system provides features such as

provides file sharing communication scheme for exchange messages.runs independently from other computers on the network

Distributed Operating Systemless autonomy between computersgives the impression there is a single operating system controlling the network.

網路作業系統

分散式作業系統

§ 1.5.2

Page 25: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

25

Clustered Systems

Clustered systems composed of two ore more individual systems coupled together sharing storage and linked closely via LAN.Provide high availability

A layer of cluster software runs on the cluster nodes.Each node monitor one or more of the others.If the monitored machine fails, the monitoring machine can take ownership of its storage, and restart the applications.

§ 1.6

Page 26: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

26

Clustered Systems

Asymmetric ClusteringOne machine is in hot standby mode monitoring the active server while the other machines are running the applications. If the server fails, the hot standby host becomes the active server.

Symmetric ClusteringTwo or more hosts are running applications, and they are monitoring each other.More efficient … uses all available hardware.

Page 27: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

27

Parallel Clustering

Parallel clusters allow multiple hosts to access the same data on the shared storage.Most OS lack support for that and usually accomplished by special software.Ex:

Oracle Parallel ServerEach machine runs Oracle, and a layer of software tracks access to the shared disk. Each machine has full access to all data in the database.

Page 28: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

28

Distributed File Systems

Most systems do not offer general-purpose distributed file systems.Distributed file systems must provide access control and locking to the files to ensure no conflicting operations occur, known as distributed lock manager (DLM)

Page 29: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

29

Storage-Area Network (SAN)

Clustered system should expand greatly as storage-area networks (SANs) become prevalent.SANs allow easy attachment of multiple hosts to multiple storage units.Current clusters are usually limited to two or four hosts due to the complexity of connecting the hosts to shared storage.

Page 30: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

30

Real-Time SystemsUsed 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 correctly only if it returns the correct result within any time constraints.Well-defined fixed-time constraints.

§ 1.7即時系統

Page 31: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

31

Real-Time Systems 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 systemA critical real-time task gets priority over other tasks.Limited utility in industrial control or roboticsUseful in applications (multimedia, virtual reality) requiring advanced operating-system features.

Page 32: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

32

Handheld Systems

Handheld systems include personal digital assistants (PDAs), such as Palm or cellular telephones with connectivity to a network such as the internet.Due to limited size, most handheld devices have

small amount of memoryslow processorssmall display screens.

§ 1.8

Page 33: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

33

Feature Migration

Features that were at one time available on only main frames have been adopted by microcomputers. Example: MULTICS (Figure 1.6)Personal workstation is a large PC – for example, the Sun SPARCstation, the HP/Apollo, the IBM RS/6000, or the Intel Pentium system running Windows NT or a UNIX derivatives.As PCs gain more sophisticated hardware and software, the line dividing the mainframes and microcomputers is blurring.

§ 1.9

Page 34: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

34

Migration of Operating-System Concepts and Features

Page 35: Operating Systems Chapter 1 Introduction Text book: Applied Operating System Concepts by Silberschatz, Galvin, and Gagne

35

Computing Environments § 1.10