DOC PREVIEW
CORNELL CS 414 - Processes

This preview shows page 1-2-23-24 out of 24 pages.

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

Unformatted text preview:

ProcessesAnnouncementsReview: OS StructureReview: VirtualizationReview: x86 VirtualizationWhy Processes? Simplicity + SpeedGoals for TodayWhat is a process?What is a program?Preparing a ProgramRunning a programProcess != ProgramProcess StatesProcess State TransitionsProcess Data StructuresContext SwitchDetails of Context SwitchingHow to create a process?Processes Under UNIXExampleBizarre But RealFork is half the storyStarting a new programProcess TerminationProcessesAnnouncements•All office hours have been finalized. Available on web.•CS 414 Homework will be available Wednesday–Due following Wednesday, Feb 7th•CS 415 initial design documents due this Friday, Feb 2nd–Project due following Thursday, February 8th•Everyone should have access to CMS (http://cms3.csuglab.cornell.edu)–Check and contact me ([email protected]) or Bill Hogan ([email protected]) today if you do not have access to CMS•Also, everyone should have CSUGLab account–Contact Bill or I if you do notReview: OS Structure•Monolithic–Advantages: performance–Disadvantages: difficult to extend, debug, secure, and make reliable•Layered–Advantages: simplicity of construction, debugging, and extensible–Disadvantages: defining layers, performance overhead•Micro-kernel–Advantages: easy to extend, port. More reliable and secure.–Disadvantage: performance overhead•Modular–Advantages: monolithic performance with layered flexibility–Disadvantages: modules can still crash system•Virtual Machines–Advantages: protection/isolation, great systems building tool–Disadvantage: difficult to implementReview: Virtualization•Very old idea–IBM in 1960’s used term for virtual machines (e.g. CP-40)–21st century revival (e.g. Denali [Steve Gribble], Xen [Ian Pratt, Steven Hand], VMWare •Is a very broad term–Platform virtualization: involves the simulation of virtual machines•Full virtualization: VM simulates complete HW, runs unmodified OS–IBM’s CP-40, IBM’s z/VM, VMWare Server/Workstation •Partial virtualization (or “address space virtualization): VM simulates much (but not all) HW - each VM consists of different address space–MIT’s CTSS, IBM’s M44/44X•Paravirtualization: VM does not simulate HW, instead offers special API–IBM's CMS, IBM’s z/VM, Xen–Resource virtualization: involves the simulation of combined, fragmented, or simplified resources•RAID, Volume Managers, Storage virtualization, VPN’s, NAT’s•Partioning vs encapsulationReview: x86 Virtualization•x86 is particularly difficult to fully virtualize.–Hard to present the illusion of a complete set of standard hardware –Significant costs in hypervisor complexity and runtime performance•Recent CPU x86 virtualization instructions for a hypervisor to control ring0 hardware access–Create a new ”Ring -1”–Guest OS can run Ring0 operations natively without affecting other guests or the host OS–both Intel's "Vanderpool" (or VT) and AMD's "Pacifica" (AMD-V)•Although they are mutually incompatibleWhy Processes? Simplicity + Speed•Hundreds of things going on in the system•How to make things simple?–Separate each in an isolated process–Decomposition•How to speed-up?–Overlap I/O bursts of one process with CPU bursts of anothergccemacsnfsdlprlswwwemacsnfsdlprlswwwOSOSGoals for Today•What are processes?–Differences between processes and programs•Creating a program•Running a program•States of a process•Process details–States–Data structures–Creating new processesWhat is a process?•A task created by the OS, running in a restricted virtual machine environment –a virtual CPU, virtual memory environment, interface to the OS via system calls•The unit of execution•The unit of scheduling•Thread of execution + address space•Is a program in execution–Sequential, instruction-at-a-time execution of a program.The same as “job” or “task” or “sequential process”What is a program?A program consists of:–Code: machine instructions–Data: variables stored and manipulated in memory•initialized variables (globals)•dynamically allocated variables (malloc, new)•stack variables (C automatic variables, function arguments)–DLLs: libraries that were not compiled or linked with the program•containing code & data, possibly shared with other programs–mapped files: memory segments containing variables (mmap())•used frequently in database programs•Whats the relationship between a program and process?–A process is a executing programPreparing a Programsourcefilecompiler/assembler.o filesLinkerExecutable file(must follow standard format,such as ELF on Linux, Microsoft PE on Windows)HeaderCodeInitialized dataBSSSymbol tableLine numbersExt. refsstatic libraries(libc, streams…)Running a program•OS creates a “process” and allocates memory for it•The loader:–reads and interprets the executable file–sets process’s memory to contain code & data from executable–pushes “argc”, “argv”, “envp” on the stack–sets the CPU registers properly & calls “__start()” [Part of CRT0]•Program start running at __start(), which calls main()–we say “process” is running, and no longer think of “program”•When main() returns, CRT0 calls “exit()”–destroys the process and returns all resourcesProcess != ProgramHeaderCodeInitialized dataBSSSymbol tableLine numbersExt. refsCodeInitialized dataBSSHeapStackDLL’smapped segmentsExecutableProcess address spaceProgram is passive• Code + dataProcess is running program• stack, regs, program counterExample:We both run IE:- Same program - Separate processesProcess States•Many processes in system, only one on CPU•“Execution State” of a process:–Indicates what it is doing–Basically 3 states:•Ready: waiting to be assigned to the CPU•Running: executing instructions on the CPU•Waiting: waiting for an event, e.g. I/O completion •Process moves across different statesProcess State TransitionsNewReady RunningExitWaitingadmittedinterruptI/O or event waitI/O or event completiondispatchdoneProcesses hop across states as a result of:• Actions they perform, e.g. system calls• Actions performed by OS, e.g. rescheduling• External actions, e.g. I/OProcess Data Structures•OS represents a process using a PCB–Process Control Block–Has all the details of a processProcess IdProcess StateGeneral Purpose RegistersStack PointerProgram CounterAccounting


View Full Document

CORNELL CS 414 - Processes

Documents in this Course
Security

Security

49 pages

Deadlocks

Deadlocks

57 pages

Threads

Threads

5 pages

Threads

Threads

29 pages

Deadlocks

Deadlocks

36 pages

Load more
Download Processes
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 Processes 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 Processes 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?