chapter 6 operating systems overview

22
Chapter 6-- Operating Systems Overview Chapter 6 OPERATING SYSTEMS OVERVIEW 1

Upload: mort

Post on 16-Jan-2016

50 views

Category:

Documents


0 download

DESCRIPTION

Chapter 6 OPERATING SYSTEMS OVERVIEW. WHAT IS AN OPERATING SYSTEM? An interface between users and machine( hardware,software ) - an environment "architecture” Allows convenient usage; hides the tedious stuff Allows efficient usage; parallel activity, avoids wasted cycles - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 1

Chapter 6

OPERATING SYSTEMS OVERVIEW

Page 2: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 2

WHAT IS AN OPERATING SYSTEM?

• An interface between users and machine(hardware,software) - an

environment "architecture”

• Allows convenient usage; hides the tedious stuff

• Allows efficient usage; parallel activity, avoids wasted cycles

• Provides information protection

• Gives each user a slice of the resources

• Acts as a control program.

Page 3: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 3

OPERATING SYSTEM OVERVIEW

The Layers Of A System

Program Interface

Humans

User Programs

O.S. Interface

O.S.

Hardware Interface/ Privileged Instructions

Disk/Tape/Memory

Page 4: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 4

Other Characteristics include:• Time Sharing - multiprogramming environment that's also interactive.

• Multiprocessing - Tightly coupled systems that communicate via shared memory. Used for scientific applications. Used for speed improvement by putting together a number of off-the-shelf processors.

• Distributed Systems - Loosely coupled systems that communicate via message passing. Advantages include resource sharing, speed up, reliability, communication.

• Real Time Systems - Rapid response time is main characteristic. Used in control of applications where rapid response to a stimulus is essential.

Characteristics

Page 5: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 5

Characteristics contd….Interrupts:• Interrupt transfers control to the interrupt service routine generally, through the

interrupt vector, which contains the addresses of all the service routines.• Interrupt architecture must save the address of the interrupted instruction.• Incoming interrupts are disabled while another interrupt is being processed to prevent

a lost interrupt.• A trap is a software-generated interrupt caused either by an error or a user request.• An operating system is interrupt driven.

Page 6: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 6

Very fast storage is very expensive. So the Operating System manages a hierarchy of storage devices in order to make the best use of resources. In fact, considerable effort goes into this support.

Storage Hierarchy

Fast and Expensive

Slow an Cheap

Page 7: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 7

The goal is protecting the Operating System and others from malicious or ignorant users.

The User/Supervisor Mode and privileged instructions.

Concurrent threads might interfere with others. This leads to protection of resources by user/supervisor mode. These resources include:I/O Define I/O instructions as privileged; they can be executed only in Supervisor mode. System calls get us from user to supervisor mode.

Protection

Page 8: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 8

Memory A user program can only access its own logical memory. For instance, it can't modify supervisor code. Depends on an address translation scheme such as that shown here.

Protection

Page 9: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 9

CPU A clock prevents programs from using all the CPU time. This clock causes an interrupt that causes the operating system to gain control from a user program.

Protection

For machines connected together, this protection must extend across:

Shared resources,

Multiprocessor Architectures,

Clustered Systems

The practice of this is called “distributed operating systems”.

Page 10: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 10

Resource ManagementResource Management in DS is concerned with making both local and remote resources available to the user.

Resource Management is roughly divided into three areas:

The program, i.e., the location of the computation, must be able to access data.

These data is generally thought of as being contained in a file that is referenced (open, read, write, modify, etc) by the program.

Hence, one of the issues in data migration is the design of a file system that hides the location of the data with respect to the location of the program.

Network Transparency

1. Data Migration

2. Computation Migration

3. Distributed Scheduling

Page 11: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 11

Resource Management cont’dAnother issue in Data Migration is shared memory access among multiple computers.

Distribute Shared Memory (SHMEM) must guarantee that the consistency of data is maintained.

Think about how SHMEM could be implemented !!

1. How should can we achieve network transparency?

2. How can we manage memory across all computers?

2. Computation Migration:

Here, the computation “moves” to another location, where the data may be available.

Paradigms for computation migration include:

1. Remote Procedure Calls (RPC)

2. Mobile Agents (MA)3. Process Migration

Page 12: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 12

Resource Management cont’dThe fact that jobs (or processes) may be transferred to remote machines requires a distributed scheduling strategy.

Distributed Scheduling must assure that the resources of the entire systems are utilized optimally and must assure that specific job requirements are being met.

This is of even greater importance in GRID computing environments where resources are generally owned and operated by different organizations.

Issues related to distributed scheduling include:

1. Load Balancing

2. Resource Utilization

3. Quality of Service (for Jobs)

4. Cost / Performance Tradeoff

5. Security (maybe)

Page 13: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 13

Networks and CommunicationAny DS is build on top of some

