COT 4600 Operating Systems Fall 2009Lecture 7NamingBinding and indirectionGeneric naming modelSlide 6Operations on names in the abstract modelName mappingName-mapping algorithms1. Table lookupHow to determine the contextDynamic and multiple contexts2. Recursive name resolutionExample3. Multiple lookupComparing namesName discoveryComputer System OrganizationSlide 19A. The hardware layerSlide 21Bus sharing and optimizationOptimizationSlide 24B. The software layer: the file abstractionSlide 261COT 4600 Operating Systems Fall 2009Dan C. MarinescuOffice: HEC 439 BOffice hours: Tu-Th 3:00-4:00 PM2Lecture 7 22Lecture 7Last time: 2. Interpreters3. Communication LinksInternet or what is behind the abstractions… Today:Naming in computing systemsNext TimeCase Study: Unix File SystemAnnouncements: - no office hours on Thursday, September 17. - Phase 1 of the project is due on Thursday, September 17 - HW 2 is due on Thursday September 24.3Lecture 7 3NamingThe three abstractions (memory, interpreters, communication links manipulate objects identified by name. How could object A access object B:Make a copy of object B and include it in A use by valueSafe there is a single copy of BHow to implement sharing of object B?Pass to A the means to access B using its name use by reference Not inherently safe both A and C may attempt to modify B at the same time. Need some form of concurrency control.4Lecture 7 4Binding and indirectionIndirection decoupling objects from their physical realization through names.Names allow the system designer to:1. organize the modules of a system and to define communication patterns among them2. defer for a later time to create object B referred to by object Aselect the specific object A wishes to useBinding linking the object to names. Examples:A compiler constructs a table of variables and their relative address in the data section of the memory map of the processa list of unsatisfied external referencesA linker binds the external references to modules from libraries5Lecture 7 5Generic naming modelNaming scheme strategy for naming. Consists of:Name space the set of acceptable names; the alphabet used to select the symbols from and the syntax rules.Universe of values set of objects/values to be namedName mapping algorithm resolves the names, establishes a correspondence between a name and an object/value Context the environment in which the model operates.Example: searching for John Smith in the White Pages in Orlando (one context) or in Tampa (another context).Sometimes there is only one context universal name space; e.g., the SSNs.Default context6Lecture 7 6Figure 2.10 from the textbook7Lecture 7 7Operations on names in the abstract modelSimple models: value RESOLVE (name, context)The interpreter:Determines the version of the RESOLVE (which naming scheme is used)Identifies the contextLocates the objectExample: the processorComplex models support: creation of new bindings: status BIND(name, value, context)deletion of old bindings: status UNBIND(name, value)enumeration of name space: list ENUMERATE(context)comparing names status: result COMPARE(name1,name2)8Lecture 7 8Name mappingName to value mappingOne-to-One the name identifies a single objectMany-to-One multiple names identify one objects (aliasing)One-to-Many multiple objects have the same name even in the same context.Stable bindings the mapping never change. Examples:Social Security NumbersCustomerId for customer billing systems9Lecture 7 9Name-mapping algorithms1. Table lookup1. Phone book2. Port numbers a port the end point of a network connection2. Recursive lookup:1. File systems – path names2. Host names – DNS (Domain Name Server)3. Names for Web objects - URL – (Universal Resource Locator) 3. Multiple lookup searching through multiple contexts1. Libraries2. Example: the classpath is the path that the Java runtime environment searches for classes and other resource files10Lecture 7 101. Table lookupFigure 2.11 from the textbook11Lecture 7 11How to determine the contextContext references: Default supplied by the name resolverConstant built-in by the name resolverProcessor registers (hardwired)Virtual memory (the page table register of an address space)Variable supplied by the current environmentFile name (the working directory)Explicit supplied by the object requesting the name resolutionPer objectLooking up a name in the phone book Per name each name is loaded with its own context reference (qualified name). URLHost names used by DNS12Lecture 7 12Dynamic and multiple contextsContext reference static/dynamic.Example: the context of the “help” command is dynamic, it depends where you are the time of the command.A message is encapsulated (added a new header, ) as flows down the protocol stack:Application layer (application header understood only in application context)Transport layer (transport header understood only in the transport context)Network layer (network header understood only in the network context)Data link layer (data link header understood only in the data link context)13Lecture 7 132. Recursive name resolutionContexts are structured and a recursion is needed for name resolution. Root a special context reference - a universal name spacePath name name which includes an explicit reference to the context in which the name is to be resolved.Example: first paragraph of page 3 in part 4 of section 10 of chapter 1 of book “Alice in Wonderland.” The path name includes multiple components known to the user of the name and to name solverThe least element of the path name must be an explicit context referenceAbsolute path name the recursion ends at the root context. Relative path name path name that is resolved by looking up its mot significant component of the path name14Lecture 7 14ExampleAliceInWonderland.Chapter1.Section10.Part4.Page3.FirstParagraph Most significant Least significant15Lecture 7 153. Multiple lookupSearch path a list of contexts to be searched Example: the classpath is the path that the Java runtime
View Full Document