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 9Last time: Modular sharingMetadata and Name OverloadingAddresses Case study: the Unix file systemToday:User-friendly names; Lifetime of namesCase study: URLSoft modularityHard modularityNext Time:Client/Service organizationUser-friendly namesAre always strings of characters.Requirements:the need for a name to be uniqueeasy to rememberuse 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 nameshttp://Jupiter.Athena.MIT.edu is different from http://jupiter.athena.mit.eduIcons acting as a nameRelative lifetime of namesThe 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 processorNames have a limited life-time and must be reused; dynamic IP addresses are leased for limited amount of timeIn many cases the cardinality of the name-space is practically unlimited and arbitrary names can be choosen.The binding of the name and the objectLong-lived the phone number, the Email addressShort-lived the label on your cup of coffee at StarbucksMay 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 runsDangling 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: URLsHyperlink a reference in a document to an external or internal piece of informationmakes a logical connection between two places in the same or different documentsto 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 usingThe Hypertext Markup language (HTML) to describe the contentsThe Hypertext Transfer Protocol (HTTP) for communication.Universal Resource Locator (URL) A name in the URL name spaceAbsolute URL an URL which carries its own context.Example :http://www.cs.ucf.edu/~dcm/Teaching/OperatingSystemsCOT4600/ClassIndex.htmlRelative 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 URLExample: http://www.cs.ucf.edu/~dcm/Teaching/OperatingSystemsCOT4600/ClassIndex.htmlThe 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.htmlIf the file is found then the http-server send the fileLecture 10 6URL case sensitivityThe 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 usedHTTP 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 serverOn a standard Unix system the path name is case sensitiveOn a MAC the path name is case-preservingLecture 10 7Alternatives to URLPermanent URL (PURL) Universal Resource Name (URN) The URNs are part of a larger Internet information architecture which is composed ofURNs used for identification,URCs for including meta-information.URLs for locating or finding resources.Digital Object Identifier (DOJ) includes metadata; diverse granularityLecture 10 8Soft modularityModularity 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 returnsThe 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) timeCLOCK 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