CS 201 Introduction

advertisement
CS 201
Computer Systems Programming
Chapter 1
“CS 201 Introduction”
Herbert G. Mayer, PSU CS
Status 6/12/2014
1
Syllabus
 This is CS 201
 Who is the Instructor?
 Goals of CS 201
 Who are You?
 Grading, Homework, Late Hand-in
 Silver Bullet
 Extra Credit
 Misc & Contacts
 Microsoft Assembler
 Text Books Recommended
2
This is CS 201
 Summer 2014 CS 201, Computer Systems
Programming
 Tuesdays + Thursdays 10:30 – 12:50
 We discuss use of computers from a systems
programmer’s view
 With ultimate goal of learning how to implement
better systems software and build better computers
in the future
 Also how to use current computers efficiently
 Efficient generally means: minimizing the time a
human programmer has to wait for results
 Sometimes efficiency refers to other resource uses,
e.g. memory use, mass storage use, etc.
3
Who is the Instructor?

Instructor is a German immigrant, who worked in the US
computer industry and academia

MS EECS (electrical engineering an computer science)
UCSD 1983; beautiful beach & campus!

PhD CS TU Berlin 1995; awesome city, now united!

Professional focus on compiler optimization, alias analysis,
programming languages, VLIW

PhD Thesis on automatic generation of MP-object code via
source analysis through alias analysis

Retired 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,
and since 1987 PSU
4
Goals of CS 201
• 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 64bit addressing is standard
• Describe HLL translation system, including preprocessing,
assembling, compiling, and linking, plus function of object files
and shared libraries
5
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
6
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
7
Who are You?
Briefly, 2-6 students volunteer to articulate in class,
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
8
Grading, Homework, Late Hand-In
 Acquire up to 1,000 points total = 100%








Upper and lower 15% yield a + or – grade variation
5 homeworks at 150 points each = 750 points
Midterm, in class, in ~week 5
= 250 points
Homework to be emailed before the start of class on
the due date
Homework emails should use the subject line “CS 201
HW x”, where ‘x’ is the homework number
Work that is handed in 1 second up to a day late
experiences 10% deduction of the total points
Each additional day late: another 10% deducted
A Homework that is 5 days late or later is not
accepted
9
Silver Bullet
 One single time each student is allowed to hand in
homework up to 3 days late without penalty
 This is called the CS 201 Silver Bullet
 Silver Bullets cannot be split, traded, or sold on the
black market
 If in the end you did not consume the silver bullet,
you cannot trade it in for cash  or a better grade
 While tracking homework grades, consumption of
the silver bullet is tracked
 Note that the maximally 3 late days worth of Silver
Bullet cannot be applied to 2 different late
homeworks, even if they are both, say, just 1 day
late each
10
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!” 
11
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: herb@cs.pdx.edu
 The Midterm will be on paper; nothing to email
12
Microsoft Assembler masm
Assembler discussed in this class is Microsoft masm:
http://msdn.microsoft.com/enus/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 /?
13
Text Books Recommended
1. Computer Systems: A Programmer's Perspective, 2nd
edition, Bryant and O'Hallaron, Prentice Hall, ISBN13: 978-0-13-610804-7, © 2011
2. The C Programming Language, 2nd edition,
Kernighan and Ritchie, Prentice Hall, ISBN 0-13110362-8, © 1988 or newer
14
Download