Class Note for EECS 678 with Professor Kulkarni at KU (2)
Class Note for EECS 678 with Professor Kulkarni at KU (2)
Popular in Course
Popular in Department
This 6 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at Kansas taught by a professor in Fall. Since its upload, it has received 19 views.
Reviews for Class Note for EECS 678 with Professor Kulkarni at KU (2)
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
95 Chapter 10 Outline l File concept I Accessing le data I Directory structure I Protection of information on disk ms 67 mama to owning System Spunng 9 File System Abstraction Blockoriented Byteoriented Physical sectors Named files No protection Users protected from one another Data might be corrupted if Robust to machine failures machine crashes Escsmx medmnanm pumngsy am swgzoav 2 3 Characteristics of a File l Provides a mode of permanent storage of information I Information in a le is related in some way I Files can hold any kind ofinformation 0 text binary applicationde nes structures etc I Files have several attributes 0 name identi er type location size protection and accounting information I File operations 0 basic operations create read write seek delete truncate 0 other operations copy rename list le attributes l Operating system structures 0 systemwide open le table 0 processspeci c open le table ms 67 mama to owning System Spunng 5 File Types I Can indicate the internal structure of a le 0 le extensions can be used to indicate le type I Should OS recognize speci c le structures 0 should at least recognize structure of an executable le 0 may require OS to handle all such structures increasing size 0 may disallow custom userde ned file structures l Unix attempts no interpretation of les 0 application provides code to interpret le structures l Magic number at start of le may recognize le structure 0 inserted by the application creating the le Escsmx medmnanm pumngsy am swgzoav A 1 file type usual extension function executable exe corn bin or none ready to run machine language program object obj o compiled machine language not linked source code 0 cc java pas asm a source code in various languages batch bat sh commands to the command interpreter text txt doc textual data documents word processor wp tex rtf various word processor doc formats library lib a so dll libraries of routines for programmers print or View ps pdf jpg ASCII or binary file in a format for printing or viewing archive arc zip tar related files grouped into one file sometimes com pressed for archiving or storage multimedia mpeg mov rm mp3 avi binary file containing audio or AV information EECS 678 Introduction to Operating Systems Spring 2009 File Types Name Extension Accessing Information in a File l Sequential access 0 bytes are accessed in order 0 operations readnext writenext rewind skip n records I Random direct access 0 bytes are accessed in any order 0 each access uses a relative address from the start of the file 0 request for record N of length L gt request for L bytes starting at location L N from file start I Index based access 0 construct an index for the file 0 user specifies index of the record to retrieve 0 search for index in the index file which points to the record on disk EECS 678 Introduction to Operating Systems Spring 2009 sf Accessing Information in a File 2 l Sequential access beginning cu rrent position end E rewind l read or write gt I Indexed access logical record last name number Adams Arthur Asher index file smith ohn relative file EECS 678 Introduction to Operating Systems Spring 2009 J l Disk can be subdivided into partitions o raw partition without a file system 0 formatted partition with a file system I Partition containing file system known as a volume I Computer systems may have multiple types of file systems 0 general purpose virtual network partition A lt partition B lt WK directory tiles directory tiles idisk 1 EECS 678 Introduction to Operating Systems Spring 2009 File System Organization partition C i directory tiles Jk gt disk 2 idiskS 19 Directories l Structure to hold information about the files in a system 0 partition containing a file system is called a volume 0 records name location size type etc of all files in a volume I Directory operations 0 search file create file delete file rename file list directory traverse the file system I Logical organization of a directory for o efficiency locating a file quickly 0 naming convenient to users gt two users can have same name for different files gt the same file can have several different names 0 grouping logical grouping of files by properties eg all Java programs all games I Study several different directory structures EECS 678 Introduction to Operating Systems 7 Spring 2009 9 18 SingleLevel Directory l A single directory for all users l Advantages 0 simple structure easy and efficient to support I Disadvantages 0 name collisions multiple usersfiles may have the same name 0 not scalable for large systems 0 cannot group related files together EECS 678 Introduction to Operating Systems 7 Spring 2009 10 9 TwoLevel Directory l Separate directory for each user 0 08 only searches user directory for files user file directory cat I be test dataII a ItestII X IdataI aI l Disadvantages 0 still not very scalable user cannot name two files the same Qg as t 0 users may not be allowed to share or group files 0 system files and libraries need to be shared EECS 678 Introduction to Operating Systems 7 Spring 2009 11 s TreeStructured Directories l Generalization of two level structure 0 one root directory 0 unique path for every file in the directory structure T001 spell I in programs I sh mail I dist I I nd locum hex Ireom39eI I p I e ma I l O I Q 0 IreorderI ifs I nd I I hex Icounrl l l O I list I obj Ispeh II a Iastl baud EECS 678 Introduction to Operating Systems 7 Spring 2009 12 E TreeStructured Directories 2 l Advantages o conceptual model maps well into human model of organizing things 0 scalable the probability of name collisions decreases 0 spatial locality store all files under a directory within a cylinder to avoid disk seeks 0 simple searching based on absolute or relative paths 0 grouping capability l Disadvantages 0 not all files fit into the hierarchical model gt some files may need to be listed under multiple directories gt shared files 0 accessing a file may involve many levels of directory lookups gt inefficient EECS 678 Introduction to Operating Systems 7 Spring 2009 13 I 9015 Absolute Path Resolution Read the file header for the root directory 0 stored at a fixed location on disk Read the first data block for the root directory lookup directory entry for pets Read the file header for pets Read data block for pet directory lookup entry for catjpg Read the header file for catjpg Read the data block for catjpg EECS 678 Introduction to Operating Systems 7 Spring 2009 14 g Absolute Path Resolution 2 l Performance optimizations 0 cache top level directories in memory 0 a user inside a directory eg pets can use relative path names eg catjpg to refer to files within the current directory EECS 678 Introduction to Operating Systems 7 Spring 2009 15 t AcyclicGraph Directories l Allows sharing of files or subdirectories 0 same file appears under multiple directory listings count words EECS 678 Introduction to Operating Systems 7 Spring 2009 16 a AcyclicG raph Directories 2 l Links to implement le sharing 0 pointer to another le or subdirectory 0 directory entry of link points includes the name ofthe real le 0 OS resolves link using the embedded path name to nd the real le I Problem of aliasing 0 shared structures may be traversed more than once I do not follow links during directory traversal I If user deletes the shared le I symbolic links become dangling pointers 0 search for all links and remove them 0 leave the links but fail to resolve when used 0 what is le is deleted and later le with same name is created before link is used ms ammomm m pumngsysiau swam W m Reliab ity and Protection l Reliability le system must be safe from physical damage 0 provide duplication using backups on tertiary storage 0 RAID systems I Protection prevent file system from improper access 0 le creatorowner decides who may access the les and 0 how les may be accessed by each user or group cscsmx modmnonm punmgsy am smegma ix 3E Protection l Types of access 0 read write execute append delete list 0 provide lowlevel protection with read write and execute privilege o higherlevel functions for append list delete rename copy implemented with lowlevel checks l Access control I assign different access types to every le directoryfor each user 0 Access control lists AOL r associate user name type of access With every file entry r inefficient variable and large sized directory entry tedious to create ACL for each file 0 Unix provides owner group and universe level permissions r combine access control list With owneriuserigroup form of permissions r ACLs checked before owneriuserigroup permissions ms ammomm m pumngsysiau swam is 3 Access Lists and Groups I Made of access read Write execute l Three classes of users wa aowneraccess r 5 iii wa bgroupaccess a 5 iiu wa cpublicaccess i 5 EIEIi I Ask managerto create a group unique name say 3 and aoo some users to the group I For a particularfile say game or subdirectory define an appropriate access nerurylic chran 761 game Aiiachagreupiea iechgrp G game cscsmx modmnonm punmgsy am smegma 2quot EWindows XP Accesscontrol List Management r5 Paaim rioiPTAjminimramrs r AF T ragga PbHCTlt 1L39HJ gisYs i EM RuSeus PDGiAPTDF KUseis l l l r ssssssss nstmcuest Allow Deny Full Cuntml lgl til Madn39y ll Read amp Execute 1 1 171 HF rl Wma L 111 Spa 1 gr Permi rn n3 Far special DBI mlssiDl IS Dl fur advanced sewn15 clickdvanccd l Advan CD 1 OK EECS 678 Introduction to Operating Systems 7 Spnng 2009 2 5 rwrw r drwx drwxrwxr x drwxrwx rwr r rwxr xr x d1wxxx drwx drwxrwxrwx 1 pbg staff 31200 Sep 3 0830 5 pbg staff 512 Jul 8 0933 2 pbg staff 512 Jul 8 0935 2 pbg student 512 Aug 3 1413 1 pbg staff 9423 Feb 24 2003 1 pbg staff 20471 Feb 24 2003 4pbg faculty 512 Jul 31 1031 3 pbg staff 1024 Aug 29 0652 3 pbg staff 512 Jul 8 0935 EECS 678 Introduction to Opaatmg Systems 7 Spnng 2009 Permissions in a Unix System introps private doc studentproj programs program 00 mail test 22
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'