DOC PREVIEW
Stanford CS 140 - CS 140 Lecture Notes

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS 140: Operating Systems and Systems ProgrammingBob Lantz Stanford University, Summer ‘08 Lecture 1: Introductioncs140.stanford.edu(lecture notes: Lantz/Rosenblum/Mazières)Today!Course overview!What’s interesting about operating systems?!What is an operating system?!Evolution of operating systems !Principles/themes of OS design!Last 15-20 minutes: – Pick group partners (groups of 1-3 people for projects)Course overview!Web site: http://cs140.stanford.edu!Newsgroup: su.class.cs140 (post here first!)!E-mail: [email protected]!Key People– Instructor: Bob Lantz (rlantz@cs)– CA: Akbar Mehdi (samehdi@stanford)!Key Dates:– Lectures: MWF 1:15-2:30 p.m. in (spacious)Terman Auditorium– Project/Problem sessions: periodic, TBAMidterm: scheduled for Friday, July 18th, in class– Final: scheduled for Saturday, August 16th, 12:15-3:15 p.m.Course Overview (Continued)!Material: – Lecture notes – On website, copies given out in class. – Textbook – Silberschatz, Galvin, and Gagne, Operating System Concepts (Seventh Edition)!Prerequisites:– Computer organization – (CS107 or EE108b)– Concurrent programming – (CS107)!Grading Policy– Programming assignments: 50%– Midterm Exam 17%– Final Exam: 33%Give me a sign you learned the material.Course is also on Video!Lectures are televised/available on SCPD web site– - can watch to review- but more fun/discussion if you attend class in person!- also better to watch live via SCPD - questions- avoid temptation to skip and watch them all at once!!SCPD students encouraged/welcome to attend in person- lots of room in Terman Auditorium!Other notes for SCPD students– - please come in person to exams if possible– - feel free to use newsgroup to find project partnersGreat things about CS140!!Fabulous kernel-hacking programming projects!– The Pintos teaching OS is your new friend!As are your project partners!Implement threads, user processes, virtual memory, filesystem! !Learn more (?) than other, lesser CS classes– learn how Unix/Linux/OS X/Windows/etc. work!“non-trivial” projects = more fun/learning!Become a kernel hacker/OS expert– ...and a better programmer/computer scientist!– Prepare for other classes (CS240), research, etc.!Put it on your resumé or C.V. - get a job!CS 140 - Summer 2008 - Handout #1Words of warning about CS140!!Learning by doing = more learning, more doing– Learn OS concepts by coding them!But this is a lot of work.!Key Course Features– Workload rated in the 99% of CS/EE courses-> legacy of CS240A/~200hrs+/8-week course– Most of the work comes from intense coding/debugging– You will need 1-2 good partners for the assignments !Project grading– 50% automatic tests (we give you access to the tests)– 50% design (code and design documentation)– if your code does not work, the TAs WILL NOT fix it.What is an OS?!software between applications and hardware: – abstracts hardware and makes useful and portable– makes finite into (near)infinite– provides protectiongccemacsWoW/Word/etc.OShardwareWhat’s interesting here?/ Why study OS?!OS = personality/mind/soul of computer system– Makes messy reality (hardware) pretty and friendly– OS is magic to most people. This course reveals its secrets!!OS = extended example of a complex system– huge, parallel, not understood, insanely expensive to build» Win/NT/XP: 10 years, 1000s of people. Still doesn’t work well– most interesting things are complex systems: internet, air traffic control, governments, weather, relationships, …!How to deal with complexity? – Abstraction + modularity + iteration– Fail early, fail often, grow from something that works– Unbelievably effective: int main() { puts(“hello”); } = millions of lines of code! but don’t have to think about itOS evolution: step 0!Simple OS: One program, one user, one machine:– examples: early computers, early PCs, embedded controllers such as elevators, cars, NES/GameBoy, …– OS just a library of standard services. Examples: standard device drivers, interrupt handlers, I/O.!Assumptions for a simple world: No bad people. No bad programs. A minimum of complex interactions!Problems: poor hardware utilization; user must wait to run new programAPPOShardwareOS evolution: step 1 - Multitasking!Simple OS is inefficient: – if process is waiting for something, machine sits wasted.!(Seemingly) Simple hack: – run more than one process at once– when one process blocks, switch to another!A couple of problems: what if a program– infinite loops?– starts randomly scribbling on memory?!OS adds protection– interposition + – preemption +– privilegegccemacsOShardwareOS evolution: step 2 - Multiuser!Simple OS is expensive: – one user = one computer (compare to xenon, Google)!(Seemingly) Simple hack: – Allow more than user at once. – Does machine now run N times slower? Usually not! Key observation: users bursty. If one idle, give other resources. !Couple of problems: – what if users are hogs? – evil?– Or just too numerous?!OS adds protection– (notice: as we try to utilize resources, complexity grows)gccemacsOShardwarerlantzsamehdiCS 140 - Summer 2008 - Handout #1Protection at 50,000 feet!Goal: isolate bad programs and people (security)– main things: preemption + interposition + privileged ops!Pre-emption: – give application something, can always take it away!Interposition:– OS between application and “stuff”– track all pieces that application allowed to use (usually in a table)– on every access, look in table to check that access legal!Privileged/unprivileged mode– Applications unprivileged (peasant)– OS privileged (king, deity)– protection operations can only be done in privileged modeWildly successful protection examples!Protecting CPU: pre-emption– clock interrupt: hardware periodically “suspends” app, invokes OS – OS decides whether to take CPU away– Other times? Process blocks, I/O completes, system call!Protecting memory: Address translation– Every load and store checked for legality– Typically use this machinery to translate to new value (why??)– (protecting disk memory similar)Address translation!Idea: – restrict what a program can do by restricting what it can touch!!Definitions:– Address space: all addresses a program can touch– Virtual address: addresses in process’ address space– Physical address: address of real memory–


View Full Document

Stanford CS 140 - CS 140 Lecture Notes

Documents in this Course
Homework

Homework

25 pages

Notes

Notes

8 pages

Load more
Download CS 140 Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CS 140 Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CS 140 Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?