1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS...

14
1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Herbert G. Mayer, PSU CS Status 6/12/2014 Status 6/12/2014

Transcript of 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS...

Page 1: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

1

CS 201Computer Systems Programming

Chapter 1“CS 201 Introduction”

Herbert G. Mayer, PSU CSHerbert G. Mayer, PSU CSStatus 6/12/2014Status 6/12/2014

Page 2: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

2

Syllabus This is CS 201This is CS 201

Who is the Instructor?Who is the Instructor?

Goals of CS 201Goals of CS 201

Who are You?Who are You?

Grading, Homework, Late Hand-inGrading, Homework, Late Hand-in

Silver BulletSilver Bullet

Extra CreditExtra Credit

Misc & ContactsMisc & Contacts

Microsoft AssemblerMicrosoft Assembler

Text Books RecommendedText Books Recommended

Page 3: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

3

This is CS 201 Summer 2014 CS 201, Computer Systems Summer 2014 CS 201, Computer Systems

ProgrammingProgramming

Tuesdays + Thursdays 10:30 – 12:50Tuesdays + Thursdays 10:30 – 12:50

We discuss use of computers from a systems We discuss use of computers from a systems programmer’s viewprogrammer’s view

With ultimate goal of learning how to implement With ultimate goal of learning how to implement better systems software and build better computers better systems software and build better computers in the futurein the future

Also how to use current computers efficientlyAlso how to use current computers efficiently

Efficient Efficient generally means: minimizing the time a generally means: minimizing the time a human programmer has to wait for resultshuman programmer has to wait for results

Sometimes efficiency refers to other resource uses, Sometimes efficiency refers to other resource uses, e.g. memory use, mass storage use, etc.e.g. memory use, mass storage use, etc.

Page 4: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

4

Who is the Instructor? Instructor is a German immigrant, who worked in the US Instructor is a German immigrant, who worked in the US

computer industry and academiacomputer industry and academia

MS EECS (electrical engineering an computer science) MS EECS (electrical engineering an computer science) UCSD 1983; beautiful beach & campus!UCSD 1983; beautiful beach & campus!

PhD CS TU Berlin 1995; awesome city, now united!PhD CS TU Berlin 1995; awesome city, now united!

Professional focus on compiler optimization, alias analysis, Professional focus on compiler optimization, alias analysis, programming languages, VLIWprogramming languages, VLIW

PhD Thesis on automatic generation of MP-object code via PhD Thesis on automatic generation of MP-object code via source analysis through alias analysissource analysis through alias analysis

Retired in 2011 after 24 years at Intel Corp. HillsboroRetired in 2011 after 24 years at Intel Corp. Hillsboro Implemented Compilers for systolic array architecture 1980s Managed Intel CPU tuning lab & CPU validation in new Intel

processors

Teaching computer science since 1983 at SDSU San Diego, Teaching computer science since 1983 at SDSU San Diego, and since 1987 PSUand since 1987 PSU

Page 5: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

5

Goals of CS 201

• Understand, use Understand, use computer systems from a software developer’s perspective. Solidify C language programming and some assembly language reading skills

• Show how to measure and improve program performance based on machine architecture. Upon successful completion of this course students will also be able to:

• Describe basic computer system organization including the operating system, specifically processes, files, virtual memory, and underlying hardware, CPU, registers, memory hierarchy

• Discuss in detail how Virtual Memory Management (VMM) worked on early 32-bit architectures; relevant now again that 64-bit addressing is standard

• Describe HLL translation system, including preprocessing, assembling, compiling, and linking, plus function of object files and shared libraries

Page 6: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

6

Goals of CS 201, Cont’d Write C programs to practice systems programming concepts,

including file I/O, system calls, memory management, exception handling and process management

Do arithmetic in hexadecimal, decimal, octal, and binary notation, and convert between these notations

Explain how data types such as integers, characters, floating point numbers, arrays, pointers, and structures are represented internally in computer

Describe the instruction set architecture for Intel x86 and Sun Sparc family, including the arithmetic/logic instructions, registers, memory model and addressing- and control instructions

Explain how high-level programming constructs such as loops and recursive function calls can be implemented in underlying machine code

Page 7: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

7

Goals of CS 201, Cont’d Describe in detail how a data cache functions, and

why it improves performance; emphasis is: locality

