Carnegie Mellon Course Overview Computer Systems Organization (Fall 2014) Section 001 (Honors) and Section 002 (Regular) Professor Andrew Case Teaching.

Slides:



Advertisements
Similar presentations
Computer Systems & Programming (CS 367) Section 002: Prof. Elizabeth White Spring 2010.
Advertisements

Fall 2011SYSC 5704: Elements of Computer Systems 1 SYSC 5704 Elements of Computer Systems Optimization to take advantage of hardware.
Computers in Principle & Practice I - V Deena Engel Computers in Principle and Practice I V , Sections 1 & 2 Fall, 2009 Deena Engel .
1 Carnegie Mellon The course that gives CMU its “Zip”! Course Overview : Introduction to Computer Systems 1 st Lecture, Aug. 24, 2010 Instructors:
University of Washington The Hardware/Software Interface CSE351 Spring st Lecture, March 28 Instructor: Luis Ceze Teaching Assistants: Aaron Miller,
Introduction to Computer Systems Topics: Theme Five great realities of computer systems How this fits within CS curriculum S ‘08 class01a.ppt
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Lab rationale and infrastructure F ’08 class01b.ppt.
Introduction to Computer Systems* Topics: Theme Five great realities of computer systems How this fits within CS curriculum F ’07 class01a.ppt
COMP 14 – 02: Introduction to Programming Andrew Leaver-Fay August 31, 2005 Monday/Wednesday 3-4:15 pm Peabody 217 Friday 3-3:50pm Peabody 217.
CS 213 Introduction to Computer Systems Course Organization David O’Hallaron August 28, 2001 Topics: Staff, text, and policies Lecture topics and assignments.
COMP 321: Introduction to Computer Systems Scott Rixner Alan L. Cox
1 Carnegie Mellon The course that gives CMU its “Zip”! Course Overview /18-213: Introduction to Computer Systems 1 st Lecture, Jan. 14, 2014 Instructors:
1 Carnegie Mellon The course that gives CMU its “Zip”! Course Overview (18-213): Introduction to Computer Systems 1 st Lecture, Aug. 27, 2013 Instructors:
The course that gives CMU its “Zip”!
CS 270 CS 270: Computer Organization Course Overview Instructor: Professor Stephen P. Carl.
Welcome to CS 3260 Dennis A. Fairclough. Overview Course Canvas Web Site Course Materials Lab Assignments Homework Grading Exams Withdrawing from Class.
COURSE OVERVIEW COMPUTER ARCHITECTURE AND ORGANIZATION Instructor: Professor Emmett Witchel.
(1) ECE 8823: GPU Architectures Sudhakar Yalamanchili School of Electrical and Computer Engineering Georgia Institute of Technology NVIDIA Keplar.
Lecture 0: Introduction EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Fall 2012, Dr. Rozier.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
Carnegie Mellon Course Overview Computer Systems Organization (Fall 2015) Instructor: Jinyang Li.
Lec 1Systems Architecture1 Systems Architecture Lecture 1: Random Access Machines Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some material.
1 Carnegie Mellon The course that gives CMU its “Zip”! Course Overview (18-213): Introduction to Computer Systems 1 st Lecture, Aug. 26, 2014 Instructors:
1 Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Third Edition Carnegie Mellon The course that gives CMU its “Zip”! Course Overview.
Assembly Language and Computer Organization Topics: Theme Programming in C Great realities of computer systems How this fits within CS curriculum Logistical.
Course Information Andy Wang Operating Systems COP 4610 / CGS 5765.
Assembly Language and Computer Organization Topics: Theme Programming in C Great realities of computer systems How this fits within CS curriculum Logistical.
Introduction to Computer Systems Topics: Theme Five great realities of computer systems How this fits within CS curriculum Logistical issues F ‘08.
Introduction to Computer Systems Topics: Theme Five great realities of computer systems (continued) “The class that bytes”
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Lab rationale and infrastructure CS 213 F ’03 class01b.ppt.
11/21/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Sam King and Andrew.
1 Carnegie Mellon The course that gives CMU its “Zip”! Course Overview (18-213): Introduction to Computer Systems 1 st Lecture, Aug. 28, 2012 Instructors:
Introduction to Computer Systems Topics: Staff, text, and policies Lecture topics and assignments Lab rationale CS 213 F ’02 class01b.ppt “The Class.
ACIS 3504 Accounting Systems and Controls. 2 Dr. Linda Wallace  Office: Pamplin 3092  
Introduction to Computer Systems Topics: Theme Five great realities of computer systems How this fits within CS curriculum F ’06 class01a.ppt
Computer Organization II Topics: Theme Five great realities of computer systems How this fits within CS curriculum CS 2733.
Assembly Language and Computer Organization Topics: Theme Programming in C Great realities of computer systems How this fits within CS curriculum Logistical.
Course Overview CENG331 - Computer Organization
1 Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Third Edition Carnegie Mellon Overview Course theme Five realities How the course.
CS 213 Introduction to Computer Systems Course Organization David O’Hallaron August 25, 1998 Topics: Staff, text, and policies Lecture topics and assignments.
Course Information CSE 2031 Fall Instructor U. T. Nguyen /new-yen/ Office: CSEB Office hours:  Tuesday,
1 CS/ECE 354 Fall 2013 “New, and improved!”. 2 Karen Miller Phone: CS.
1 Bryant and O’Hallaron, Computer Systems: A Programmer’s Perspective, Third Edition Carnegie Mellon Course Overview Introduction to Computer Systems 1.
Course Information EECS 2031 – Section A Fall 2017.
Course Overview CSE 238/2038/2138: Systems Programming
The course that gives CMU its “Zip”!
Final exam: Wednesday, March 20, 2:30pm
Computer Organization II
CS 213 Introduction to Computer Systems Course Organization Todd C
Computer Systems & Programming (CS 367)
Course Overview CSCI 2400/ ECE 3217: Computer Architecture
Course Overview CENG331 - Computer Organization
Computer Systems: A Programmer’s Perspective aka: CS:APP
Course Information Mark Stanovich Principles of Operating Systems
Course Overview Computer Systems Organization (Fall 2016)
Topics: Staff, text, and policies Lecture topics and assignments
Assembly Language and Computer Organization
Assembly Language and Computer Organization
Computer Systems Summary
Andy Wang Operating Systems COP 4610 / CGS 5765
Introduction to Computer Systems
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
Overview Course theme Five realities
Introduction to Computer Systems
Andy Wang Operating Systems COP 4610 / CGS 5765
CS-2011 — Machine Organization and Assembly Language
Andy Wang Operating Systems COP 4610 / CGS 5765
CS201 – Course Expectations
Presentation transcript:

