introduction csci 444/544 operating systems fall 2008

23
Introduction CSCI 444/544 Operating Systems Fall 2008

Upload: harold-andrews

Post on 16-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction CSCI 444/544 Operating Systems Fall 2008

Introduction

CSCI 444/544 Operating Systems

Fall 2008

Page 2: Introduction CSCI 444/544 Operating Systems Fall 2008

Agenda

Course overview

- course coverage

- course workload

OS overview• What is an operating system?

• How have operating systems evolved?

• Why study operating systems?

Page 3: Introduction CSCI 444/544 Operating Systems Fall 2008

Course Coverage

- What are the major components of an OS?

- How are the components structured?

- What policies are typically used in an OS?

- What algorithms (mechanisms) are used to implement policies

Page 4: Introduction CSCI 444/544 Operating Systems Fall 2008

Course Workload

Four programming projects

Two exams (open book and notes)

A few homework assignments (paper and pen)

Page 5: Introduction CSCI 444/544 Operating Systems Fall 2008

What is an Operating System?

OS:Everything in system that isn’t an application or hardware

OS:Software that converts hardware into a useful form for applications

Not easy to define precisely…

Users

Hardware

Operating System

Applicationscompilersdatabasesword processors

CPUmemoryI/O devices

Page 6: Introduction CSCI 444/544 Operating Systems Fall 2008

Abstract View of Computer Systems

Page 7: Introduction CSCI 444/544 Operating Systems Fall 2008

What is an Operating System?

A software layer to abstract away and manage messy details of hardware resources, providing an extended machine: easy and safe

A resource manager that allows programs/users to share the hardware resources: fair and efficient

A set of utilities to simplify application development

Page 8: Introduction CSCI 444/544 Operating Systems Fall 2008

What is the role of the OS?

Role #1: Provide standard Library (I.e., abstract resources)

What is a resource?• Anything valuable (e.g., CPU, memory, disk)

Advantages of standard library• Allow applications to reuse common facilities• Make different devices look the same• Provide higher-level abstractions

Challenges• What are the correct abstractions?• How much of hardware should be exposed?

Page 9: Introduction CSCI 444/544 Operating Systems Fall 2008

What is the role of the OS?

Role #2: Resource manager

Advantages of resource manager• Virtualize resources so multiple users or applications

can share• Protect applications from one another• Provide efficient and fair access to resources

Challenges• What are the correct mechanisms?• What are the correct policies?

Page 10: Introduction CSCI 444/544 Operating Systems Fall 2008

Mechanism and Policy

Operating system: mechanism + policy• Mechanisms: data structures and operations that

implement an abstraction

• Policies: the procedures that guide the selection of a certain course of action from among alternatives

Separate mechanisms from policies as much as possible

Page 11: Introduction CSCI 444/544 Operating Systems Fall 2008

System Abstraction: Processes

A process is a system (a running program) abstraction.Illusion of being the only job in the system

Mechanism: Creation, destruction, suspension, context switch, signaling, IPC,etc

Policy:• Minor policy questions:

– Who can create/destroy/suspend processes?– How many active processes can each user have?

• Major policy question that we will concentrate on:– How to share system resources between multiple processes?– Typically broken into a number of orthogonal policies for individual

resource such as CPU, memory, and disk.

Page 12: Introduction CSCI 444/544 Operating Systems Fall 2008

Other Abstractions

A thread is a processor abstraction

Virtual memory is a memory abstraction

A file system is a storage abstraction

Message passing is a communication abstraction

Page 13: Introduction CSCI 444/544 Operating Systems Fall 2008

History of the OS

Two distinct phases of history• Phase 1: Computers are expensive

– Goal: Use computer’s time efficiently– Maximize throughput (I.e., jobs per second)– Maximize utilization (I.e., percentage busy)

• Phase 2: Computers are inexpensive– Goal: Use people’s time efficiently– Minimize response time

Page 14: Introduction CSCI 444/544 Operating Systems Fall 2008

First commercial systems

1950s Hardware• Enormous, expensive, and slow• Input/Output: Punch cards and line printers