Explain how exceptions, traps, and context switches occur and how they are handled at machine level

Explain the performance impact of hardware features in pipelined, superscalar, and MP architectures; explain awesome benefit of locality

Use profiling and timing facilities to identify performance bottlenecks in HLL programs

Describe low-level architecture details of the still emerging Intel x86 architecture

Analyze generated Sparc assembly code

Page 8: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

8

Who are You?

Briefly, 2-6 students volunteer to articulate in class, Briefly, 2-6 students volunteer to articulate in class, explaining:explaining:

Your name Your field of study and current progress Why do you take CS 201? What is your expectation of this class? What is your minimal goal for CS 201? Which is your ideal learning goal? Have you worked in the computer industry? Which computer subjects are you interested in? Anything else relevant to this course

Page 9: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

9

Grading, Homework, Late Hand-In Acquire up to 1,000 points total = 100%Acquire up to 1,000 points total = 100%

Upper and lower 15% yield a + or – grade variationUpper and lower 15% yield a + or – grade variation 5 homeworks at 150 points each 5 homeworks at 150 points each = 750 points= 750 points Midterm, in class, in ~week 5Midterm, in class, in ~week 5 = 250 points= 250 points Homework to be emailed Homework to be emailed before the start of before the start of class on class on

the due datethe due date Homework emails should use the subject line “CS 201 Homework emails should use the subject line “CS 201

HW x”, where ‘x’ is the homework numberHW x”, where ‘x’ is the homework number Work that is handed in 1 second up to a day late Work that is handed in 1 second up to a day late

experiences 10% deduction of the total pointsexperiences 10% deduction of the total points Each additional day late: another 10% deductedEach additional day late: another 10% deducted A Homework that is 5 days late or later is not acceptedA Homework that is 5 days late or later is not accepted

Page 10: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

10

Silver Bullet One single time One single time each student is allowed to hand in each student is allowed to hand in

homework up to 3 days late without penaltyhomework up to 3 days late without penalty

This is called the CS 201 This is called the CS 201 Silver BulletSilver Bullet

Silver Bullets cannot be split, traded, or sold on the Silver Bullets cannot be split, traded, or sold on the black marketblack market

If in the end you did not consume the silver bullet, If in the end you did not consume the silver bullet, you cannot trade it in for cash you cannot trade it in for cash or a better grade or a better grade

While tracking homework grades, consumption of While tracking homework grades, consumption of the silver bullet is trackedthe silver bullet is tracked

Note that the maximally 3 late days worth of Silver Note that the maximally 3 late days worth of Silver Bullet cannot be applied to 2 different late Bullet cannot be applied to 2 different late homeworks, even if they are both, say, just 1 day homeworks, even if they are both, say, just 1 day late eachlate each

Page 11: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

11

Extra Credit Extra Credit: is a way to improve your grade by up to

a half grade, i.e. up to a maximum of 50 points total Extra Credit is granted for good ideas expressed in

class, constructive questions and contributions in class, identifying errors in class material

Volunteers may present the HW or select topics in class, 10 min. each for a few extra credit points

Any error in class material, even the slightest typo –but only pointed out the first time– is worth some extra credit

Presenting smart homework solutions in class can deserves extra credit; you need to volunteer for such presentations proactively

Each time you catch and correct an error made by the instructor you receive extra credit, though the instructor will claim: “This was a deliberate error to test your alertness!”

Page 12: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

12

Misc. & Contacts

Your grader will be introduced in class

Email all HW to the grader, cc Herb; keep original copy of your email

Herb’s email: [email protected] The Midterm will be on paper; nothing to email

Page 13: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

13

Microsoft Assembler masm

Assembler discussed in this class is Microsoft masm: http://msdn.microsoft.com/en-us/library/hb5z4sxd(v=vs.100).aspx

That MS software is available in CS computer Lab as part of Visual Studio

Walk up to a machine and look at the following:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC> ml /?

Page 14: 1 CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS Status 6/12/2014.

14

Text Books Recommended

1. Computer Systems: A Programmer's Perspective, 2nd edition, Bryant and O'Hallaron, Prentice Hall, ISBN-13: 978-0-13-610804-7, © 2011

2. The C Programming Language, 2nd edition, Kernighan and Ritchie, Prentice Hall, ISBN 0-13-110362-8, © 1988 or newer