DOC PREVIEW
Princeton COS 318 - First precept happened, more to come

This preview shows page 1-2-3-24-25-26 out of 26 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 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 26 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 26 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 26 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 26 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 26 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

OS Structure & ProcessesFoodundgedankAdministrativeA Friendly DeceptionHost/Hostess ProblemUsers, Programs, ProcessesPrograms As Process Collectionsgcc exampleSo What Is A Process?What Does This Program Do?Here’s The OutputInstances Of ProgramsSo What’s In A Process?Consider How To Read a FileWhich is a System Call and WhyWhat State Is Implied?Some Insight Into OSSlide 18Examining Those Other ParametersRemember This?Address SpaceSome DefinitionsMore Address SpaceOne Common LayoutKernel StackWhat Other Options Possible?OS Structure & Processes 1OS Structure & ProcessesOS Structure & ProcessesVivek PaiVivek PaiCOS 318COS 318September 20, 2001September 20, 2001OS Structure & Processes 2FoodundgedankFoodundgedankYou’re the host/hostess of a banquet hall that has You’re the host/hostess of a banquet hall that has accidentally been double-booked. It has three accidentally been double-booked. It has three rooms – the large dining room, the cocktail room, rooms – the large dining room, the cocktail room, and a small buffet line room.and a small buffet line room.If each guest is given a card with the room layout If each guest is given a card with the room layout with table numbers, and the guest’s own table with table numbers, and the guest’s own table number, how can you solve this problem?number, how can you solve this problem?What issues are involved regarding the sizes of the What issues are involved regarding the sizes of the two groups?two groups?OS Structure & Processes 3AdministrativeAdministrativeFirst precept happened, more to comeFirst precept happened, more to come–Room scheduling not finalized, but 103 likelyRoom scheduling not finalized, but 103 likely–Friday may be at 3:30 instead of 3:00Friday may be at 3:30 instead of 3:00Politely remind me if I’m running latePolitely remind me if I’m running lateI’ve forgotten about the feedback paperI’ve forgotten about the feedback paperNext reading assignment: 1.4, 1.5Next reading assignment: 1.4, 1.5OS Structure & Processes 4A Friendly DeceptionA Friendly DeceptionHiding informationHiding informationGiving out different information while Giving out different information while appearing to be the sameappearing to be the sameStalling when necessaryStalling when necessaryDrawback? Maybe lots of extra workDrawback? Maybe lots of extra workBenefit: makes life easier for userBenefit: makes life easier for userOS Structure & Processes 5Host/Hostess ProblemHost/Hostess ProblemEach group < 50%Each group < 50%–Have two sets of cards with different Have two sets of cards with different numbering schemesnumbering schemesEach group slightly above 50%Each group slightly above 50%–Slow down the buffet line & entranceSlow down the buffet line & entranceEach group near 100%Each group near 100%–One group in dining room, other in cocktail One group in dining room, other in cocktail roomroomOS Structure & Processes 6Users, Programs, ProcessesUsers, Programs, ProcessesUsers have accounts on the systemUsers have accounts on the systemUsers launch programsUsers launch programs–Many users may launch same programMany users may launch same program–One user may launch many instances of the One user may launch many instances of the same programsame programProcesses are instances of a programProcesses are instances of a program–The “program” can really be a set of processesThe “program” can really be a set of processesOS Structure & Processes 7Programs As Process CollectionsPrograms As Process CollectionsNetscape (output of “ps x”)Netscape (output of “ps x”)–7253 p0 S 0:19.26 /usr/local/lib/netscape/communicator-4.75.bin -irix-s7253 p0 S 0:19.26 /usr/local/lib/netscape/communicator-4.75.bin -irix-s–7280 p0 I 0:00.15 (dns helper) (communicator-4.7)7280 p0 I 0:00.15 (dns helper) (communicator-4.7)gcc (via “gcc –pipe –v”)gcc (via “gcc –pipe –v”)–/usr/libexec/cpp |/usr/libexec/cpp |–/usr/libexec/cc1 |/usr/libexec/cc1 |–/usr/libexec/as, followed by/usr/libexec/as, followed by–/usr/libexec/elf/ld/usr/libexec/elf/ldOS Structure & Processes 8gcc examplegcc exampleYou launch gccYou launch gccIt first launches cpp, cc1, asIt first launches cpp, cc1, asIt then launches ldIt then launches ldEach instance is a process, and each Each instance is a process, and each program actually exists separatelyprogram actually exists separately–You could launch cc1 manually if you wantedYou could launch cc1 manually if you wantedOS Structure & Processes 9So What Is A Process?So What Is A Process?It’s one instance of a “program”It’s one instance of a “program”It’s separate from other instancesIt’s separate from other instancesIt can start (“launch”) other processesIt can start (“launch”) other processesIt can be launched by themIt can be launched by themOS Structure & Processes 10What Does This Program Do?What Does This Program Do?int myval;int myval;int main(int argc, char *argv[])int main(int argc, char *argv[]){{myval = atoi(argv[1]);myval = atoi(argv[1]);while (1)while (1)printf(“myval is %d, loc 0x%lx\n”,printf(“myval is %d, loc 0x%lx\n”,myval, (long) &myval);myval, (long) &myval);}}OS Structure & Processes 11Here’s The OutputHere’s The OutputOS Structure & Processes 12Instances Of ProgramsInstances Of ProgramsThe address was always the sameThe address was always the sameThe values were differentThe values were different–Implies that the programs aren’t seeing each Implies that the programs aren’t seeing each otherother–But they think they’re using the same addressBut they think they’re using the same addressConclusion: addresses are not absoluteConclusion: addresses are not absoluteWhat’s the benefit?What’s the benefit?OS Structure & Processes 13So What’s In A Process?So What’s In A Process?Information about the hierarchyInformation about the hierarchy–What launched itWhat launched it–What it has launchedWhat it has launchedInformation about resourcesInformation about resources–Where is it storing dataWhere is it storing data–What other resources it’s usingWhat other resources it’s usingVarious kinds of mappingsVarious kinds of mappingsOS Structure & Processes 14Consider How To Read a FileConsider How To Read a FileCompare read( ) and fread( )Compare read( ) and fread( )read(int d, void *buf,


View Full Document

Princeton COS 318 - First precept happened, more to come

Documents in this Course
Overview

Overview

25 pages

Deadlocks

Deadlocks

25 pages

lectute 2

lectute 2

28 pages

Lecturel

Lecturel

24 pages

Real mode

Real mode

49 pages

Lecture 2

Lecture 2

54 pages

lecture 5

lecture 5

27 pages

Load more
Download First precept happened, more to come
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 First precept happened, more to come 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 First precept happened, more to come 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?