Outline for EECS 678 with Professor Kulkarni at KU 3
Outline for EECS 678 with Professor Kulkarni at KU 3
Popular in Course
Popular in Department
This 22 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 28 views.
Reviews for Outline for EECS 678 with Professor Kulkarni at KU 3
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
5 Chapter 10 Outline l File concept I Accessing file data I Directory structure I Protection of information on disk EECS 678 Introduction to Operating Systems 7 Sp ng 2009 5 File System Abstraction Blockoriented r Byteoriented Physical sectors Named files No protection Users protected from one another Data might be corrupted if Robust to machine failures machine crashes EECS 678 Introduction to Operating Systems 7 Sp ng 2009 2 5 Characteristics of a File l Provides a mode of permanent storage of information I Information in a file is related in some way I Files can hold any kind of information 0 text binary applicationdefines structures etc I Files have several attributes 0 name identifier 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 file attributes l Operating system structures 0 systemwide openfile table I processspecific openfile table EECS 678 Introduction to Operating Systems 7 Sp ng 2009 5 File Types I Can indicate the internal structure of a file 0 file extensions can be used to indicate file type I Should OS recognize specific file structures 0 should at least recognize structure of an executable file 0 may require 08 to handle all such structures increasing size 0 may disallow custom userdefined file structures l Unix attempts no interpretation of files 0 application provides code to interpret file structures l Magic number at start of file may recognize file structure 0 inserted by the application creating the file EECS 678 Introduction to Operating Systems 7 Sp ng 2009 3 File Types Name Extension file type usual extension function executable exe com bin readytorun machine or none language program object obj o compiled machine language not linked source code c cc java pas source code in various asm a languages batch bat sh commands to the command interpreter text tgtltt doc textual data documents word processor wp tex rtf various wordprocessor 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 binary file containing mp3 avi audio or AV information EECS 678 Introduction to Opemting Systems 7 Spring 2009 Accessing Information in a File l Sequential access 0 bytes are accessed in order 0 operations readnexz writenexz 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 Indexbased access 0 construct an index for the file 0 user specifies index of the record to retrieve 0 search for index in the indexfile which points to the record on disk EECS 678 Introduction to Operating Systems 7 Sp ng 2009 6 if Accessing Information in a File 2 I Sequential access beginning current position end 4 rewind I Indexed access logical record last name number Adams Arthur Asher O 0 O Smith index file read or write up smith john socialsecurity age relative file EECS 678 Introduction to Operating Systems Spring 2009 g Disk can be subdivided into partitions O raw partition without a le system formatted partition with a le system Partition containing file system known as a volume Computer systems may have multiple types of file systems 0 general purpose virtual network partition A partition B directory tiles directory tiles disk 1 EECS 678 Introduction to Operating Systems 7 Spring 2009 File System Organization partition C lt directory fi 95 gt disk 2 J gt disk 3 5 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 Sp ng 2009 a SingleLevel Directory l A single directory for all users wwaaaaaaaaa Q files I 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 TwoLevel Directory I Separate directory for each user 0 OS only searches user directory for les master file directory USGI 1 USEI39Z user3 user4 test a data a test X data a iltlttlt l Disadvantages 0 still not very scalable user cannot name two les the same 0 users may not be allowed to share or group les 0 system les and libraries need to be shared user file ectory EECS 678 Introduction to Operating Systems 7 Spring 2009 11 a TreeStructured Directories l Generalization of twolevel structure 0 oneroot directory 0 unique path for every le in the directory structure root spell bin pmgmms mail mi mm ms find count hox murder p 9 83 b 5 d9 69 5 count exp Isolde list find hex 151 ab spell aquot last lsl 56 Ems m In nmcunnln opmung SynanerpnngZOOQ my my pn 12 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 Sp ng 2009 13 a 9701990 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 catij Read the header file for catij Read the data block for catij EECS 678 Introduction to Operating Systems 7 Spring 2009 14 i 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 Absolute Path Resolution 2 EECS 678 Introduction to Operating Systems 7 Sp ng 2009 15 E AcyclicGraph Directories l Allows sharing of files or subdirectories 0 same file appears under multiple directory listings root dict spell list all W count count words list V gt list rade W7 w EECS 678 Introduction to Operating Systems 7 Spring 2009 16 AcyclicGraph Directories 2 l Links to implement file sharing 0 pointer to another file or subdirectory 0 directory entry of link points includes the name of the real file 0 OS resolves link using the embedded path name to find the real file I Problem of aliasing 0 shared structures may be traversed more than once 0 do not follow links during directory traversal I If user deletes the shared file 0 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 file is deleted and later file with same name is created before link is used EECS 678 Introduction to Operating Systems 7 Sp ng 2009 17 5 Reliability and Protection l Reliability file 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 file creatorowner decides who may access the files and 0 how files may be accessed by each user or group EECS 678 Introduction to Operating Systems 7 Spn39ng 2009 18 5 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 0 assign different access types to every file directory for each user 0 Access control lists ACL gt associate user name type of access with every file entry gt inefficient variable and large sized directory entry tedious to create AOL for each file 0 Unix provides owner group and universe level permissions gt combine access control list with ownerusergroup form of permissions gt ACLs checked before ownerusergroup permissions EECS 678 Introduction to Operating Systems 7 Sp ng 2009 19 Access Lists and Groups Mode of access read write execute Three classes of users RWX a owner access 7 gt 1 1 1 RWX b group access 6 gt 1 1 0 RWX c public access 1 gt 0 0 1 Ask manager to create a group unique name say G and add some users to the group For a particular file say game or subdirectory define an appropriate access owanrclmiylic chmod 761 game Attach a group to a file chgrp G game EECS 678 Introduction to Operating Systems 7 Sp ng 2009 20 is Windows XP Accesscontrol List Management 10 ex Pmpemes VGEHEYBI Sacumy Summary Gmup Uruggrnamgs zAdmwmslraImE PEG LAPTOHAdmmlslralma F E grLAFT pbg CTpbg ZESYSTEM Usevs PEG LAPTDMUSEVSJ Pavmwssmhsmr uast A IDW Deny FuH Cdnudl D Maddy D Read amp Execme B Read D Wme D Spema Perrmssmns Fmspema pevmwsslnnsmfnvadvancedsemnqs chck Advanced EECS 67E Introducnonto Op mung Systems 7 Spnng 2009 9 1 W1 W1 dIWX Cll WXlWXl X erX1WX rw 1 1 1 wx1 x1 x Cll WXXX drwx d1wx1 wx1wx staff 3 1200 staff 5 l 2 staff 5 12 student 5 12 staff 9423 staff 2047 1 faculty 5 12 staff 1024 staff 5 12 Sep 3 0830 Jul 8 0933 Jul 8 0935 Aug 3 1413 Feb 24 2003 Feb 24 2003 Jul 31 1031 Aug 29 0652 Jul 8 0935 EECS 678 Intraducnan m Opantlng Sy ans r Spnng 2009 Permissions in a Unix System int1 0ps private doc student proj programc program lib 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'