Goal of OS• Get the hardware working• Single operator/programmer/user runs and debugs interactively

OS Functionality• Standard library only (no sharing or coordination of resources)

Advantages• Worked and allowed interactive debugging

Problems• Inefficient use of hardware (throughput and utilization)

Page 15: Introduction CSCI 444/544 Operating Systems Fall 2008

Batch Processing

Goal of OS: Better throughput and utilizationBatch: Group of jobs submitted together

• Operator collects jobs; orders efficiently; runs one at a time

Advantages• Amortize setup costs over many jobs• Operator more skilled at loading tapes• Keep machine busy while programmer thinks• Improves throughput and utilization

Problems• User must wait until batch is done for results• Machine idle when job is reading from cards and writing to printers

Page 16: Introduction CSCI 444/544 Operating Systems Fall 2008

SpoolingCPUs were much faster than card readers and printersDisks were invented – disks were much faster than card

readers and printers

So, what do we do? Pipelining … what else?• Read job 1 from cards to disk. Run job 1 while reading job 2 from

cards to disk; save output of job 1 to disk. Print output of job 1 while running job 2 while reading job 3 from cards to disk. And so on …

• This is known as spooling: Simultaneous Peripheral Operation On-Line

Can use multiple card readers and printers to keep up with CPU if needed

Improves both system throughput and response time

Page 17: Introduction CSCI 444/544 Operating Systems Fall 2008

Multiprogrammed Batch Systems

Observation: Spooling provides pool of ready jobs

Goal of OS• Improve performance by always running a job• Keep multiple jobs resident in memory• When job waits for disk I/O, OS switches to another job

OS Functionality• Job scheduling policies• Memory management and protection

Advantage: Improves throughput and utilization

Page 18: Introduction CSCI 444/544 Operating Systems Fall 2008

Inexpensive Peripherals (Time-Sharing)

1960s Hardware• Expensive mainframes, but inexpensive keyboards and monitors• Enables text editors and interactive debuggers

Goal of OS• Improve user’s response time

OS Functionality• Time-sharing: switch between jobs to give appearance of

dedicated machine• More complex job scheduling• Concurrency control and synchronization

Advantage• Users easily submit jobs and get immediate feedback

Page 19: Introduction CSCI 444/544 Operating Systems Fall 2008

Inexpensive Personal Computers

1980s Hardware• Entire machine is inexpensive• One dedicated machine per user

Goal of OS• Give user control over machine

OS Functionality• Remove time-sharing of jobs, protection, and virtual memory

Advantages• Simplicity• Works with little main memory• Machine is all your own (performance is predictable)

Disadvantages• No time-sharing or protection between jobs

Page 20: Introduction CSCI 444/544 Operating Systems Fall 2008

Inexpensive, Powerful Computers

1990s+ Hardware• PCs with increasing computation and storage• Users connected to the web

Goal of OS• Allow single user to run several applications

simultaneously• Provide security from malicious attacks• Efficiently support web servers

OS Functionality• Add back time-sharing, protection, and virtual memory

Page 21: Introduction CSCI 444/544 Operating Systems Fall 2008

Specific OS Systems

Real-time OS• Hard real-time system• Soft real-time system

Distributed OS• Clusters• Wide-area distributed systems

Embedded OS• Mobile devices • Sensors• Dedicated controllers

Page 22: Introduction CSCI 444/544 Operating Systems Fall 2008

OS Components

Kernel: Core components of the OS

Process scheduler• Determines when and for long each process executes

Memory manager• Determines when and how memory is allocated to processes• Decides what to do when main memory is full

File system• Organizes named collections of data in persistent storage

Networking• Enables processes to communicate with one another

Page 23: Introduction CSCI 444/544 Operating Systems Fall 2008

Why study Operating Systems?

Build, modify, or administer an operating system

Understand system performance• Behavior of OS impacts entire machine• Challenge to understand large, complex system• Tune workload performance• Apply knowledge across many areas

– Computer architecture, programming languages, data structures and algorithms, and performance modeling