cs 140e
play

CS 140e Opera&ng Systems from the Ground Up CS 140e Goals - PowerPoint PPT Presentation

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


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

  2. 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.

  3. 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. •

  4. About CS 140e: Why?

  5. Who We Are Jennifer Lin Your TA!

  6. Who We Are Dawson Engler Professor, Instructor

  7. Who We Are Sergio Benitez Ph.D., Instructor

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

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

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

  11. 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.

  12. 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 •

  13. 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. •

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

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

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

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

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

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

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

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

  22. 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 )

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

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

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

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

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

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

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

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

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

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

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

  34. Restricted Aliasing fn main() { let mut v = Vec::new(); d e w o l l v a s i d y v.push("Hello, "); l l a c i t a t s > = t v[0] n let x = &v[0]; a i r a v n i s k a e r b v.push(" world!"); x println!("{}", x); } Rusty Types for Solid Safety ( PLAS’16 )

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend