CS 201 Computer Systems Programming Chapter 1 “CS 201 Introduction” Herbert G. Mayer, PSU CS status 1/8/2013 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 Contacts Microsoft Assembler Text Books 2 This is CS 201 This is CS 201, Computer Systems Programming Tuesday + Thursday 12:00 – 13:50 UTS 308 We discuss use of computers from a systems programmer’s view With ultimate goal of learning how to build better systems software and computers in the future And using current computers efficiently Efficient generally means: minimizing the time a human programmer has to wait for computed results Sometimes efficiency refers to resource use Electrical power used in a farm of 1000s of high-end servers that require giant air conditioners; warrants turbo boost, sleep mode, job migration 3 Who is the Instructor? Herb is German immigrant, worked in US computer industry and academia MS EECS (electrical engineering an computer science) UCSD 1983; awesome beach & campus! PhD CS TU Berlin 1995; awesome city, now united! Professional focus on compiler optimization, alias analysis, programming languages, VLIW PhD Thesis on automated, safe MP-code generation via source analysis to detect aliases Retired after 24 years at Intel Corp. In Hillsboro Compilers for systolic array architecture 1980s Manager of tuning lab & CPU error elimination in new Intel processors Teaching since 1983 at SDSU San Diego, UCSD, and since 1987 at PSU 4 Goals of CS 201 Understand and use computer systems from a software developer’s perspective. Teach certain C/C++ systems- and assembly language programming and 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: 1. Describe basic computer system organization including the operating system, including processes, files, virtual memory, and underlying hardware, CPU, registers, memory hierarchy 2. Discuss in detail how Virtual Memory Management (VMM) worked on early 32-bit architectures; relevant now again that 64-bit addressing is standard; few machines have 264 bytes physical memory 3. 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 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 7 Who are You? In a few minutes, 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? 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% 5 homeworks at 120 points each = 600 points Midterm, in class, in ~week 6 = 200 points Final, in class, in week ~10 = 200 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 minute up to a day late experiences 10% deduction of the total points Each additional day late: another 10% deducted Homework 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 While tracking homework grades, consumption of the silver bullet is also tracked Note that the 2 days worth of Silver Bullet cannot be applied to 2 different late homeworks, even if they are both just 1 day late 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 get you extra credit; you need to volunteer for such presentations 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 Contacts TA will be shared with Dr. Li’s section 001 of CS 201 Your grader is Kun McKeighan, at mckeig@pdx.edu Midterm and Final will be on paper; nothing to email email your HW to the grader, cc herb, keep your email: herbert.g.mayer@gmail.com or herb@cs.pdx.edu 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 1. Required: Computer Systems: A Programmer's Perspective, 2nd edition, Bryant and O'Hallaron, Prentice Hall, ISBN-13: 978-0-13-610804-7, © 2011 2. Recommended: The C Programming Language, 2nd edition, Kernighan and Ritchie, Prentice Hall, ISBN 013-110362-8, © 1988 or newer 14