Carnegie Mellon Course Overview Computer Systems Organization (Fall 2014) Section 001 (Honors) and Section 002 (Regular) Professor Andrew Case Teaching Assistants: Paige Connelly & TBD Slides adapted from Jinyang Li, Mohamed Zahran, Randy Bryant and Dave O’Hallaron

Not that kind of organization

This class adds to your CV… C programming UNIX X86 assembly Low level debugging Reverse engineering Not what the class is about either

What this class is about Those details that set hackers apart from novice programmers – How your program runs on the hardware – Why it fails – Why it is slow Modern computer systems are shrouded in layers of abstraction

Many layers of abstraction

Course Theme: Abstraction Is Good But Don’t Forget Reality Most CS classes emphasize abstraction This class peeks “under-the-hood’’ in those layers Goal: – Make you more effective programmers Debug problems Tune performance – Prepare you for later “systems” classes in CS Compilers Operating Systems Networks Computer Architecture Distributed Systems

Reality #1: Ints are not Integers, Floats are not Reals = 32768? x 2 ≥ 0? (x + y) + z = x + (y + z)? Source: xkcd.com/571

Carnegie Mellon Reality #2: You’ve Got to Know Assembly Little programming in assembly Knowledge of assembly helps one understand machine-level execution – Debugging – Performance tuning – Writing system software (e.g. compilers, OS) – Reverse engineering software Creating / fighting malware – x86 assembly is the language of choice!

