AdministriviaLecture videosCourse topicsCourse goalsProgramming AssignmentsGradingStyleAssignment requirementsWhat is an operating system?Why study operating systems?Primitive Operating SystemsMultitaskingMultitaskingMulti-user OSesMulti-user OSesProtectionTypical OS structureSystem callsSystem calls (continued)System call exampleDifferent system contextsTransitions between contextsCPU preemptionProtection is not securityProtection is not securityAddress translationMore memory protectionResource allocation & performanceUseful properties to exploitCS140 – Operating SystemsInstructor: David Mazi`eresCAs: Jeff Chase, Andrew He, Jeremy Hiatt, Samir SelmanStanford University1/27Administrivia• Class web page:http://cs140.scs.stanford.edu/- All assignments, handouts, lecture notes on-line• Textbook: Operating System Concepts, 8th Edition,by Silberschatz, Galvin, and Gagne• Staff mailing list: [email protected] Please mail staff list rather than individuals for help• Newsgroup: su.class.cs140 ← main discussion forum• Key dates:- Lectures: T Th 4:15-5:30, Skilling Auditorium- Section: Some Fridays 3:15pm, Skilling- Midterm: Tuesday, Feb 9, 4:15–5:30pm- Final: Wednesday, March 18, 12:15pm–3:15pm2/27Lecture videos• Lectures will be televised for SCPD students- Can also watch if you miss a lecture, or to review- But resist temptation to miss a bunch of lectures and watchthem all at once• SCPD students welcome to attend le c ture in person- 4:15pm lecture time conveniently at end of day- Many parking spaces don’t require permit after 4pm• Other notes for SCPD students:- Please attend exams in person if possible- Feel free to use newsgroup to find project partners3/27Course topics• Threads & Processes• Concurrency & Synchronization• Scheduling• Virtual Memory• I/O• Disks, File sy s te m s, Network file systems• Protection & Security• Non-traditional operating systems• Note: Lectures will o fte n take Unix as an exam ple- Most current and future OSes heavily influenced by Unix- Windows is exception; this quarter we will mostly ignore- Ousterhout might talk more about Windows next quarter4/27Course goals• Introduce you to operating system co ncepts- Hard to use a computer without interacting with OS- Understanding the OS makes you a more effective programmer• Cover important systems co ncepts in ge neral- Caching, concurrency, memory management, I/O, protection• Teach you to deal with larger softwa re systems- Programming assignments much larger than many courses-Warning: Many people will consider course very hard- In past, majority of people report ≥15 hours/week• Prepare you to take graduate OS classes (CS240,240[a-z])5/27Programming Assignments• Implement parts of Pintos operating system- Built for x86 hardware, you will use hardware emulator• Four implementation projects:- Threads- Multiprogramming- Virtual memory- File system• First project distributed at end of this week•Attend section this Friday for project 1 overview• Implement projects in groups of up to 3 people- Pick your partners today- Lecture will end early so that you can do this6/27Grading•No incompletes- Talk to me ASAP if you run into real problems• 50% of grade from max(final,(midterm + final)/2)• 50% of grade from projects- For each project, 50% of score based on passing test cases- Remaining 50% based on design and style• Most people’s projects pass most test cases-Please, please, please turn in working code, or no credit here• Means design and style matter a lot- Large software systems not just about producing working code- Need to produce code other people can understand- That’s why we have group projects7/27Style• Must turn in a design document along with code- We supply you with templates for each project’s design doc• CAs will manually inspect code for correctness- E.g., must actually implement the design- Must handle corner cases (e.g., handle malloc failure)• Will deduct points for error-prone code w/o errors- Don’t use global variables if automatic ones suffice- Don’t use deceptive names for variables• Code must be easy to re a d- Indent code, keep lines and (when possible) functions short- Use a uniform coding style (try to match existing code)- Put comments on structure members, globals, functions- Don’t leave in reams of commented-out g arbage code8/27Assignment requirements• Do not lo o k at other people’s s olutions to projects• Can read but don’t copy other OSes- E.g., Linux, Open/FreeBSD, etc.•Cite any co de that inspired yo ur code- As long as you cite what you used, it’s not cheating- Worst case we deduct points if it undermines the assignments• Projects due on Thursdays at sta rt of lec ture- Free extension to midnight if you attend lecture- Or if you are SCPD and watch lecture before midnight• Ask cs140-staff for extension if you run into trouble9/27What is an operating system?• Layer between a pplications and hardware• Makes hardware useful to the prog ra mm e r• [Usually] Provides abstractions for applications- Manages and hides details of hardware- Accesses hardware through low/level interfaces unavailable toapplications• [Often] Provides protection- Prevents one process/user from clobbering another10/27Why study operating syste ms?• Operating systems are a maturing field- Most people use a handful of mature OSes- Hard to get people to switch operating systems- Hard to have impact with a new OS• High-performance servers a re an OS issue- Face many of the same issues as OSes• Resource consumption is an OS issue- Battery life, radio spectrum, etc.• Security is an OS issue- Hard to achieve security without a solid foundation• New “sma rt” dev ice s need new OSes• Web browsers increasingly fac e OS issues11/27Primitive Operating Systems• Just a library of standard services [no protection]- Standard interface above hardware-specific drivers, etc.• Simplifying assumptions- System runs one program at a time- No bad users or programs (often bad assumption)• Problem: Poor utilization- . . . of hardware (e.g., CPU idle while waiting for disk)- . . . of human user (must wait for each program to finish)12/27Multitasking• Idea: Run more than one process at once- When one process blocks (waiting for disk, network, userinput, etc.) run another process• Problem: What can ill-behaved process do?- Go into infinite loop and never relinquish CPU- Scribble over other
View Full Document