CS 3214 Computer Systems Course Introduction Godmar Back
CS 3214 Computer Systems Course Introduction Godmar Back
About Me • Undergraduate Work at Humboldt and Technical University Berlin • Ph. D University of Utah • Postdoctoral Work at Stanford University • 11 th Year at Virginia Tech – joined August 2004, – Tenured since June 2010 – Designed this class; 7 th time teaching it • Research Interests: – Systems, including Virtual Machines, Cloud Computing, Web Technology CS 3214 Spring 2018 2
ADMINISTRIVIA CS 3214 Spring 2018 3
Course Facts • Meet Tuesday & Thursday – Section 1: Torg 3100: – Section 2: NCB 360: 11: 00 am-12: 15 pm 2 pm-3: 15 pm • Check website regularly – http: //courses. cs. vt. edu/~cs 3214 • Use CS Forum http: //www. piazza. com • Send email to cs 3214 -staff@cs. vt. edu • All students enrolled in CS 3214 have access to Mc. B 124 (Systems Lab) CS 3214 Spring 2018 4
Force/Add Good evening, The force/add survey closed on Friday. I've notified every student that submitted a request, but there a few pending. If you have any students who show up and make some claim as to "I didn't know the process had changed, " "I didn't hear anything back about my request, " or just plain "I screwed up, " tell them to send an e-mail to csundergrad@cs. vt. edu and explain their situation. If they ask if they should stop by our office to make an appeal in person, the answer is no. If any follow up is needed, I'll contact the student. • If you are not enrolled, you must do this now: • Visit https: //www. cs. vt. edu/S 18 Force-Adds • Password is 3214 gvb# Thanks, Libby • Department will make a decision. CS 3214 Spring 2018 5
Reading Material • Required Textbook – Bryant and O’Hallaron (3 rd Edition), 2015 CS 3214 Spring 2018 6
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 Spring 2018 7
Grading • Tentative breakdown (subject to change): – – 12. 5% Midterm 22. 5% Final 42. 5% Projects (1 & 4 will weigh more heavily than 2 & 3) 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 can cap your grade – Define minimum requirements that must be met for each project – Not meeting requirements for 1, 2, 3, or 4 projects lowers your maximum grade to B+, C+, D+, F respectively – You may still fail CS 3214 Spring 2018 8
Group Projects • Projects are group projects – Projects 1 and 4 MUST be done by a group – Projects 2 and 3 SHOULD be done by a group • Working in a group more closely resembles what you do outside of academia – Can design together, code together • • • 2 students per group Group members must contribute equally Can change group, but only between projects May team up across class sections Exercises are done individually CS 3214 Spring 2018 9
Forum Rules (aka Lex skottie) Please note that this slide has more encouragement • Not allowed: – Posting of any code that is part of your solution to the forum (*) than warnings. – Posting the answers to design document or exercise questions – Posting detailed descriptions of your group’s design We strongly encourage the use of the forum to – Uncivil behavior • (*) Exception: “ 1 -line-rule” increase your engagement in the class. – Can post 1 line iff it causes a compile-time error • You are encouraged to post: We’ll make use of the “Email students right away” – Backtraces, debugging output, debugger messages – Illustrating example for a technique feature only sparingly. The default preference, which – Questions & explanations relating to concept limits the number of emails sent every 2 h, is – Questions & answers relating to projects in general recommended. – Pointers to external resources you have found CS 3214 Spring 2018 10
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 and in syllabus – “I was not aware…” is no excuse • If in doubt, ask! Cheating = Copying From Someone Else + Misrepresenting Work As Your Own CS 3214 Spring 2018 11
Honor Code (2018) • As of Fall 2017, rules at Virginia Tech have changed. • Default penalty: – 1 st offense F* (fail the course) for any violation – 2 nd offense expulsion (for any combination of violations) • Panels are 3 students/2 faculty now • Panels interpreted rules strictly and nearly always believe the faculty member; standard of evidence is lower; this is not a procedural like you see on TV – You will not have a lawyer • Panel can choose from a wide variety of rule violations • If you cheat and we catch you, we have no choice but to file. CS 3214 Spring 2018 12
Using git. cs. vt. edu • We require that you use git. cs. vt. edu for all projects • Will use it to distribute sample code – After you clone, make it private! • Will enforce by assigning part of each project’s credit for it • We are generally flexible about how groups split their work and will not, but we may consult it to resolve disagreements about contributions of individual team members CS 3214 Spring 2018 13
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 Spring 2018 14
Prerequisites • Knowledge of computer organization (CS 2506) • Knowledge of algorithms & data structures (CS 2114) • Generally follow the department’s guidelines CS 3214 Spring 2018 15
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 CS 3214 Spring 2018 16
The Meltdown Attack Source: New York Times CS 3214 Spring 2018 17
CS 3214 Spring 2018 18
CS 3214 Spring 2018 19
Typical System Architecture User Program #include <stdio. h> int main() { printf("Hello Worldn"); } JIT Garbage Collector #include <stdio. h> int main() { printf("Hello Worldn"); } Runtime Libraries Virtual Machine #include <stdio. h> int main() { printf("Hello Worldn"); } user mode kernel mode int main() { printf("Hello Worldn"); } Other Libraries (libpthreads, libm, libz, etc. Threads C Library (libc) Processes System Call Kernel Hardware: (CPUs/Cores, Memory, Disk, Network, etc. ) CS 3214 Spring 2018 20
System Calls User processes access kernel services by trapping into the kernel, executing kernel code to perform the service, then returning – very much like a library call. Unless the system call cannot complete immediately, this does not involve a context switch. Process 1 user mode kernel mode Kernel’s System Call Implementation CS 3214 Spring 2016
Virtual Memory • A hardware/software technique that uses address translation to provide protection and resource management (e. g. paging) CS 3214 Spring 2016
FFFF P 1 1 GB C 0400000 Process 1 Active in user mode user (2) user (1) kernel 3 GB C 0000000 kheap kbss kdata kcode ustack (1) udata (1) ucode (1) 0 access possible in user mode CS 3214 Spring 2018 free used
FFFF P 1 C 0400000 Process 1 Active in kernel mode 1 GB access requires kernel mode user (2) user (1) kernel 3 GB C 0000000 kheap kbss kdata kcode ustack (1) udata (1) ucode (1) 0 access possible in user mode CS 3214 Spring 2018 free used
FFFF P 2 C 0400000 Process 2 Active in kernel mode 1 GB access requires kernel mode user (2) user (1) kernel 3 GB C 0000000 kheap kbss kdata kcode ustack (2) udata (2) ucode (2) 0 access possible in user mode CS 3214 Spring 2018 free used
FFFF P 2 1 GB C 0400000 Process 2 Active in user mode user (2) user (1) kernel 3 GB C 0000000 kheap kbss kdata kcode ustack (2) udata (2) ucode (2) 0 access possible in user mode CS 3214 Spring 2018 free used
Speculative Execution # access to kernel address – will fault! # rax *= 4096 # in speculative execution, loads # value into cache # not shown: side-channel attack that figures our what ‘rax’ was based # on which cache line got loaded during the speculative execution of line 7 CS 3214 Spring 2018
Meltdown Summary • Unintended/unforeseen interaction between – Dual mode (*) – System Calls (*) – Virtual memory/Protection (*) – Computer Architecture • Leads to complete compromise of confidentiality • (*) Concepts we’ll study in CS 3214! CS 3214 Spring 2018
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 Spring 2018 29
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 CS 3214 Spring 2018 30
Topic 1: Processes • Learn the underlying abstractions of processes and multi-process applications • Gain experience with Unix system calls related to processes • Subtopics: – Process creation and management – Signals and signal handling – Interprocess communication • Project 1 – Write your own shell CS 3214 Spring 2018 31
Topic 2: Threads • Understand trends in computer architecture and its implications for application design • Explore concurrency and race conditions • Learn commonly used synchronization techniques in C (and Java) • Learn how to manage concurrency • Understand deadlock: causes and preventions • Project 2 – Managing a pool of threads – Future synchronization CS 3214 Spring 2018 32
Topic 3: Memory • Understanding the construction and management of a process’s memory image • The linking and loading processes • User-level memory management – Explicit vs. automated – User-level APIs for shared memory • Concepts underlying virtual memory and caching • Understand programmer impact – Memory tools • Project 3 – User-level malloc() CS 3214 Spring 2018 33
Topic 4: Internet • Understand basics of Internet addressing and communication • Understand use of socket API and underlying abstractions, • Understand protocol layering and basic protocol design with a focus on HTTP • Understand how to write multi-threaded and event-based server programs • Fundamentals of Virtual Machine Monitors • Exercise 5 – Set up your own hosted VM in Amazon cloud (AWS) • Project 4 – A multi-threaded HTTP server CS 3214 Spring 2018 34
- Slides: 34