X.Sun (IIT) CS550: Distributed OS Lecture 1 Page 1

36
CS550: Distributed OS Lecture 1 Page 1 X.Sun (IIT) CS550 Distributed Operating Systems (Advanced Operating Systems) Instructor: Xian-He Sun Email: [email protected], Phone: (312) 567-5260 Office hours: 2:10pm-3:10pm Tuesday, 3:30pm-4:30pm Thursday at SB229C, or by appointment TA: Mr. Cui, Zongjie Email: [email protected] Office hours: TBA Blackboard: – http://courseinfo.iit.edu Class Web site – http://www.cs.iit.edu/~sun/cs550.html

Transcript of X.Sun (IIT) CS550: Distributed OS Lecture 1 Page 1

CS550: Distributed OS Lecture 1 Page 1X.Sun (IIT)

CS550• Distributed Operating Systems (Advanced Operating

Systems)• Instructor: Xian-He Sun

– Email: [email protected], Phone: (312) 567-5260– Office hours: 2:10pm-3:10pm Tuesday, 3:30pm-4:30pm Thursday at

SB229C, or by appointment

• TA: Mr. Cui, Zongjie– Email: [email protected]– Office hours: TBA

• Blackboard:– http://courseinfo.iit.edu

• Class Web site– http://www.cs.iit.edu/~sun/cs550.html

CS550: Distributed OS Lecture 1 Page 2X.Sun (IIT)

Structure of OSsFive major intellectual achievements

• Processes• Memory management• Information protection and security• Scheduling and resource management• System structure

CS550: Distributed OS Lecture 1 Page 3X.Sun (IIT)

Process A process is an active entity and is realized by data structure• Process space: each process is assigned a

virtual address space– Text region, the code being executed by the

process– Data region, holding global variables– Stack region, holding execution context of the

program• Threat

– User-level threat, system-level threat

CS550: Distributed OS Lecture 1 Page 4X.Sun (IIT)

CS550: Distributed OS Lecture 1 Page 5X.Sun (IIT)

Memory Management• Main-memory management• Second-storage management• I/O system • Virtual Memory: allows program to address

memory without regard to the amount of mainmemory physically available

CS550: Distributed OS Lecture 1 Page 6X.Sun (IIT)

File Management• A file is a collection of related information defined by

its creator. Commonly, files represent programs (both source and object forms) and data.

• The operating system is responsible for the following activities in connection with file management: File creation and deletion, Directory creation and deletion, Support of primitives for manipulating files and directories, Mapping files onto secondary storage, File backup on stable (nonvolatile) storage media

CS550: Distributed OS Lecture 1 Page 7X.Sun (IIT)

CS550: Distributed OS Lecture 1 Page 8X.Sun (IIT)

Secondary-Storage Management

• Since main memory (primary storage) is volatileand too small to accommodate all data andprograms permanently, the computer systemmust provide secondary storage to back up mainmemory.

• Most modern computer systems use disks as the principle on-line storage medium, for bothprograms and data.

CS550: Distributed OS Lecture 1 Page 9X.Sun (IIT)

I/O Techniques

There are three basic I/O techniques• Programmed I/O: The processor issues an I/O

command on behalf of a process to an I/O module– processor busy waiting– no interrupts

• Interrupt-driven I/O: same as programmed I/O except– processor may continue execution or suspend– use of interrupts

• Direct memory access (DMA): A DMA (I/O) module controls the exchange of data between memory and I/O module

– use of interrupts

CS550: Distributed OS Lecture 1 Page 10X.Sun (IIT)

CS550: Distributed OS Lecture 1 Page 11X.Sun (IIT)

I/O Channels and I/O Processors

The I/O channel (processor) is an extension of the DMA concept

• Able to execute I/O instructions• Direct access both memory and I/O modules• I/O processors have their own memory• Each I/O channel (processor) drive many I/O

