Top Banner
Compsci 001 9.1 Today’s topics Operating Systems Brookshear, Chapter 3 Slides from Kevin Wayne’s COS 126 course Performance & Computer Architecture Notes from David A. Patterson and John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, Morgan Kaufmann, 1997. http ://computer.howstuffworks.com/pc.htm Slides from Prof. Marti Hearst of UC Berkeley SIMS Slides from Prof. David Patterson of UC Berkeley CS Upcoming Complexity
31

Compsci 001 9.1 Today’s topics l Operating Systems Brookshear, Chapter 3 Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Dec 29, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.1

Today’s topics Operating Systems

Brookshear, Chapter 3 Slides from Kevin Wayne’s COS 126 course

Performance & Computer Architecture Notes from David A. Patterson and John L.

Hennessy, Computer Organization and Design: The Hardware/Software Interface, Morgan Kaufmann, 1997.

http://computer.howstuffworks.com/pc.htm Slides from Prof. Marti Hearst of UC Berkeley SIMS Slides from Prof. David Patterson of UC Berkeley CS Upcoming

Complexity

Page 2: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.2

What is an Operating System?

Examples?

What does it do?

Page 3: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.3

What is an Operating System? United States v. Microsoft Dave Farber [DOJ witness]:

"An Operating System is software that controls the execution of programs on computer systems and may provide low-level services such as resource allocation, scheduling and input-output control in a form which is sufficiently simple and general so that these services are broadly useful to software developers.”

Ed Felten [DOJ Witness]: "An operating system is software that

provides services relating to booting the machine and starting programs, interfacing with the hardware, managing and scheduling use of hardware resources, and basic security services."

Page 4: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.4

What is an Operating System? Jim Allchin [Microosft Witness]

"A computer operating system, like any other type of software, is a set of instructions that causes a computer to carry out specified functions. Although no clear line of demarcation exists between the functions performed by operating system software and other types of software, operating systems generally serve, at a bare minimum, as the computer’s 'central nervous system,' scheduling the execution of tasks by the central processing unit and controlling the flow of information within the computer and between the computer and any peripheral devices that may be attached to it. It is important to bear in mind that all software is a series of instructions to a computer, and terms that have evolved to categorize such software are merely descriptive of general categories of functionality. There is no widely accepted definition of an operating system; it is a concept that has evolved over time based on what is technically possible and what customer[s] have said they want."

Page 5: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.5

What is an Operating System? Judge Thomas Penfield Jackson’s Ruling (2000)

"An ’operating system’ is a software program that controls the allocation and use of computer resources (such as central processing unit time, main memory space, disk space, and input/output channels). The operating system supports the functions of software programs, called ’applications,’ that perform specific user-oriented tasks.”

So what did this definition mean for this case?

What eventually happened?

Page 6: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.6

What is an Operating System? Modern operating systems

support: Software tools for

creating programs• libraries, compilers

Running multiple programs.

• multiprogramming Saving/accessing data.

• files, virtual memory User interaction.

• window system Interaction with other

systems.• networking

Core applications programs.

• client-server

Execution Control.• OS keeps track of

state of CPU, devices.

External Devices.• Display, keyboard,

mouse, disks, CD, network.

Virtual machines• OS presents machine

for each person/program

• OS implements abstract devices

Page 7: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.7

Multiprogramming

Operating system "kernel" keeps track of several programs. CPU does 1 thing at a time. Goal: illusion of multiple machines.

INTERRUPT: Part of hardware of real machines

• stop• save Program Counter (PC) somewhere "special"• change PC

Necessary to manage input-output devices.• mouse click, keyboard

OS allows several programs/processes to "share" CPU by keeping table of "current" PC’s for programs setting clock to interrupt periodically. Context switching round-robin or user priorities

What about multiprocessing?

Page 8: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.8

Virtual Memory

Problem 1: several programs need to share same memory. Direct solution: apportion up the memory.

Problem 2: program needs more memory than machine has. Direct solution: "overlays." program shuffles its own data in and out of memory to

disk"Better" solution: VIRTUAL MEMORY (1960’s).

All programs assume access to all memory. Each program actually uses a small portion.

How many bits is enough to represent address in virtual memory?

Memory hierarchy local: fast, small, expensive remote: slow, huge, cheap

