CS 3214 Computer Systems Godmar Back Lecture 1. CS 3214 Fall 2011 About Me Undergraduate Work at...
-
Upload
grace-constance-mcgee -
Category
Documents
-
view
219 -
download
0
Transcript of CS 3214 Computer Systems Godmar Back Lecture 1. CS 3214 Fall 2011 About Me Undergraduate Work at...
CS 3214Computer Systems
Godmar Back
Lecture 1
CS 3214 Fall 2011
About Me
• Undergraduate Work at Humboldt and Technical University Berlin
• PhD University of Utah• Postdoctoral Work at Stanford University• 8th Year at Virginia Tech
– joined August 2004, – Tenured Associate Professor since June 2010– Designed this class; 4rd time teaching it
• Research Interests:– Systems, including Virtual Machines, Cloud
Computing, Web Technology
ADMINISTRIVIA
CS 3214 Fall 2011
CS 3214 Fall 2011
Course Facts• Meet Tuesday & Thursday:
– Section 1: McB 307: 9:30am-10:45pm– Section 2: Rand 320: 12:30pm-1:45pm
• Check website regularly– http://courses.cs.vt.edu/~cs3214
• Use CS Forum http://www.piazza.com• Send email to
– [email protected]• TAs:
– Ruslan Nikolaev– Parang Saraf
• All students enrolled in CS3214 have access to McB 124 (Systems Lab)
CS 3214 Fall 2011
Email Etiquette• Please
enter your name in webmail so it appears in From: line
• Be coherent when you email
CS 3214 Fall 2011
Reading Material
• Required Textbook– Bryant and O’Hallaron
(2nd Edition), 2011– Will post reading
assignments
CS 3214 Fall 2011
Class Format
• Lectures• Exams
– 1 Midterm– 1 Final (Comprehensive)Exams are only offered at the announced time.
Missed exams result in zero score.
• Programming Projects• Exercises
• Please read the syllabus for late policy
CS 3214 Fall 2011
Grading• Tentative breakdown (subject to change):
– 12.5% Midterm– 22.5% Final– 42.5% Projects– 22.5% Exercises
• Not grading on standard scale; grade will be based on a curve of students attempting this course:– Median typically between B and C– Grading on a curve means every assignment is important, doing
“just enough” is a strategy bound to result in a low grade– Calibrated not just by students in this cohort, but also past
offerings• Additional stipulations to pass the class
(aka “Auto-Fail Rules”)– Minimum Requirements must be met for each project– Necessary, not sufficient conditions
CS 3214 Fall 2011
Group Projects
• Projects are group projects• Working in a group more closely resembles what
you do outside of academia– Can design together, code together
• Group members must contribute equally• 2 students per group• Can change group, but only between projects• Exercises are done individually
CS 3214 Fall 2011
Forum Rules (aka Lex skottie)
• Not allowed:– Posting of any code that is part of your solution to the forum (*)– Posting the answers to design document or exercise questions– Posting detailed descriptions of your group’s design– Uncivil behavior
• (*) Exception: “1-line-rule”– Can post 1 line iff it causes a compile-time error
• You are encouraged to post:– Backtraces, debugging output, debugger messages– Illustrating example for a technique– Questions & explanations relating to concept– Questions & answers relating to projects in general– Pointers to external resources you have found
CS 3214 Fall 2011
Honor Code
• Will be strictly enforced in this class– Will not give warning or engage in discussions before filing
honor code cases where I believe they are warranted• Do not cheat
– Observe collaboration policy outlined in syllabus• Will use MOSS for software cheating detection
– Do not borrow code from other offerings– Follow collaboration policy
• Read all policies posted on the website– “I was not aware…” is no excuse
• If in doubt, ask!Cheating = Copying From Someone Else
+ Misrepresenting Work As Your Own
CS 3214 Fall 2011
Acknowledgements
• To avoid plagiarism, document (“acknowledge”) your sources
• Will draw in lectures from– Textbook– And other texts, in particular Silberschatz et al’s book
(“Dinosaur book”); Stalling’s book and Tannenbaum’s Modern Operating Systems
– Course material created for other courses– And other sources as appropriate
CS 3214 Fall 2011
Prerequisites
• Knowledge of computer organization (CS 2506)• Knowledge of algorithms & data structures (CS
2114)
• Please submit prerequisite form by Thursday
• Knowledge of C
CS 3214 Fall 2011
Talking about C…
#define offsetof(TYPE, MEMBER) \((size_t) &((TYPE *) 0)->MEMBER)
struct point { int x; int y; int z; char c; float o;};Q.: What is offsetof(struct point, y)? offsetof(struct point, o)?
#define offsetof(TYPE, MEMBER) \((size_t) &((TYPE *) 0)->MEMBER)
struct point { int x; int y; int z; char c; float o;};Q.: What is offsetof(struct point, y)? offsetof(struct point, o)?
0: x (4 byte int)
8: z (4 byte int)12: c (1 byte char)
4: y (4 byte int)
16: o (4 byte float)13: 3 byte padding
CS 3214 Fall 2011
Role of this Course
• Dual role:– Core requirement
• What should every student know about systems?
– Preparation for senior-level OS/networking course in Spring
• Capstone course for students choosing the Systems & Networking track: design an OS
• Perspective taken is that of a programmer using a system, not of a designer building one
Typical System Architecture
CS 3214 Fall 2011
Kernel
Hardware: (CPUs/Cores, Memory, Disk, Network, etc.)
user mode
kernel mode
#include <stdio.h>
intmain(){ printf("Hello World\n");}
#include <stdio.h>
intmain(){ printf("Hello World\n");}
#include <stdio.h>
intmain(){ printf("Hello World\n");}
#include <stdio.h>
intmain(){ printf("Hello World\n");}
#include <stdio.h>
intmain(){ printf("Hello World\n");}
Threads
Processes
System Call
#include <stdio.h>
intmain(){ printf("Hello World\n");}
C Library (libc)
Other Libraries (libpthreads, libm,
libz, etc. etc.
Virtual Machine
Garbage CollectorGarbage Collector
JITJIT
Runtime LibrariesRuntime Libraries
User ProgramUser Program
Outcomes
• Be productive in using an OS – focus on Unix here
• Understand execution and optimization
• Understand overall architecture and concepts
• Understand interaction between apps and OS
• Understand concepts underlying threading, scheduling, virtual memory, networking, and virtualization
CS 3214 Fall 2011
Topic 0: Unix
• Throughout: we will be using Linux
• You are expected to already bring, or quickly pick up, the necessary skills– Will not set class time aside for this, but am
happy to discuss questions on the forum
• Exercise 1 may help
CS 3214 Fall 2011
Topic 1: Programs and Data
• Understand how programs are built, how they execute– Role of the compiler, assembler, and linker
• Learn to read and understand x86 code (32+64bit)• Learn how to use a debugger• Understand security implications• Assume knowledge of bytes & bits as provided in
CS250X• Projects:
– “Binary Bomb”– “Buffer Bomb”
CS 3214 Fall 2011
Topic 2: Performance
• Learn– how to optimize code– how not to optimize code– how to measure performance– the impact of memory hierarchies
CS 3214 Fall 2011
Topic 3: Processes and Threads
• Learn the underlying abstractions
• Learn how to use them
• Subtopics:– System calls and exceptions– Thread and process APIs– Interprocess Communication
• Project:– Write your own shell
CS 3214 Fall 2011
Topic 4: Concurrency & Synchronization
• Learn about race conditions
• Learn commonly used synchronization techniques in C and Java
• Learn how to manage concurrency
• Understand deadlock and how to prevent it
CS 3214 Fall 2011
Topic 5: Memory
• Understand user-level memory management– Explicit vs. automated– User-level APIs for shared memory
• Understand concepts underlying Virtual Memory
• Understand impact on programmer– Memory tools
• Project:– User-level malloc()
CS 3214 Fall 2011
Topic 6: I/O and Networking
• Understand I/O facilities and layers• Understand use of socket API and
underlying abstractions, and basic protocol design with a focus on HTTP
• Understand how to write multi-threaded and event-based programs
• Project:– A multi-threaded HTTP server
CS 3214 Fall 2011
Topic 7: Virtualization
• Understand underlying concepts
• Understand resource management
CS 3214 Fall 2011
Announcements
• Exercise 1 and Project 1 have been posted
• Due Aug 30 and Sep 7, resp.
• Team Up Now!
CS 3214 Fall 2011