controllers– select channel: serve one controller at a time (for high

speed devices)– multiplexor channel: concurrently handle multiple I/O

controllers (for both high and low speed devices)• Each I/O controller may drive many I/O devices

CS550: Distributed OS Lecture 1 Page 12X.Sun (IIT)

CS550: Distributed OS Lecture 1 Page 13X.Sun (IIT)

Protection System

• Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources.

• The protection mechanism must:– distinguish between authorized and unauthorized

usage.– specify the controls to be imposed.– provide a means of enforcement.

CS550: Distributed OS Lecture 1 Page 14X.Sun (IIT)

Hardware Protection• Dual-Mode Operation• I/O Protection• Memory Protection• CPU Protection

CS550: Distributed OS Lecture 1 Page 15X.Sun (IIT)

Dual-Mode Operation

• Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly.

• Provide hardware support to differentiate between at least two modes of operations.1.User mode – execution done on behalf of a user.2.Monitor mode (also kernel mode or system mode)

– execution done on behalf of operating system.

CS550: Distributed OS Lecture 1 Page 16X.Sun (IIT)

I/O Protection

• All I/O instructions are privileged instructions.• Must ensure that a user program could never

gain control of the computer in monitor mode (I.e., a user program that, as part of its execution, stores a new address in the interrupt vector).

CS550: Distributed OS Lecture 1 Page 17X.Sun (IIT)

Use of A System Call to Perform I/O

CS550: Distributed OS Lecture 1 Page 18X.Sun (IIT)

Memory Protection

• Must provide memory protection at least for the interrupt vector and the interrupt service routines.

• In order to have memory protection, add two registers that determine the range of legal addresses a program may access:– Base register – holds the smallest legal physical memory

address.– Limit register – contains the size of the range

• Memory outside the defined range is protected.

CS550: Distributed OS Lecture 1 Page 19X.Sun (IIT)

System Design Goals

• User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast.

• System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient.

CS550: Distributed OS Lecture 1 Page 20X.Sun (IIT)

Any Questions?

CS550: Distributed OS Lecture 1 Page 21X.Sun (IIT)

Distributed Systems

• What is a distributed (computing) system?

“A collection of independent computers that appears to its users as a single coherent system”

-A. Tanenbaum

CS550: Distributed OS Lecture 1 Page 22X.Sun (IIT)

Examples

• Some examples of distributed systems– Department computing cluster– Corporate systems

• Application examples– Email– News– Multimedia information systems- video conferencing– Airline reservation system– Banking system

• What is the most used distributed system?– World Wide Web

CS550: Distributed OS Lecture 1 Page 23X.Sun (IIT)

Distributed vs. Single Systems

• Data sharing– Multiple users can access common database, data files,…

• Device/resource sharing– Printers,servers,CPUs,….

• Communication– Communication with other machines…

• Flexibility– Spread workload to different & most appropriate machines

• Extensibility– Add resources and software as needed

CS550: Distributed OS Lecture 1 Page 24X.Sun (IIT)

Distributed vs. Centralized Systems

• Economics– Microprocessors have better price/performance than

mainframes

• Speed– Collective power of large number of systems

• Geographic and responsibility distribution• Reliability

– One machine’s failure need not bring down the system

• Extensibility– Computers and software can be added incrementally

CS550: Distributed OS Lecture 1 Page 25X.Sun (IIT)

Disadvantages of Distributed Systems

• Software– Little software exists compared to central processing– Complexity of the system: coordination of processes

• Networking– Still slow and can cause other problems (e.g. when

disconnected)• Security

– Data may be accessed by unauthorized users– Authentication, in addition to access and flow control

CS550: Distributed OS Lecture 1 Page 26X.Sun (IIT)

Key Characteristics

• Support for resource sharing• Openness• Concurrency• Scalability• Fault tolerance (reliability)• Transparence

CS550: Distributed OS Lecture 1 Page 27X.Sun (IIT)

Resource Sharing