Carnegie Mellon Reality #3: Memory Matters Memory is not unbounded – It must be allocated and managed Memory referencing bugs especially wicked Memory performance is not uniform – Cache and virtual memory effects can greatly affect performance

Carnegie Mellon Memory Referencing Errors C/C++ let programmers make memory errors – Out of bounds array references – Invalid pointer values – Double free, use after free Errors can lead to nasty bugs – Corrupt program objects – Effect of bug observed long after the corruption – Security vulnerabilities

Carnegie Mellon Memory Referencing Bug Example double fun(int i) { double d[1] = {3.14}; int a[2]; a[i] = ; /* Possibly out of bounds */ return d[0]; } fun(0) ➙ 3.14 fun(1) ➙ 3.14 fun(2) ➙ ? fun(3) ➙ ? fun(4) ➙ ?

Carnegie Mellon Code Security Example There are legions of smart people trying to find vulnerabilities in programs /* Kernel memory region holding user-accessible data */ #define KSIZE 1024 char kbuf[KSIZE]; /* Copy at most maxlen bytes from kernel region to user buffer */ int copy_from_kernel(void *user_dest, int maxlen) { /* Byte count len is minimum of buffer size and maxlen */ int len = KSIZE < maxlen ? KSIZE : maxlen; memcpy(user_dest, kbuf, len); return len; }

Carnegie Mellon Typical Usage /* Kernel memory region holding user-accessible data */ #define KSIZE 1024 char kbuf[KSIZE]; /* Copy at most maxlen bytes from kernel region to user buffer */ int copy_from_kernel(void *user_dest, int maxlen) { /* Byte count len is minimum of buffer size and maxlen */ int len = KSIZE < maxlen ? KSIZE : maxlen; memcpy(user_dest, kbuf, len); return len; } #define MSIZE 528 void getstuff() { char mybuf[MSIZE]; copy_from_kernel(mybuf, MSIZE); printf(“%s\n”, mybuf); }

Carnegie Mellon Malicious Usage #define MSIZE 528 void getstuff() { char mybuf[MSIZE]; copy_from_kernel(mybuf, -MSIZE);... } /* Kernel memory region holding user-accessible data */ #define KSIZE 1024 char kbuf[KSIZE]; /* Copy at most maxlen bytes from kernel region to user buffer */ int copy_from_kernel(void *user_dest, int maxlen) { /* Byte count len is minimum of buffer size and maxlen */ int len = KSIZE < maxlen ? KSIZE : maxlen; memcpy(user_dest, kbuf, len); return len; }

Carnegie Mellon Reality #4: Asymptotic performance analysis (e.g. Big O) is not always sufficient Constant factors matter Even operation count might not predict performance Must understand system to optimize performance – How programs compiled and executed – How to measure performance and identify bottlenecks – How to improve performance without destroying code modularity and generality

Carnegie Mellon Memory System Performance Example Performance depends on access patterns void copyji(int src[2048][2048], int dst[2048][2048]) { int i,j; for (j = 0; j < 2048; j++) for (i = 0; i < 2048; i++) dst[i][j] = src[i][j]; } void copyij(int src[2048][2048], int dst[2048][2048]) { int i,j; for (i = 0; i < 2048; i++) for (j = 0; j < 2048; j++) dst[i][j] = src[i][j]; } 21 times slower (Pentium 4)

Carnegie Mellon Example Matrix Multiplication Standard desktop computer and compiler Both implementations have exactly the same operations count (2n 3 ) Matrix-Matrix Multiplication (MMM) on 2 x Core 2 Duo 3 GHz (double precision) Gflop/s 160x Triple loop Best code (K. Goto)

Carnegie Mellon MMM Plot: Analysis Matrix-Matrix Multiplication (MMM) on 2 x Core 2 Duo 3 GHz Gflop/s Memory hierarchy and other optimizations: 20x Vector instructions: 4x Multiple threads: 4x Reason for 20x: Blocking or tiling, loop unrolling, array scalarization Effect: fewer register spills, L1/L2 cache misses, and TLB misses

