CS24: Introduction to Computer Systems

37
CALTECH CS24 Spring 2004 -- DeH on CS24: Introduction to Computer Systems Day 1: March 29, 2004 Introduction and Overview

description

CS24: Introduction to Computer Systems. Day 1: March 29, 2004 Introduction and Overview. Today. What Who Why What Detail (Overview) How (Course Details). What. How the computer works below the programming language (mostly above the physics) How processor is organized - PowerPoint PPT Presentation

Transcript of CS24: Introduction to Computer Systems

Page 1: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

CS24:Introduction to

Computer Systems

Day 1: March 29, 2004Introduction and Overview

Page 2: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Today

• What • Who• Why• What Detail (Overview)• How (Course Details)

Page 3: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

What

• How the computer works below the programming language– (mostly above the physics)

• How processor is organized– How your computation is actually

performed• Why is there an Operating System

– And what does it do for you?

Page 4: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

What

• What lies between the – Programming

Language– Physics

• Abstraction Stack

Page 5: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

What • New class

– First time being taught here• Only course in CS undergraduate core that

actually deals with computers as physical machines

• Dynamics / typical case • How we manage computer systems

– Coordinate shared resources– Not just one program

• How do we deal with technology– Technology change

Page 6: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Who?

• Two Instructors– Jason Hickey

• represent high-level view• What does the Programmer want?

– André DeHon• Represent the low-level view• What does the hardware want?

– How does it perform well?

Page 7: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Who?

• TAs:– Michael Wrighton– Cristian Tapus

Page 8: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Why? (low road)

• As programmers: want to understand your tool.– How does it work?– When does it break?– What are those constants we kept ignoring

in CS20, CS38?– How do you get the most out of it?

• Why is this a challenge?

Page 9: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Why?

• As innovators: want to understand the prior art– How does it work?– What’s wrong with it?– How can we make it better?

Page 10: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Why? (high road)

• What problems does it solve?– What are the big ideas that makes this

work?• Is the Instruction Set Architecture (ISA)

abstraction necessary?• Isolation?• Virtualization?• …

Page 11: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Why? (Future)

• This will all break down in the next 10-20 years.– Low-end: Approaching Atomic scale

• Time to pay attention to low-level physics – Sequential processor at end of scaleable life– High-end: Scale of modern systems/software

already stressing (breaking?) model• How do we enable bigger systems?• In critical roles?• Reduce human time?

Page 12: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Why? (Future)• This will all break down in the next 10-20

years.• We’re going to have to rebuild it.

– What were the good/high-level ideas we need to keep? Can and should be transferred?

• You:– May need to help lead the transition– At least need to understand the big ideas to

survive the transition

Page 13: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Why?• We are not learning this to pay homage to

– Bill Gates– Dennis Richie, Ken Thompson– Linus Torvalds– Fred Brooks, Gene Amdahl– John Hennessey, Dave Patterson– Bob Colwell

• Learning this so we can move forward while not repeating the mistakes of the past– Keep the good ideas– Discard the bad ones– Solve problems they didn’t need to…

Page 14: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Back to What

Page 15: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Physics

• Ultimately, we can build machines which compute because the physical world computes F=0,F=ma, F=-kx, … I=0,V=IR, V=(I T)/C,

Id=Is(e[qv/kt]-1)

Page 16: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Devices

• From these phenomena we can build useful devices– Store charge store value– Switch current based on value

Page 17: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Gates

• From these devices we can build gates

Page 18: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Boolean Logic

• From gates we can build any particular boolean function– E.g. o=(a+/b)(b+c)+/b*/c

Day 2

Page 19: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Universal Turing Machine

• From CS21 (CS20), you know we can, in theory, – build a machine which will emulate any

other machines– A Universal Machine…

Page 20: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Programmable Logic

• Likewise, we can build collections of gates which will perform any function

Page 21: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Programmable Machine

• …and ultimately, a machine which can perform (almost) any computable function

Week 2

Page 22: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

How Organize Programmable Machine?

• Theory tells us that we can build such a machine?

• Engineering asks how we should build such a machine

Page 23: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

What’s in here?

Page 24: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Raw Machine

• Even this is pretty raw– add, or, xor, ld, st, br

• How do we make it usable?• Invent conventions:

– Using memory– Representing data– Making procedure calls

Page 25: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Runtime Systems

• Over time, we build up a collection of software necessary to run the machine– Load program– Allocate/deallocate memory– Perform I/O– Handle asynchronous events– …

Page 26: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

It might be nice if…

• Could run more than one program• All the programs didn’t need to know about

each other• Could run more than one program at a time

– Didn’t require a physical processor for each program want to run

• Could use more memory than you have physical RAM

• Could communicate with other programs

Page 27: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

It might be nice if…

• One program crashing didn’t crash the machine

• Could monitor a running (crashed) program

• Could share the machine amongst people (programs) that don’t necessarily know about or trust each other…

Page 28: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Operating System

• …we need some way to virtualize and manage our physical resources

• This is what an Operating System provides

• Most of our programs run in the context of an operating system and an instruction set processor– API: Application Programming Interface

Page 29: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

What

• What lies between the – Programming

Language– Physics

• Abstraction Stack

Page 30: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

How

Page 31: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Course Components

• Text (CS:APP)• Lectures• Recitations

– Fri. 4pm here– Also Fri. 2pm (TBD)

• Homework– 9 weekly labs

• Midterm, final

• Grade: 70% for best 8 of

9 labs 10% midterm 20% final

Page 32: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Resources

• Course Web Page<http://www.cs.caltech.edu/courses/cs24/>

• Administrative handout – Give you all of these details

• Mailing Lists• Forum• Computer Accounts

Page 33: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Pragmatics

• Programming in C and Assembly– First recitation on C– Text has asides for “new” C programmers– …will learn assembly bottom up– …will help C, since C is so close to

assembly…• Online submission systems

Page 34: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Feedback Sheets

• Please fill one out each class– anonymous

• New course– Need to understand what works– So can improve for future lectures– So can improve for future years

Page 35: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

You Action Items

• Get book• Read chapter 1• Find web page• Read administrative handout

– Signup for mailing list, find forum• Get computer account

– If don’t already have one• Read Assignment 1

– Pickup support code

Page 36: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Big Ideas

• Valuable not to program physics directly – (most of the time…)

• Abstraction hierarchy– From programming language to physics

• Valuable to abstract and share resources• Need to Understand Hierarchy

– to make the most of machines– to improve/re-invent

Page 37: CS24: Introduction to  Computer Systems

CALTECH CS24 Spring 2004 -- DeHon

Questions