CS 140e. Opera&ng Systems from the Ground Up

Similar documents
CS 326: Operating Systems. Lecture 1

CS 161 Computer Security

CS 241 Data Organization. August 21, 2018

Introduction to Data Structures

Aaron Turon! Mozilla Research

CS120 Computer Science I. Instructor: Jia Song

COSE212: Programming Languages. Lecture 0 Course Overview

Overloading Functions & Command Line Use in C++ CS 16: Solving Problems with Computers I Lecture #6

Welcome to CSE 160! Introduction to parallel computation. Scott B. Baden

About Me. Office Hours: Tu 4-5, W 1-2, or by appointment Office: 346A IST Bldg

Welcome! COMS 4118 Opera3ng Systems I Spring 2018

CMSC433 - Programming Language Technologies and Paradigms. Introduction

Welcome to Computer Organization and Design Logic CS 64: Computer Organization and Design Logic Lecture #1 Winter 2018

CMPUT 391 Database Management Systems. Fall Semester 2006, Section A1, Dr. Jörg Sander. Introduction

CS240: Programming in C

Today. An Animated Introduction to Programming. Prerequisites. Computer programming

Syllabus CSCI 405 Operating Systems Fall 2018

CS 564: DATABASE MANAGEMENT SYSTEMS. Spring 2018

CIS*1500 Introduction to Programming

CSC209. Software Tools and Systems Programming.

CS 241 Data Organization using C

TA hours and labs start today. First lab is out and due next Wednesday, 1/31. Getting started lab is also out

Welcome to Solving Problems with Computers I

TTh 9.25 AM AM Strain 322

Operating Systems CMPSC 473. Introduction January 15, Lecture 1 Instructor: Trent Jaeger

CPS 310 first midterm exam, 10/6/2014

CS 4349 Lecture August 21st, 2017

Operating Systems, Spring 2015 Course Syllabus

EECS 482 Introduction to Operating Systems

CSE 333 Lecture smart pointers

WELCOME TO CS 16! Problem Solving with Computers-I

CS 3813/718 Fall Python Programming. Professor Liang Huang.

Computers and programming languages introduction

Memory Safety (cont d) Software Security

CS61C Machine Structures. Lecture 3 Introduction to the C Programming Language. 1/23/2006 John Wawrzynek. www-inst.eecs.berkeley.

CPSC 213. Introduction to Computer Systems. Introduction. Unit 0

Operating Systems CS 571

Call-by-Type Functions in C++ Command-Line Arguments in C++ CS 16: Solving Problems with Computers I Lecture #5

Recitation 14: Proxy Lab Part 2

