cs 3214 computer systemscs3214/spring2020/lectures/... · 2020. 5. 15. · using git.cs.vt.edu •...

23
CS 3214 Computer Systems Godmar Back Course Introduction

Upload: others

Post on 20-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214

Computer Systems

Godmar Back

Course Introduction

Page 2: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

About Me

• Undergraduate Work at Humboldt and Technical University Berlin

• PhD University of Utah

• Postdoctoral Work at Stanford University

• Joined Virginia Tech ‘04– Tenured since June 2010

– Designed this class; 8th time teaching it

• Research Interests:– Systems, including Virtual Machines, Cloud

Computing, Web Technology

Page 3: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

ADMINISTRIVIA

CS 3214 Spring 2020

Page 4: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

Course Facts

• Meet Tuesday & Thursday, McB 129

– Section 3:30pm-4:45pm

• Check website regularly

– http://courses.cs.vt.edu/~cs3214

• Use CS Forum http://www.piazza.com

• Send email to [email protected]

• All students enrolled in CS3214 have

access to McB 124 (Systems Lab)

CS 3214 Spring 2020

Page 5: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

Reading Material

• Required Textbook

– Bryant and O’Hallaron

(3rd Edition), 2015

Page 6: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

Class Format

• Lectures• Exams

– 1 Midterm– 3-4 quizzes– 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

Page 7: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

Grading

• Tentative breakdown (subject to change):– See syllabus for breakdown between quizzes, final exam, projects, and

exercises

• Grades– Standard scale guarantees grades, but assigments are typically open-

ended

– Median typically between B and C

– 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 2020

Page 8: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

Group Projects

• Projects are group projects– Policy: you are required to work in a group except

with the permission of the instructor

• 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

Page 9: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

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

Please note that this slide has more encouragement

than warnings.

We strongly encourage the use of the forum to

increase your engagement in the class.

We’ll make use of the “Email students right away”

feature only sparingly. The default preference, which

limits the number of emails sent every 2h, is

recommended.

Page 10: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

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

Page 11: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

Honor Code (2017 onward)

• As of Fall 2017, rules at Virginia Tech have changed.

• Default penalty: – 1st offense F* (fail the course) for any violation

– 2nd offense expulsion (for any combination of violations)

• Panels are 3 students/2 faculty now

• Panels interpret 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 2020

Page 12: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

Using git.cs.vt.edu

• We require that you use git.cs.vt.edu for all projects– Faculty have access to your code

• Will use it to distribute sample code– After you clone, make it private!

– We also have script that does this every 24h

• 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 2020

Page 13: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

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

Page 14: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

Prerequisites

• Knowledge of computer organization (CS 2506)

• Knowledge of algorithms & data structures (CS 2114)

• Generally follow the department’s guidelines

Page 15: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

Role of this Course

• Dual role:

– Core requirement• What should every student know about systems?

– Preparation for senior-level OS/networking course

• 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

Page 16: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

Typical System Architecture

CS 3214 Spring 2020

Kernel

Hardware: (CPUs/Cores, Memory, Disk, Network, etc.)

user mode

kernel mode

#include <stdio.h>

int

main()

{

printf("Hello World\n");

}

#include <stdio.h>

int

main()

{

printf("Hello World\n");

}

#include <stdio.h>

int

main()

{

printf("Hello World\n");

}

#include <stdio.h>

int

main()

{

printf("Hello World\n");

}

#include <stdio.h>

int

main()

{

printf("Hello World\n");

}

Threads

Processes

System Call

#include <stdio.h>

int

main()

{

printf("Hello World\n");

}

C Library (libc)

Other Libraries

(libpthreads, libm,

libz, etc. etc.

Virtual Machine

Garbage

Collector

JIT

Runtime Libraries

User Program

Page 17: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

CS 3214 Spring 2020

System Calls

Process 1

Kernel

user mode

kernel mode

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.

Kernel’s System Call Implementation

Page 18: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

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 2020

Page 19: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

Topic 0: Unix + Git

• 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 2020

Page 20: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

Topic 1: Processes

CS 3214 Spring 2020

• 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

Page 21: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

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 2020

Page 22: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

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 2020

Page 23: CS 3214 Computer Systemscs3214/spring2020/lectures/... · 2020. 5. 15. · Using git.cs.vt.edu • We require that you use git.cs.vt.edu for all projects –Faculty have access to

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 2020