Tradeoff speed for cost.Cache recently accessed information.

Page 9: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.9

Key OS developments Window manager

PARC (Alto), Macintosh, Windows, Web browser? Problems with a virtual view into the system?

Client/server Client: request service. Server: do the work. Examples?

Networking & Distributed systems Multiple systems working together over the Internet

File system Goal: provide simple abstraction (sequence of bytes)

for user programs.

Page 10: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.10

Performance Performance= 1/Time

The goal for all software and hardware developers is to increase performance

Metrics for measuring performance (pros/cons?)

Elapsed time CPU time

• Instruction count (RISC vx. CISC) • Clock cycles per instruction • Clock cycle time

MIPS vs. MFLOPS Throughput (tasks/time) Other more subjective metrics?

What kind of workload to be used? Applications, kernels and benchmarks (toy or synthetic)

Page 11: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.11

The Big Picture

Control

Datapath

Memory

Processor

Input

Output

Since 1946 all computers have had 5 components

The Von Neumann Machine

What is computer architecture?Computer Architecture = Machine Organization + Instruction Set Architecture + ...

Page 12: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.12

Fetch, Decode, Execute Cycle

Computer instructions are stored (as bits) in memory

A program’s execution is a loop Fetch instruction from memory Decode instruction Execute instruction

Cycle time Measured in hertz (cycles per second) 2 GHz processor can execute this cycle up to 2

billion times a second Not all cycles are the same though…

Page 13: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.13

Organization Logic Designer's View

ISA Level

FUs & Interconnect

Capabilities & Performance Characteristics of Principal Functional Units (Fus) (e.g., Registers, ALU, Shifters,

Logic Units, ...) Ways in which these components

are interconnected Information flows between

components Logic and means by which such

information flow is controlled. Choreography of FUs to realize

the ISA

Page 14: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.14

Memory bottleneck

CPU can execute dozens of instruction in the time it takes to retrieve one item from memory

Solution: Memory Hierarchy Use fast memory Registers Cache memory Rule: small memory is fast, large memory is

small

Page 15: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.15

What is Realtime? Response time

Panic• How to tell “I am still computing”• Progress bar

Flicker Fusion frequency

Update rate vs. refresh rate Movie film standards (24 fps projected at 48 fps)

Interactive media Interactive vs. non-interactive graphics

• computer games vs. movies• animation tools vs. animation

Interactivity real-time systems• system must respond to user inputs without any

perceptible delay (A Primary Challenge in VR)

Page 16: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.16

A great idea in computer science Temporal locality

Programs tend to access data that has been accessed recently (i.e. close in time)

Spatial locality Programs tend to access data at an address near

recently referenced data (i.e. close in space)

Useful in graphics and virtual reality as well Realistic images require significant

computational power Don’t need to represent distant objects as well

Efficient distributed systems rely on locality Memory access time increases over a network Want to acess data on local machine

Page 17: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.17

Instruction Set Architecture... the attributes of a [computing] system as seen by

the programmer, i.e. the conceptual structure and functional behavior, as distinct from the organization of the data flows and controls the logic design, and the physical implementation.

– Amdahl, Blaaw, and Brooks, 1964

SOFTWARESOFTWARE-- Organization of Programmable Storage

-- Data Types & Data Structures: Encodings & Representations

-- Instruction Set

-- Instruction Formats

-- Modes of Addressing and Accessing Data Items and Instructions

-- Exceptional Conditions

Page 18: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.18

The Instruction Set: a Critical Interface

instruction set

software

hardware

What is an example of an Instruction Set architecture?

Page 19: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.19

Forces on Computer Architecture

ComputerArchitecture

Technology ProgrammingLanguages

OperatingSystems

History

Applications

Cleverness

Page 20: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.20

Technology

In ~1985 the single-chip processor (32-bit) and the single-board computer emerged => workstations, personal computers,

multiprocessors have been riding this wave since

Now, we have multicore processors

DRAM

Year Size

1980 64 Kb

1983 256 Kb

1986 1 Mb

1989 4 Mb

1992 16 Mb

1996 64 Mb

1999 256 Mb

2002 1 Gb

2004 4 Gb

uP-Name

Microprocessor Logic DensityDRAM chip capacity

Page 21: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.21