• Share hardware,software,data and information

• Hardware devices– Printers,disks,memory,…

• Software sharing– Compilers,libraries,toolkits,…

• Data– Databases,files,…

CS550: Distributed OS Lecture 1 Page 28X.Sun (IIT)

Openness

• Determines whether the system can be extended in various ways without disrupting existing system and services

• Hardware extensions – Adding peripherals,memory,communication

interfaces…• Software extensions

– Operating systems features– Communication protocols

• Standard rules and protocols

CS550: Distributed OS Lecture 1 Page 29X.Sun (IIT)

Concurrency

• In a single system several processes are interleaved

• In distributed systems: there are many systems with one or more processors– Many users simultaneously invoke commands or

applications– Many servers processes run concurrently, each

responding to different client request– What is the difference between parallel and

concurrent processing?

CS550: Distributed OS Lecture 1 Page 30X.Sun (IIT)

Scalability

• Scale of system– Few PCs servers ->dept level systems->local area

networks->internetworked systems->wide area network…

– Ideally, system and application software should not change as systems scales

• Scalability depends on all aspects– Hardware– Software– Networks– Application

CS550: Distributed OS Lecture 1 Page 31X.Sun (IIT)

Fault Tolerance• Ability to operate under failures: possibly at a

degraded performance level• Two approaches:

– Hardware redundancy: use of redundant components– Software recovery: design of programs to recover,

Checkpointing/migration

• In distributed systems:– Servers can be replicated– Databases may be replicated– Software recovery involves the design so that state of

permanent data can be recovered

• Fault detection

CS550: Distributed OS Lecture 1 Page 32X.Sun (IIT)

Transparency in a Distributed System

Hide whether a (software) resource is in memory or on diskPersistence

Hide the failure and recovery of a resourceFailure

Hide that a resource may be shared by several competitive usersConcurrency

Hide that a resource may be shared by several competitive usersReplication

Hide that a resource may be moved to another location while in useRelocation

Hide that a resource may move to another locationMigration

Hide where a resource is locatedLocation

Hide differences in data representation and how a resource is accessedAccess

DescriptionTransparency

CS550: Distributed OS Lecture 1 Page 33X.Sun (IIT)

Distributed Operating System

• Manages resources in a distributed system– Seamlessly and transparently to the user

• Looks to the user like a centralized OS– But operates on multiple independent CPUs

• Provides transparency– Location, migration, concurrency, replication,…

• Presents users with a virtual uniprocessor

CS550: Distributed OS Lecture 1 Page 34X.Sun (IIT)

Types of Distributed OSs

Provide distribution transparency

Additional layer atop of NOS implementing general-purpose servicesMiddleware

Offer local services to remote clients

Loosely-coupled operating system for heterogeneous multicomputers (LAN and WAN)

NOS

Hide and manage hardware resources

Tightly-coupled operating system for multi-processors and homogeneous multicomputersDOS

Main GoalDescriptionSystem

An overview of • DOS (Distributed Operating Systems)• NOS (Network Operating Systems)• Middleware

CS550: Distributed OS Lecture 1 Page 35X.Sun (IIT)

Comparison between Systems

OpenOpenClosedClosedOpenness

VariesYesModeratelyNoScalability

Per nodePer nodeGlobal, distributed

Global, centralResource management

Model specificFilesMessagesShared memory

Basis for communication

NNN1Number of copies of OS

NoNoYesYesSame OS on all nodes

HighLowHighVery HighDegree of transparency

Multicomp.Multiproc.

Middleware-based OS

Network OS

Distributed OSItem

CS550: Distributed OS Lecture 1 Page 36X.Sun (IIT)

Summary

• Key issues of distributed systems• Hardware concepts

– Multiprocessors– Multicomputers– Distributed systems

• Software concepts– Uniprocessor OS– Distributed OS– Network OS– Middleware

• Readings– Review Central OS, Chapter 1 of the text