type of Communication Infrastructure.

Remote hosts are connected to sub-networks via switches. Subnets connect to other subnets or a backbone via routers.

We can distinguish different types of networks / network classes:

1. Wide Area Networks2. Local Area Networks3. Metropolitan Area Networks4. Wireless (not really a nw-class)5. Ad-Hoc ( not really a nw-class)

Page 14: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 14

Main Network Types Local Area

Networks (LANs)1. Processors distributed

over small geographical areas, e.g. single building, or neighboring buildings

2. Replacement of large mainframe computer systems

3. High speed, reliability and quality (usually more expensive high quality cables are used)

• Wide Area Networks (WANs)1. Autonomous processors

distributed over large geographical area, e.g. the U.S.

2. Originally as an academic project to provide communication between sites.

3. First WAN: Arpanet

4. Examples: Internet, inter-connection of company sites

5. Subject to slower unreliable channels

Page 15: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 15

DS and Networks

A DS may span as little as a small LAN or as much as multiple WANs.

Different Topologies may determine the structure of algorithms used to facilitate a DS.

1. Ring Topology

2. Star Topology

3. Tree Topology

4. Bus Topology

5. Switched subnets

The concept of topology may be extended beyond the physical layer into the logical structure of the DS.

This structure may be exploited in formulating more efficient communication sequences.

In this course, we will mostly disregard the specific structure of the network and make some simplifying assumption on reliability of the underlying communication.

Page 16: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 16

Communication Naming and

Name Resolution• <host name, identifier>• Host name must be

unique within network. • Domain Name System

(DNS) Name-to-address

resolution Hierarchical system of

name servers Before: all hosts needed

to know all addresses

Routing

1. Fixed routing: fixed

communication path

2. Virtual routing: fixed for

session

3. Dynamic routing: use of

packets; can take link load

into account

Quality of Service (QoS)4. Loss5. Latency

Page 17: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 17

Communication contd Packet Strategies

1. Fixed length messages: packets, frames, datagrams

2. Connectionless unreliable service vs reliable service

• Connection Strategies

1. Circuit switching:

permanent physical link for

session

2. Message switching:

temporary link for

message

3. Packet switching

ContentionCollisions may occur on network

CSMA/CDCarrier Sense with Multiple

Access: check if link is freeCollision Detection: stop

transmitting, wait for random time interval

Token passingUsually in ring structureNode with token may transmit

Message slotsFixed length message slots are

passed (often in ring)

Page 18: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 18

Communication Protocols Modes of

communication1. Asynchronous

1. Large overhead

2. Synchronous1. Set-up phase2. Negotiate communication

parameters

3. Connectionless User Datagram Protocrol (UDP)

4. Connection-oriented Transmission Control Protocol/Internet Protocol (TCP/IP)

International Standards Organization (OSI) layers

1. Physical layer: mechanical and electrical details

2. Data-link layer: handle frames, error detection and recovery

3. Network layer: provide connections, routing

4. Transport layer: Transfer messages between clients, packet order, etc.

5. Session layer: Process-to process communication

6. Presentation layer: Formats, character conversion, etc

Page 19: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 19

Communication PrimitivesUnless the network architecture

provides functions to access the lower layers of the protocol stack, communication primitives are used at the application layer.

Most DS algorithms and protocols assume only 2 primitives:

1. SEND message2. RECEIVE message

We need to distinguish, however, two modes of primitives:

3. Synchronous4. Asynchronous

application

transportnetworkdata linkphysical

application

transportnetworkdata linkphysical

application

transportnetworkdata linkphysical

Page 20: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 20

Communication Primitives

In synchronous communication, a SEND is blocked until a corresponding RECEIVE is executed on the remote machine (or process).

With asynchronous communication, a SEND operation is buffered and the process is not blocked to wait for a corresponding receive.

RPCOne frequently used communication vehicle in DS is the Remote Procedure Call

RPC provides access to functionality that is available on remote hosts.

In the program, the RPC is “identical” to a local procedure call.

The fact that the procedure is actually executed remotely is hidden.

Page 21: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 21

Robustness

Failure Detection1. Hard to distinguish

type of failure in DS1. Link failure2. Site failure3. Message loss

2. Handshaking procedure sending “I-am-up” and “Are-you-up?” messages

1. Combine with time-out scheme

Reconfiguration Assume failure has been

discoveredLink failure: broadcast

informationAssumed site failure, notify

every site in DSPossibly elect new

coordinator siteWhat if site did not really

fail?

Recovery 1. Notify that link is back up

2. Notify that site back up

Page 22: Chapter 6 OPERATING SYSTEMS OVERVIEW

Chapter 6-- Operating Systems Overview 22

References

• www.web.cs.wpi.edu/~jb/CS502/lectures (for operating system)• www.cse.unt.edu/~mikler/Courses/OS/Slides(for Resource management)