Unformatted text preview:

Slide 1Lecture 14 – Tuesday, March 15, 2011Problem 1 NamingExample 1- abstract model of an interpreter – Figure 2.5Naming MODEL – (see Lecture 8)Example 2: Abstract model of naming: Figure 2.10The role of the context for modular sharingExample: context used for modular sharing, Figure 3.5Slide 9Problem 2 – UNIX file systemB. The software layer: the file abstractionAPI for the Unix File SystemAPI for the Unix File System (cont’d)Figure 2.20 and 2.22Generic OPEN and READ operations (Lecture 8)Logical and physical organizationSlide 17How to map logical to physical organizationSlide 19How to access the inode for a file in UNIXUnix OPEN and READSlide 22Problem 3  NFS (see Lecture 13)NFS clients and serversSlide 25ImplementationSlide 27Why file handles and not path namesRead/Write coherenceSlide 30NFS Close-to-Open semanticsCOT 4600 Operating Systems Spring 2011Dan C. MarinescuOffice: HEC 304Office hours: Tu-Th 5:00 – 6:00 PMLast time: MidtermTodaySolution of the midterm problems and midterm discussionNext timeVirtualizationLocksLecture 14 – Tuesday, March 15, 2011Lecture 14 2Problem 1 NamingConceptual/abstract model: a description which retains the most important characteristics of the process/object in a given context.The model of an airplane wingThe abstraction of an interpreterLecture 14 3Example 1- abstract model of an interpreter – Figure 2.5 Lecture 14 4Naming MODEL – (see Lecture 8) Naming allows objectsto refer to each otherto locate another objectsto determine the properties of other objectsNaming model  a general scheme to resolve a name which can be applied for a spectrum of objects and implementations; examplesSearching for an address in phone bookCompiling a program which uses a libraryIdentifying the registers used during execution of a compiled programFour components:Name space (the universe of names)Mapping functionThe universe of valuesContextA function which has as input: a name and a context and produces a valueLecture 14 5Example 2: Abstract model of naming: Figure 2.10Lecture 14 6The role of the context for modular sharingModular sharing: allows one module to use another module developed independently, without the danger of name collision (page 117 of the text book)All names encountered during the name resolution for module A are resolved using the context of A; in other words trhe context of module A points to all modules used by A (including A); The context allows modular sharing; if both modules A and B use a function called W, but the two functions are different (call them WA and WB for convenience) then the context of A will point to the function WA and the context of B will point to WBLecture 14 7Example: context used for modular sharing, Figure 3.5 Lecture 14 8Lecture 14 9Problem 2 – UNIX file systemLecture 8 Basic concepts related to file handlingHow UNIX users access a file – APIInternal implementation of file operations for a generic systemHow to map logical to physical organizationUNIXLecture 14 10B. The software layer: the file abstractionFile: memory abstraction used by the application and OS layerslinear array of bits/bytesproperties:durable  information will not be changed in timehas a name allows access to individual bits/bytes  has a cursor which defines the current position in the file.The OS provides an API (Application Programming Interface) supporting a range of file manipulation operations.A user must first OPEN a file before accessing it and CLOSE it after it has finished with it. This strategy:allows different access rights (READ, WRITE, READ-WRITE) coordinate concurrent access to the fileSome file systems use OPEN and CLOSE to enforce before-or-after atomicity  support all-or-nothing atomicity  e.g., ensure that if the system crashes before a CLOSE either all or none of WRITEs are carried outLecture 8 11API for the Unix File SystemOPEN(name, flags, model)  connect to a file Open an existing file called name, or Create a new file with permissions set to mode if flags is set. Set the file pointer (cursor) to 0. Return the file descriptor (fd).CLOSE(fd)  disconnect from a file Delete file descriptor fd.READ(fd, buf,n)  read from file Read n bytes from file fd into buf; start at the current cursor position and update the file cursor (cursor = cursor + n).WRITE(fd, buf,n)  write to file Write n bytes to the file fd from buf; start at the current cursor position and update the file cursor (cursor = cursor + n). SEEK(fd, offset,whence)  move cursor of file Set the cursor position of file fd to offset from the position specified by whence (beginning, end, current position) Lecture 8 12API for the Unix File System (cont’d)FSYNC(fd)  make all changes to file fd durable.STAT(name) read metadata CHMOD, CHOWN  change access mode/ownershipRENAME(from_name,to_name)  change file nameLINK(name, link_name) create a hard linkUNLINK(name) remove name from directorySYMLINK(name, link_name) create a symbolic linkMKDIR(name) create directory nameRMDIR(name) delete directory nameCHDIR(name)  change current directory to nameCHROOT  Change the default root directory nameMOUNT(name,device)  mount the file system name onto deviceUNMOUNT(name)  unmount file system nameLecture 8 13Figure 2.20 and 2.22Lecture 8 14Generic OPEN and READ operations (Lecture 8)Lecture 8 15Logical and physical organizationLogical/physical records: a file consists of a set of logical recordsa persistent storage media (e.g., disk) is organized as a sequence of blocks/physical records.Hierarchical logical organization Records FileDirectoryFile systemLecture 14 16Lecture 14 17How to map logical to physical organizationDefine a control structure which holds information about a file a directory, or a file system. For a file this information includes:Creation dateOwnerSizeAccess rights (read, write, execute)The physical location of the fileStore this meta information on the persistent storage (disk).In UNIX call such a control structure – inodean inode describes a file, a directory, or a file system The inode table stores the block where the inodes for directories are locatedLecture 14 18Lecture 14 19How to access the inode for a file in UNIXGiven a path name the following


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?