Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 11: File-System Interface.

Slides:



Advertisements
Similar presentations
File-System Interface
Advertisements

Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface Chapter Outline File Concept Access Methods Directory.
Chapter 10: File-System Interface
1 Chapter 11: File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection  Chapter.
Chapter 10: File-System Interface
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Chapter 10: File-System Interface
File System Interface CSCI 444/544 Operating Systems Fall 2008.
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
1 File Management (a). 2 File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection.
04/02/2004CSCI 315 Operating Systems Design1 File System Interface.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File-System Interface.
04/05/2010CSCI 315 Operating Systems Design1 Virtual Memory Wrap-up; File System Interface.
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
Chapter 10: File-System Interface
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 10: File-System Objectives To discuss file-system design tradeoffs, including.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
File Concept l Contiguous logical address space l Types: Data: numeric, character, binary Program: source, object (load image) Documents.
Os111 Chapter 11 File-System Interface. os112 Outline File Concept Access Methods Directory Structure File System Mounting File Sharing Protection.
03/30/2007CSCI 315 Operating Systems Design1 Virtual Memory cont’d.; File System Interface.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
Chapter 10 File System Interface
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 Chapter 10: File-System Interface.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 10 Operating Systems.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 10-1: File Systems Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Silberschatz, Galvin and Gagne  Operating System Concepts File Concept Contiguous logical address space Smallest user allocation Non-volatile.
Chap 10 File-System Interface. Objectives To explain the function of file systems To describe the interfaces to file systems To discuss file-system design.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure File-System.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
Chapter 10: File-System Interface 10.1 Silberschatz, Galvin and Gagne ©2011 Operating System Concepts – 8 th Edition 2014.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Page 110/19/2015 CSE 30341: Operating Systems Principles Chapter 10: File-System Interface  Objectives:  To explain the function of file systems  To.
File-System. Overview File system is the visible aspect of an OS. It provides mechanism for on-line storage of and access to both data and programs of.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 11: File-System Interface Modified.
10.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 10: File-System Interface.
Module 4.0: File Systems File is a contiguous logical address space.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 11: File-System Interface File Concept Access Methods Directory Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
CS 346 – Chapter 11 File system –Files –Access –Directories –Mounting –Sharing –Protection.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Lecture 18: File-System Interface (Ch 10)
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
Silberschatz and Galvin  Operating System Concepts Module 10: File-System Interface File Concept Access :Methods Directory Structure Protection.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
It consists of two parts: collection of files – stores related data directory structure – organizes & provides information Some file systems may have.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Access Methods File store information When it is used it is accessed & read into memory Some systems provide only one access method IBM support many access.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems File System Interface.
W4118 Operating Systems Instructor: Junfeng Yang.
CSE Operating System Principles File Systems.
Lecture : chapter 9 and 10 file system 1. File Concept A file is a collection of related information defined by its creator. Contiguous logical address.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 10: File-System 10.1 File Concept 10.2 Access Methods 10.3 Directory Structure.
File System Interface CSSE 332 Operating Systems
Chapter 13: File-System Interface
Module 10: File-System Interface
Chapter 11: File-System Interface
Chapter 11: File-System Interface
EECE.4810/EECE.5730 Operating Systems
Chapter 10: File-System Interface
File-System Interface
Module 10: File-System Interface
Lecture 4: File-System Interface
Presentation transcript:

Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 11: File-System Interface

11.2 Chapter 11: File-System Interface File Concept Access Methods Directory Structure File-System Mounting File Sharing Protection

11.3 Objectives To explain the function of file systems To describe the interfaces to file systems To discuss file-system design tradeoffs, including access methods, file sharing, file locking, and directory structures To explore file-system protection

11.4 File Concept A file is an abstract data type a contiguous logical address space the smallest unit of stored physical information Non-volatile Types: Text Source code Object Executable

11.5 File Structure None - sequence of words, bytes Simple record structure Lines Fixed length Variable length Complex Structures Formatted document Relocatable load file Can simulate last two with first method by inserting appropriate control characters

11.6 File Attributes Name – only information kept in human-readable form Identifier – unique tag (number) identifies file within file system Type – needed for systems that support different types Location – pointer to file location on device Size – current file size Protection – controls who can do reading, writing, executing Time, date, and user identification – data for protection, security, and usage monitoring Information about files are kept in the directory structure, which is maintained on the disk

11.7 File Operations Create Allocate space, add entry in directory Write (Append) Find file in directory, find end-of-file, add information from memory Read Find file in directory, go to current file position pointer, add information to memory, update pointer Reposition within file (seek) Find file in directory, find desired position, update pointer Delete Find file in directory, mark all allocated space as empty, remove file from directory Truncate (delete all content) Find file in directory, mark all allocated space as empty

11.8 File Operations Operations implemented by system calls Open(F) Find F in directory, move contents from allocated space on disk to memory Close(F) Move the content F in memory to allocated space on disk, mark memory space as free Create(F) Delete(F) Both work on closed files on disk rather than opened files in memory System call implementation trickier if OS allows multiple processes to use files at once

11.9 File Tables OS typically maintains two levels of file information in two file tables Per-Process File Table Which files does this process have open The process’ current file position pointer Process’ access rights System-Wide File Table Which files are currently opened File-Open Count: how many processes have opened each file File’s location in directory and on disk Accounting information

11.10 Open File Locking Provided by some operating systems and file systems to control access to a file Shared or exclusive: Shared – concurrent access by multiple processes is allowed (reader lock) Exclusive – one process has exclusive access (writer lock) Mandatory or advisory: Mandatory – lock is enforced by operating system Advisory – processes can find status of locks and decide what to do