Alterna(ve Architectures

CSC209. Software Tools and Systems Programming.

Computer Science 210: Data Structures

CS61C Machine Structures. Lecture 1 Introduction. 8/27/2006 John Wawrzynek (Warzneck)

CSCC69H3. Operating Systems Sina Meraji U of T

CSE 333 Lecture smart pointers

CSC 443: Web Programming

CSci 5103 Operating Systems. Jon Weissman. Administrivia

CS 318 Principles of Operating Systems

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1, 2, and 3, Spring 2018

CS 3110 Lecture 1 Course Overview

Introduction to Information Technology ITP 101x (4 Units)

CSCI 136 Data Structures & Advanced Programming. Fall 2018 Instructors Bill Lenhart & Bill Jannen

BOOLEAN EXPRESSIONS CONTROL FLOW (IF-ELSE) INPUT/OUTPUT. Problem Solving with Computers-I

CS 61: Systems programming and machine organization. Prof. Stephen Chong November 15, 2010

C Compilation Model. Comp-206 : Introduction to Software Systems Lecture 9. Alexandre Denault Computer Science McGill University Fall 2006

Distributed Systems. COS 418: Distributed Systems Lecture 1. Mike Freedman. Backrub (Google) Google The Cloud is not amorphous

CS 253: Intro to Systems Programming 1/21

CS 0449 Intro to Systems Software Fall Term: 2181

CS111: Intro to Computer Science

CS 3305 Intro to Threads. Lecture 6

CS 152 Computer Architecture and Engineering Lecture 1 Single Cycle Design

Introduction to Computer Systems

CS2013 Course Syllabus Spring 2017 Lecture: Friday 8:00 A.M. 9:40 A.M. Lab: Friday 9:40 A.M. 12:00 Noon

Distributed Systems Intro and Course Overview

ECE Object-Oriented Programming using C++ and Java

CS31 Discussion 1E. Jie(Jay) Wang Week1 Sept. 30

CPSC 213. Introduction to Computer Systems. About the Course. Course Policies. Reading. Introduction. Unit 0

San José State University Department of Computer Science CS151, Section 04 Object Oriented Design Spring 2018

CS 378 (Spring 2003) Linux Kernel Programming. Yongguang Zhang. Copyright 2003, Yongguang Zhang

Physics 2660: Fundamentals of Scientific Computing. Lecture 7 Instructor: Prof. Chris Neu

Menu. Class 1: Introduction. Staff. Course Structure and Expectations. Contacting Us. Contacting You

Languages and Compilers

CS457/557 Functional Languages

CMPS 182: Introduction to Database Management Systems. Instructor: David Martin TA: Avi Kaushik. Syllabus

CS510 Operating System Foundations. Jonathan Walpole

CPSC 457: Principles of Operating Systems Assignment 2 due June 9, 2015

Introduction to Computer Systems

Computer Systems Organization

CSC369 Lecture 5. Larry Zhang, October 19,2015

Chris Riesbeck, Fall Introduction to Computer Systems

SWE3004: Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CSC 111 Introduction to Computer Science (Section C)

Lecture 6: Buffer Overflow. CS 436/636/736 Spring Nitesh Saxena

Lecture 1: CSE 373. Data Structures and Algorithms

COMP322 - Introduction to C++ Lecture 01 - Introduction

CMPE012 Computer Engineering 12 (and Lab) Computing Systems and Assembly Language Programming. Summer 2009

San José State University Department of Computer Science CS151, Object Oriented Design, Section 04, Fall, 2016 (42968)

CSE 374 Programming Concepts & Tools

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I

COMP 322: Fundamentals of Parallel Programming

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

Advanced Programming Concepts. CIS 15 : Spring 2007

Valeria Martinovic, 330 Latimer. Concurrent enrollment in Chem 1A or a C- in Chem 1A. Tuesday April 28th - 7:00-9:00pm

Parameters and Objects

Internet Web Technologies ITP 104 (2 Units)

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

Introduction to Computer Systems

Intensive Introduction to Computer Science. Course Overview Programming in Scratch

CSC 261/461 Database Systems. Fall 2017 MW 12:30 pm 1:45 pm CSB 601

Transcription:

CS 140e Opera&ng Systems from the Ground Up

CS 140e Goals Learn OS fundamentals. Disks, File systems, I/O Threads & Processes Scheduling Virtual Memory Protection & Security Interrupts Concurrency & Synchronization Build an OS from scratch. Learn embedded development fundamentals. Write low-level embedded sobware and drivers.

About CS 140e: Why? Brand new Opera&ng Systems course! All course material is new. Not based off any existing course. expect rough edges. Everything is real. No virtual machines. All software runs on Raspberry Pi 3. A bofom-up, from scratch approach. You write vast majority of software. A modern approach. Multicore, 64-bit ARMv8 platform. Modern programming languages and tools.

About CS 140e: Why?

Who We Are Jennifer Lin Your TA!

Who We Are Dawson Engler Professor, Instructor

Who We Are Sergio Benitez Ph.D., Instructor

Who You Are Have you implemented any opera1ng system mechanisms such as virtual memory support, processes, or threads? 4% 4% 43% 50% Yes, Many Yes, Several Yes, A Few No

Who You Are Have you implemented any bare metal so>ware such as bootloaders or device drivers? 4% 11% 71% 14% Yes, Many Yes, Several Yes, A Few No

Who You Are Do you have any experience with embedded so>ware development? 14% 32% 11% Yes, A Lot Yes, Some Yes, A Little No 43%

Administrivia Lectures Mondays and Wednesday, 3:00pm - 4:20pm (160-124) Focus on theoretical/conceptual OS concepts Labs (op&onal but encouraged) Mondays and Wednesday, 5:30pm - 6:30pm (Gates 463a) Focus on assignments. Course Website: hfps://cs140e.stanford.edu News, assignments, policies, etc. Still a work in progress. Q&A on Piazza (see course website for link) Office Hours TBA.

Assignments and Exams Midterm and Final Exam Focus primarily on lecture material. Open notes. Anything written/printed is allowed. 5 Heavy (!!) Programming Assignments Budget about 10-15 hours per week per assignment. First assignment out on Wednesday. Writing component: answer questions. Individual, but collaboration on ideas is encouraged. All code must be your own. Please don t cheat. Start early. Don t procrastinate! Late Policy: 100 penalized hours per assignment Does not apply to last assignment. Score capped at max(0, 100 - n)% for n hours late

Assignment Schedule Assignment 0: Ge^ng Started Set-up Raspberry Pi. Write first program. Out on Wednesday. Due Monday. Assignment 1: The Shell Write a bash-like shell that runs on your machine and Pi. Write a shell command that loads program over UART: bootloader. Assignment 2: File System Write SD card driver and FAT32 file system. Assignment 3: Spawn Load and execute programs from SD card in separate processes. Assignment 4: Preemp&ve Mul&core Mul&tasking Run multiple programs at once on multiple cores.

Grading Grading Breakdown 55% assignments 20% midterm 25% final exam (+/-) 5% participation We hope to gives lots of As!

Who You Are In which programming languages do you feel comfortable and confident wri1ng so>ware? C, C++, Java, Python, JavaScript

Rust! In which programming languages do you feel comfortable and confident wri1ng so>ware? C, C++, Java, Python, JavaScript

Rust! Memory-safe without a GC. No data races, guaranteed! Minimal runtime. Static, strong types. Package manager.

C: Undefined Behavior int main(int argc, char **argv) { unsigned long a[1]; a[2] = 0x7ffff7b36cebUL; return 0;

C: Undefined Behavior stack int main(int argc, char **argv) { unsigned long a[1]; a[2] = 0x7ffff7b36cebUL; return 0; ret sp a[0] addresses

C: Undefined Behavior stack int main(int argc, char **argv) { unsigned long a[1]; a[2] = 0x7ffff7b36cebUL; return 0; ret 0x7ffff7.. sp a[0] addresses

C: Undefined Behavior stack int main(int argc, char **argv) { unsigned long a[1]; a[2] = 0x7ffff7b36cebUL; return 0; ret 0x7ffff7.. sp a[0] addresses undef: Error:.netrc file is readable by others. undef: Remove password or make file unreadable by others.

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); std::string &x = v[0]; v.push_back(" world!"); std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); v std::string &x = v[0]; v[0] v.push_back(" world!"); std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); v std::string &x = v[0]; v[0] v.push_back(" world!"); x std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); v std::string &x = v[0]; v[0] v.push_back(" world!"); x std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); v std::string &x = v[0]; v[0] v.push_back(" world!"); x std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); v std::string &x = v[0]; v[0] v[0] v[1] v.push_back(" world!"); x std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); v std::string &x = v[0]; v[0] v[0] v[1] v.push_back(" world!"); x std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Aliasing is Hard! int main() { std::vector<std::string> v; v.push_back("hello, "); v std::string &x = v[0]; v[0] v.push_back(" world!"); x std::cout << x; Rusty Types for Solid Safety (PLAS 16)

Restricted Aliasing C++ int main() { vector<string> v; v.push_back("hello, "); string &x = v[0]; v.push_back(" world!"); Rust fn main() { let mut v = Vec::new(); v.push("hello, "); let x = &v[0]; v.push(" world!"); cout << x; println!("{", x); Rusty Types for Solid Safety (PLAS 16)

Restricted Aliasing fn main() { let mut v = Vec::new(); v.push("hello, "); v let x = &v[0]; v[0] v.push(" world!"); println!("{", x); Rusty Types for Solid Safety (PLAS 16)

Restricted Aliasing fn main() { let mut v = Vec::new(); v.push("hello, "); v let x = &v[0]; v[0] v.push(" world!"); x println!("{", x); Rusty Types for Solid Safety (PLAS 16)

Restricted Aliasing fn main() { let mut v = Vec::new(); v.push("hello, "); v let x = &v[0]; v[0] v.push(" world!"); x println!("{", x); Rusty Types for Solid Safety (PLAS 16)

Restricted Aliasing fn main() { let mut v = Vec::new(); v.push("hello, "); let x = &v[0]; v.push(" world!"); v[0] breaks invariant => statically disallowed v x println!("{", x); Rusty Types for Solid Safety (PLAS 16)