CS 537: INTRO TO OPERATING...
Transcript of CS 537: INTRO TO OPERATING...
![Page 1: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/1.jpg)
CS 537: INTRO TO OPERATING SYSTEMS
Shivaram VenkataramanSpring 2020
![Page 2: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/2.jpg)
WHO AM I?
Second year faculty in Computer Science!
PhD Thesis at UC Berkeley:System Design for Large Scale Machine Learning
Industry: Google, Microsoft ResearchOpen source: Apache Spark committer
![Page 3: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/3.jpg)
Call Me
Prof. Shivaram or Shivaram
![Page 4: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/4.jpg)
TODAYS AGENDA
What will you do in this course?
What is an operating system and why do we need one?
Why study operating systems?
![Page 5: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/5.jpg)
Course syllabus
![Page 6: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/6.jpg)
COURSE LEARNING OUTCOMES
- Explain the fundamental types of OS abstractions
- Design and implement system libraries and kernel calls
- Assess system performance
- Explain the impact of algorithms and data structures
![Page 7: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/7.jpg)
ASSESSMENTSExams (45%)
Midterm and final exams: Closed book, short questions
Quiz (5%)In-class: Bring your computing device (or use paper)!Assess OS concepts, abstractions discussed in class
Projects (50%)Programming projects done on CS Linux labsGain hands-on experience, Build your own OS system calls!Measure, understand performance
![Page 8: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/8.jpg)
FORMAT
Lecture
Tue and Thu, 1PM - 2:15PMLocation: 3650 Humanities
Lecture notes, in-class discussionLinks to textbook chapters
Discussion
Thu 5.30PM-6:45PM Location: 105 Psychology
Explain programming projectsPractice for exams
![Page 9: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/9.jpg)
PERSONNEL
Instructor: Shivaram Venkataraman
Teaching assistants: Setareh Behroozi, Vibhor Goel, Shivangi Kamat, Konstantinos Kanellis, Abigail Matthews, Kaiwei Tu, Yien Xu
Peer mentors: Anthony Barthell, Siddhant Bhagat, Kesong Cao, Tyler Gu, Ayush Kumar, Kieran Mulligan, Conor Waity, June Werner, Jerry Yu, Xinyu Zeng, Shawn Zhong, Zhenyu Zou
20 course staff!
![Page 10: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/10.jpg)
IMPORTANT LINKS
Course websitehttp://pages.cs.wisc.edu/~shivaram/cs537-sp20/
Piazzahttps://piazza.com/wisc/spring2020/cs537
![Page 11: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/11.jpg)
MATERIALS
Free
![Page 12: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/12.jpg)
COURSE POLICIES: TIME MANAGEMENT
Time management is a skill to learn!Projects are mostly back-to-back – start earlyAsk for help (email or OH) if you have any issues
Slip days: Maximum of four slip days.Two for the first half (individual projects)Two for the second half (group projects)
No credit for late submissions if you are out of slip days. Use with care!
![Page 13: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/13.jpg)
COURSE POLICIES: ACADEMIC INTEGRITY
It is DEFINITELY OK to:- discuss the project in general terms (what do they mean by a file?)- discuss how different library routines/system calls work- ask the TA or professor or both for as much help as you need!
It is NOT OK to:- bug someone else for a lot of help (particularly if they are done!)- share your code directly with other people/project groups
![Page 14: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/14.jpg)
COURSE POLICIES: INCLUSION
Create an environment where everyone can learn and thrive
Always feel free to ask a question!
Create a climate where we treat everyone with respect
![Page 15: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/15.jpg)
SUMMARY
Course outline- OS abstractions: Principles + Code- Exams, programming projects- Operating system: Three Easy pieces textbook
Action items: Register on Piazza and check course website!
![Page 16: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/16.jpg)
WHAT IS AN OPERATING SYSTEM ?
![Page 17: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/17.jpg)
EXAMPLES OF OPERATING SYSTEMS
![Page 18: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/18.jpg)
![Page 19: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/19.jpg)
Applications
Hardware
![Page 20: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/20.jpg)
WHAT DOES OS PROVIDE: ROLE #1
Abstraction: Provide standard library to access resources
What is a resource?Anything valuable (e.g., CPU, memory, disk)Examples of abstractions OS typically provide?
CPU: Memory: Disk:
![Page 21: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/21.jpg)
WHY SHOULD OS DO THIS ?
Advantages of OS providing abstraction?Allow applications to reuse common facilitiesMake different devices look the sameProvide higher-level or more useful functionality
ChallengesWhat are the correct abstractions?How much of hardware should be exposed?
![Page 22: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/22.jpg)
WHAT DOES OS PROVIDE: ROLE #2
Resource management – Share resources well
What is sharing?Multiple users of the systemMultiple applications run by same userMultiple devices for same functionality
![Page 23: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/23.jpg)
WHY SHOULD OS DO THIS ?
Advantages of OS providing resource managementProtect applications at a common layerProvide efficient access to resources (cost, time, energy)Provide fair access to resources
ChallengesWhat are the correct mechanisms?What are the correct policies?
![Page 24: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/24.jpg)
OPERATING SYSTEM ROLES SUMMARY
Two main roles AbstractionResource management
GoalsEase of usePerformanceIsolationReliability …
![Page 25: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/25.jpg)
COURSE APPROACH
![Page 26: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/26.jpg)
OPERATING SYSTEMS: THREE EASY PIECES
Three conceptual pieces
1. Virtualization
2. Concurrency
3. Persistence
![Page 27: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/27.jpg)
VIRTUALIZATION
Make each application believe it has each resource to itself
Demo
![Page 28: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/28.jpg)
CONCURRENCY
Events occur simultaneously and may interact with one anotherNeed to
Hide concurrency from independent processesManage concurrency with interacting processes
Provide abstractions (locks, semaphores, condition variables etc.)
Demo with threads
![Page 29: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/29.jpg)
PERSISTENCE
Lifetime of data is longer than lifetime of any one processMachine may lose power or crash unexpectedly
Issues:High-level abstractions: Files, directories (folders), linksCorrectness with unexpected failuresPerformance: disks are very slow!
![Page 30: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/30.jpg)
ADVANCED TOPICS
VirtualizationConcurrencyPersistenceAdvanced Topics
Virtual MachinesNetwork File SystemsSSDs
![Page 31: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/31.jpg)
WHY STUDY OS ?
Build, modify, or administer an operating system
Understand system performanceBehavior of OS impacts entire machineTune workload performanceApply knowledge across many layers
Fun and challenging to understand large, complex systems
![Page 32: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/32.jpg)
WAITLIST
If you are on the waitlistKeep attending classesStart working on projectsEmail [email protected]
![Page 33: CS 537: INTRO TO OPERATING SYSTEMSpages.cs.wisc.edu/~shivaram/cs537-sp20-notes/intro/cs537-intro-not… · COURSE POLICIES: TIME MANAGEMENT Time management is a skill to learn! Projects](https://reader033.fdocuments.in/reader033/viewer/2022052613/5f1e4d8c3ca33542d04ac700/html5/thumbnails/33.jpg)
NEXT STEPS
Register on Piazza
First programming assignment out by tonight!Due Jan 29th (next Wednesday) at 10.00pmMore details in discussion on Thursday
Welcome to CS 537!