Carnegie Mellon Course Perspective Most Systems Courses are Builder-Centric (building things) – Computer Architecture Designing a pipelined processor – Operating Systems Implement large portions of operating system – Compilers Write compiler for simple language – Networking Implement and simulate network protocols

Carnegie Mellon Course Perspective (Cont.) This course is programmer-centric – Understanding of underlying systems (to make us more effective programmers) – Bring out the hidden hacker in everyone – Dissecting the frog

Carnegie Mellon Textbooks Randal E. Bryant and David R. O’Hallaron, – “Computer Systems: A Programmer’s Perspective, 2 nd Edition” (CS:APP2e), Prentice Hall, 2011 – – Available at NYU bookstore Brian Kernighan and Dennis Ritchie, – “The C Programming Language, 2 nd Edition”, Prentice Hall, 1988 – On reserve at Courant library

Carnegie Mellon Course Components Lectures – Higher level concepts – Mini-demos Homework assignments (2) – Familiarize you with C – 1-2 weeks each Programming labs (3) – The heart of the course – 2-3 weeks each – Provide in-depth understanding of some aspect of systems One midterm exam One final exam

Carnegie Mellon Course Grading Homeworks (2x 5%): 10% Programming labs: 35% – Buffer Lab: 11% – Cache Lab: 11% – Malloc Lab: 13% Midterm exam: 15% Final exam: 40%

Carnegie Mellon Course Syllabus Basic C – Homework 1 and 2 Assembly: Representation of programs, data, and reverse engineering – Bomb Lab System hardware, memory hierarchy for optimizations – Cache Lab Virtual Memory: address translation, allocation, – Malloc Lab Interacting with OS: processes, exceptions, parallelization

Carnegie Mellon Getting Help Class webpage: – Lectures notes – Assignments – Technical documentation and resources Discussion webpage: – Announcements – Discussion

Carnegie Mellon Getting Help Staff contacts: – Professor: Andrew Case When ing me include in the subject line: CS201 office hours: Monday / Thursday 3:30-5pm; or by appointment – Teaching Assistants: Paige Connelly and TBA

Carnegie Mellon Policies: Assignments You must work alone on all assignments – Post all questions on discussion group – You are encouraged to answer others’ questions, but refrain from explicitly giving away solutions. Hand-ins – Assignments due at 11:55pm on the due date – Everybody has 5 grace days for the entire semester – Zero score if a lab is handed in >=5 days late

Carnegie Mellon TA Tutoring – Lab tutorial sessions will be held for each lab generally be demo based/recitation style Schedule: TBA Location: TBA – One on one tutoring available as well Schedule: TBA Location: TBA

Carnegie Mellon Facilities Assignment Lab environments: – Use official class VM (virtual machine) image Software to run VMs: – VirtualBox (free) for Windows/Mac/Linux VM used for lab: – Download VM image from course web page Physical CIMS/ITS Labs – CIMS Lab machines – open 24/7, UNIX based Contact me for an account if needed – ITS Lab machines – Washington Place or 3 rd Avenue both have VirtualBox installed

Carnegie Mellon Cheating What is cheating? – Sharing code: by copying, looking at others’ files – Coaching: helping your friend to write a lab – Copying code from a fellow student, from a previous course, or from anywhere else including the Internet You can only use code we supply Penalty for cheating: – Removal from course with failing grade – Permanent mark on your record CLU – Code Likeness Utility – Department tool sed for plagiarism detection – Uses heuristics to compare both comments and code

Carnegie Mellon Time Management – Labs present significant programming challenges require a significant number of focused working hours – Failure to complete assignments is usually due to: starting too late – Cheating is usually a result of: starting too late – Think ahead, ask questions, and plan your time accordingly

Carnegie Mellon Feedback/Criticism – I want as much feedback/criticisms as possible from you as early as possible – Let me know (anonymously if desired) if: You feel you or others are missing key concepts You are confused about any topic You are unfamiliar with any terms You have a suggestion on improving the course – Keep in mind: If you have a question, undoubtedly others do too; and we will all benefit from your input. Do not be shy!