Technology => dramatic change Processor

logic capacity: about 30% per year clock rate: about 20% per year

Memory DRAM capacity: about 60% per year (4x every 3

years) Memory speed: about 10% per year Cost per bit: improves about 25% per year

Disk capacity: about 60% per year Total use of data: 100% per 9 months!

Network Bandwidth Bandwidth increasing more than 100% per year!

Page 22: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.22

Performance Trends

Microprocessors

Minicomputers

MainframesSupercomputers

1995

Year

19901970 1975 1980 1985

Lo

g o

f P

erfo

rma

nce

Page 23: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.23

Microprocessor Generations

First generation: 1971-78 Behind the power curve

(16-bit, <50k transistors) Second Generation: 1979-85

Becoming “real” computers (32-bit , >50k transistors)

Third Generation: 1985-89 Challenging the “establishment”

(Reduced Instruction Set Computer/RISC, >100k transistors)

Fourth Generation: 1990- Architectural and performance leadership

(64-bit, > 1M transistors, Intel/AMD translate into RISC internally)

Page 24: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.24

In the beginning (8-bit) Intel 4004

First general-purpose, single-chip microprocessor

Shipped in 1971 8-bit architecture, 4-bit

implementation 2,300 transistors Performance < 0.1 MIPS

(Million Instructions Per Sec)

8008: 8-bit implementation in 1972

3,500 transistors First microprocessor-

based computer (Micral) • Targeted at laboratory

instrumentation• Mostly sold in Europe

All chip photos in this talk courtesy of Michael W. Davidson and The Florida State University

Page 25: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.25

1st Generation (16-bit) Intel 8086

Introduced in 1978 Performance < 0.5

MIPS New 16-bit architecture

“Assembly language” compatible with 8080

29,000 transistors Includes memory

protection, support for Floating Point coprocessor

In 1981, IBM introduces PC Based on 8088--8-bit

bus version of 8086

Page 26: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.26

2nd Generation (32-bit) Motorola 68000

Major architectural step in microprocessors:

First 32-bit architecture• initial 16-bit implementation

First flat 32-bit address• Support for paging

General-purpose register architecture

• Loosely based on PDP-11 minicomputer

First implementation in 1979 68,000 transistors < 1 MIPS (Million

Instructions Per Second) Used in

Apple Mac Sun , Silicon Graphics, &

Apollo workstations

Page 27: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.27

3rd Generation: MIPS R2000

Several firsts: First (commercial) RISC

microprocessor First microprocessor to

provide integrated support for instruction & data cache

First pipelined microprocessor (sustains 1 instruction/clock)

Implemented in 1985 125,000 transistors 5-8 MIPS (Million

Instructions per Second)

Page 28: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.28

4th Generation (64 bit) MIPS R4000

First 64-bit architecture Integrated caches

On-chip Support for off-chip, secondary

cache Integrated floating point Implemented in 1991:

Deep pipeline 1.4M transistors Initially 100MHz > 50 MIPS

Intel translates 80x86/ Pentium X instructions into RISC internally

Page 29: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.29

Key Architectural Trends

Increase performance at 1.6x per year (2X/1.5yr) True from 1985-present

Combination of technology and architectural enhancements Technology provides faster transistors

( 1/lithographic feature size) and more of them Faster transistors leads to high clock rates More transistors (“Moore’s Law”):

• Architectural ideas turn transistors into performance

– Responsible for about half the yearly performance growth Two key architectural directions

Sophisticated memory hierarchies Exploiting instruction level parallelism

Page 30: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.30

Where have all the transistors gone?

Superscalar (multiple instructions per clock cycle)

Execution

Icache

Dcache

branch

TLB

Intel Pentium III (10M transistors)

2 Bus Intf

Out-Of-Order

SS

• Branch prediction (predict outcome of decisions)

• 3 levels of cache

• Out-of-order execution (executing instructions in different order than programmer wrote them)

Page 31: Compsci 001 9.1 Today’s topics l Operating Systems  Brookshear, Chapter 3  Slides from Kevin Wayne’s COS 126 course l Performance & Computer Architecture.

Compsci 001 9.31

Laws?

Define each of the following. What has its effect been on the advancement of computing technology?

Moore’s Law

Amdahl’s Law

Metcalfe’s Law