Unformatted text preview:

COT 4600 Operating Systems Fall 2009Lecture 9User-friendly namesRelative lifetime of namesCase study: URLsThe name-mapping algorithm for an URLURL case sensitivityAlternatives to URLSoft modularityExample:Machine code for MEASUREMachine code for GET_TIMEProcedure call conventionSlide 14Soft modularity allows errors to propagateStrongly typed languages help enforce modularitySoft modularity may be affected by other factorsEnforced modularitySlide 19COT 4600 Operating Systems Fall 2009Dan C. MarinescuOffice: HEC 439 BOffice hours: Tu-Th 3:00-4:00 PM222Lecture 9Last time: Modular sharingMetadata and Name OverloadingAddresses Case study: the Unix file systemToday:User-friendly names; Lifetime of namesCase study: URLSoft modularityHard modularityNext Time:Client/Service organizationUser-friendly namesAre always strings of characters.Requirements:the need for a name to be uniqueeasy to rememberuse of lower and upper case letters more common today Multics  first system to use both upper and lower case characters.Case sensitive versus case-preserving nameshttp://Jupiter.Athena.MIT.edu is different from http://jupiter.athena.mit.eduIcons acting as a nameRelative lifetime of namesThe cardinality of the name-space can be limited (the total number of characters is limited, the alphabet is restricted, etc).Names permanently bound to objects; e.g., the registers of a processorNames have a limited life-time and must be reused; dynamic IP addresses are leased for limited amount of timeIn many cases the cardinality of the name-space is practically unlimited and arbitrary names can be choosen.The binding of the name and the objectLong-lived  the phone number, the Email addressShort-lived  the label on your cup of coffee at StarbucksMay be renewed  the binding of the system calls (which are long-lived) issued by an application program to the operating system (alos a long-lived object) are renewed every time the program runsDangling references names that no longer correspond to existing objects; e.g., old telephone numbers.Orphan object  an object that outlives its name. How to garbage collect the space used by the object?Lecture 10 4Case study: URLsHyperlink  a reference in a document to an external or internal piece of informationmakes a logical connection between two places in the same or different documentsto browse through web pages some text in the current document is highlighted so that when clicked, the browser automatically displays another page or changes the current page to show the referenced content. the basic building block of hypertexts.The Web  a file transfer protocol usingThe Hypertext Markup language (HTML) to describe the contentsThe Hypertext Transfer Protocol (HTTP) for communication.Universal Resource Locator (URL) A name in the URL name spaceAbsolute URL  an URL which carries its own context.Example :http://www.cs.ucf.edu/~dcm/Teaching/OperatingSystemsCOT4600/ClassIndex.htmlRelative URL  an URL which does not carry its own context. The context is derived from the page where this relative URL occurs.Example : <a href =“Projects..htm”? Link to projects.</a> Lecture 10 5The name-mapping algorithm for an URLExample: http://www.cs.ucf.edu/~dcm/Teaching/OperatingSystemsCOT4600/ClassIndex.htmlThe string before “:” (colon)  identifies the protocol used, e.g., “http”.The string between “//” and the following “/”  the host name passed to DNS (Domain Name Server) to resolve (e.g., www.cs.ucf.edu)The browser uses the protocol (in our case http) to open the connection with the http-server on the host with the IP address returned by DNS and to locate the file /~dcm/Teaching/OperatingSystemsCOT4600/ClassIndex.htmlIf the file is found then the http-server send the fileLecture 10 6URL case sensitivityThe host name part of the URL (the one sent to DNS) is case sensitive.The part of the URL used to locate the object on the host (the path name)Depends upon the protocol usedHTTP says “this string is NOT a Unix file name” but does not say anything about case sensitivity Case sensitivity for HTTP depends on the file system of the serverOn a standard Unix system the path name is case sensitiveOn a MAC the path name is case-preservingLecture 10 7Alternatives to URLPermanent URL (PURL) Universal Resource Name (URN)  The URNs are part of a larger Internet information architecture which is composed ofURNs used for identification,URCs for including meta-information.URLs for locating or finding resources.Digital Object Identifier (DOJ)  includes metadata; diverse granularityLecture 10 8Soft modularityModularity is critical but the techniques discussed so far do not limit common errors. Soft modularity  divide a program in procedures that call each other. Hard to debug; if one of the modules has an infinite loop, a call never returnsThe caller and the callee are in the same address space and may misuse the stack.Naming conflicts and wrong context specification.Example: procedure MEASURE (func) start_time  GET_TIME(SECONDS) funct() end_time GET_TIME(SECONDS) return (end_time-start_time) procedure GET_TIME (units) timeCLOCK time  CONVERT_TO_UNITS(time,units) return time Lecture 10 10Machine code for MEASURE 100 ST R1,(SP) //save content of R1 on the stack 104 ADD 4, SP //increment stack pointer 108 ST R2, (SP) //save content of R2 on the stack 112 ADD 4, SP //increment stack pointer 116 LA R1, SECONDS //load address of the argument in R1 120 ST R1, (SP) // store address of the argument on the stack 124 ADD 4, SP // increment stack pointer 128 L A R1,148 // load return address in R1 132 ST R1, (SP) // store return address on the stack 136 ADD 4, SP //adjust top stack pointer 140 L A R1, 200 // load address of GET_TIME in


View Full Document

UCF COT 4600 - Lecture Notes

Download 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 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 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?