11.11 File Types Different types of file (text, object, binary) have different contents and require different actions OS should recognise file types and take reasonable default action (i.e. open file with correct program) Implemented in different ways MS-DOS/Windows: File extension after name specifies type and program information Mac OS X: Basic types (text, appl), program information is “creator” file attribute Unix: Magic number at beginning of file represents rough file type, no program information stored

11.12 File Types

11.13 File Structure Different file types have different internal structures Content must be interpreted differently Internal file structures may or may not be supported by OS User-program-specific structures are not supported  OS reads file byte by byte, sends to user process without interpreting There must be a minimal number of system-supported structures the OS can interpret (ex.: executable code, text)  More supported types = more support and functionality in OS, bigger and more cumbersome OS

11.14 Access Methods Sequential Access Simplest, most common method Operations: Read next, write next, reset, optional forward & rewind I Direct (Relative) Access Access relative block number Operations: Read n, write n, position to n Can simulate sequential access (n += 1) Indexed Access Extension of direct access Blocks have ID numbers, operations access ID in index Multilevel indexes (index of index values) allow management of larger indexes

11.15 Disk Structure Non-volatile secondary memory of the system Disk can be subdivided into partitions Disk or partition can be used raw – without a file system, or formatted with a file system Entity containing file system known as a volume Each volume containing file system also tracks that file system’s info in device directory or volume table of contents As well as general-purpose file systems there are many special-purpose file systems, frequently all within the same operating system or computer

11.16 Operations Performed on Directory Search for a file Find directory entry that matches desired name Create a file Add entry to directory Delete a file Remove entry from directory Rename a file Modify the directory entry of a specific file File name should be unique List a directory Cycle through all entries in directory, listing information from each entry Traverse the file system Access every directory in the computer system and its content Can be useful for automated system backups, for example

11.17 Single-Level Directory A single directory for the system Limitations No multi-user support Enforcing unique names for files becomes problematic with thousands of files

11.18 Two-Level Directory Separate directory for each user Improvements & limitations Unique file names enforced at UFD level Each user isolated from others: no sharing System files stored in special user directory: multi-step search for file looks in user directory then in system directories in search path

11.19 Generalization of two-level directory to arbitrary levels Tree-Structured Directory

11.20 File and subdirectory are identical directory entries, differentiated by a single binary flag Improvements & limitations Unique file name requirement enforced at subdirectory level Users can access some subdirectories belonging to other users Needs new system calls to create & delete subdirectories and change the current directory Need support for path names (absolute and relative paths) Tree-Structured Directory

11.21 Acyclic-Graph Directory Shared files and subdirectories appear in each user’s subdirectory Only one copy of a shared file exists Appears in two places in the directory graph Changes done by one user are immediately visible to everyone

11.22 Acyclic-Graph Directory Sharing implementation methods Link  Requires a new directory entry type  Pointer to an existing file or subdirectory  Can contain the absolute or relative path (symbolic links) or the disk address (hard links)  Resolve the link by following path/address to locate the file  Most popular approach (Unix & Windows) Duplication  Identical entries in all directories  Need to maintain consistency in all directories Sharing problems Any file might now have multiple paths After files are deleted, pointers lead to nonexistent paths/disk address of other files

11.23 General Graph Directory Adding and deleting subdirectories and pointers to subdirectories will eventually lead to cycles in the graph!

11.24 Acyclic Graph vs. General Graph IssueAcyclicGeneral SearchingSearch each directory and its subdirectories Need loop detection otherwise algorithm can be stuck in infinite loop Self-referencingImpossiblePossible, and can falsely increase the file’s reference count, making it “undeletable” Adding linksNeed to prevent cycles, with cycle detection algorithm or special policy Always allowed

11.25 File System Mounting A file system must be mounted before it becomes part of the system’s namespace and can be accessed by processes in the system An unmounted file system is mounted at a mount point (a location in the existing directory hierarchy, typically an empty directory)

11.26 File System Mounting An unmounted file system is a volume on disk Needs to be mounted into the existing file system before it can be used Mount to specified directory in subsystem (will overwrite existing directory structure)

11.27 File System Mounting Macintosh When the system encounters a new disk, it automatically checks the file system and, if valid, mounts it at the root level Unix Devices can be mounted to any subfolder Mount can be commanded explicitly by user OS keeps track of devices and mount points Mac OS X / BSD Unix All file systems are mounted in the /Volumes directory Mac OS X hides this fact and shows them mounted at root level Windows Two-level system directory Devices and volumes automatically mounted to second level and get drive letters Each drive letter then has a general graph directory structure

11.28 Protection In multi-user system, we need to protect files from inappropriate access by unauthorized users File system usually gives control over these operations Read Write Execute Append Delete List Other operations (rename, copy, edit, etc.) can be implemented by operating system

11.29 Access Control Most common approach to protection Each file & directory has an access control list Contains user + access rights OS checks list before granting a user access to a file Problems: Giving access to a file to everyone involves listing each individual user in the access control list Building a list may be impossible if we do not know in advance the users of the system The list is stored in the directory entry, making is unpredictable in size (and potentially very large)

11.30 Access Control Can solve the list problems by creating three user classifications Owner  The creator of the file, has full access by default Group  A group of users who all have the same level of access Universe  Anyone who’s not the owner or in the group, have this (normally lower) level of access An access control list can be added to the file if you need to define access for specific individual users

11.31 Windows XP Access Control

11.32 UNIX Access Control

11.33 Review What is a file table and what is it used for? How many are there in the system? How does a two-level file system alleviate the problems of a single-level file system?

11.34 Exercises Read everything but skip 11.5 (File Sharing) If you have the “with Java” textbook, skip the Java sections and subtract 1 to the following section numbers

Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, End of Chapter 11