1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.

Slides:



Advertisements
Similar presentations
Allocation Methods - Contiguous
Advertisements

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.
File System Implementation
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
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.
04/05/2004CSCI 315 Operating Systems Design1 File System Implementation.
File System Implementation
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.
04/07/2010CSCI 315 Operating Systems Design1 File System Implementation.
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.
ICS Principles of Operating Systems Lectures 14 and 15 - FileSystem Interface and Implementation Prof. Nalini Venkatasubramanian
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.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
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.
Page 110/17/2015 CSE 30341: Operating Systems Principles Acyclic-Graph Directories  Have shared subdirectories and files.
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.
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.
Chapter 11: Implementing File Systems Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 11: Implementing File Systems Chapter.
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.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
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.
ICS Principles of Operating Systems Lectures 14 and 15 - FileSystem Interface and Implementation Prof. Nalini Venkatasubramanian
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.
Chapter 13: File-System Interface
Chapter 11: File System Implementation
Module 10: File-System Interface
Chapter 11: File-System Interface
File Sharing Sharing of files on multi-user systems is desirable
Directory Structure A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Both the directory structure and the.
Chapter 10: File-System Interface
Module 10: File-System Interface
Presentation transcript:

1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof. Mark Corner and Prof. Emery Berger’s OS course at Umass Amherst Assistant Professor, University of Maryland Baltimore County

2 Announcements Homework 3 is out (due nov 27 th ) Travelling next week: Dr. Joshi will teach on M/W

Access Lists and Groups Mode of access: read, write, execute Three classes of users RWX a) owner access 7  RWX b) group access 6  RWX c) public access1  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. ownergrouppublic chmod761game

4 elnux14> ls -l ack.scm -rw-r emery fac 197 Feb 25 15:19 ack.scm elnux14> chmod -r ack.scm elnux14> ls -l ack.scm --w emery fac 197 Feb 25 15:19 ack.scm elnux14> cat ack.scm cat: ack.scm: Permission denied Access Control - chmod Can read bits via ls, set bits via chmod

Access Control Lists (ACLs) in Windows ACLs are more expressive –Specify different rights per user or group –Opinion: one of the biggest UNIX problems

Access Methods Sequential Access read next write next reset no read after last write (rewrite) Direct Access read n write n position to n read next write next rewrite n n = relative block number

Sequential-access File

Example of Index and Relative Files

9 Directories Directory – just special file –Contains metadata, filenames –Store pointers to files Typically hierarchical tree –odd exposure of data structure to user

A Typical File-system Organization

Operations Performed on Directory Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system

Organize the Directory (Logically) to Obtain Efficiency – locating a file quickly Naming – convenient to users –Two users can have same name for different files –The same file can have several different names Grouping – logical grouping of files by properties, (e.g., all Java programs, all games, …)

Single-Level Directory A single directory for all users Naming problem Grouping problem

Two-Level Directory Separate directory for each user Path name Can have the same file name for different user Efficient searching No grouping capability

Tree-Structured Directories

Tree-Structured Directories (Cont.) Efficient searching Grouping Capability Current directory (working directory) –cd /spell/mail/prog

Tree-Structured Directories (Cont) Absolute or relative path name Creating a new file is done in current directory Delete a file rm Creating a new subdirectory is done in current directory mkdir Example: if in current directory /mail mkdir count mail progcopyprtexpcount Deleting “mail”  deleting the entire subtree rooted by “mail”

Acyclic-Graph Directories Have shared subdirectories and files (how do you accomplish this?)

Acyclic-Graph Directories (Cont.) Two different names (aliasing) If dict deletes list  dangling pointer Solutions: –Backpointers, so we can delete all pointers Variable size records a problem –Entry-hold-count solution New directory entry type –Link – another name (pointer) to an existing file –Resolve the link – follow pointer to locate the file

General Graph Directory

General Graph Directory (Cont.) How do we guarantee no cycles? –Allow only links to file not subdirectories –Garbage collection –Every time a new link is added use a cycle detection algorithm to determine whether it is OK

A Typical File Control Block

Inodes (An example of a FCB) On disk data structure –Describes where all the bits of a file are

24 Directories Directory – just special file –Contains metadata, filenames pointers to inodes Typically hierarchical tree –odd exposure of data structure to user

In-Memory File System Structures

Directory Implementation Linear list of file names with pointer to the data blocks –Simple to program –Time-consuming to execute Linear search time Could keep ordered alphabetically via linked list or use B+ tree Hash Table – linear list with hash data structure –Decreases directory search time –Collisions – situations where two file names hash to the same location –Only good if entries are fixed size, or use chained-overflow method

Allocation Methods - Contiguous An allocation method refers to how disk blocks are allocated for files: Contiguous allocation – each file occupies set of contiguous blocks –Best performance in most cases –Simple – only starting location (block #) and length (number of blocks) are required –Problems include finding space for file, knowing file size, external fragmentation, need for compaction off-line (downtime) or on-line

Contiguous Allocation Mapping from logical to physical LA/512 Q R Block to be accessed = Q + starting address Displacement into block = R

Contiguous Allocation of Disk Space

Extent-Based Systems Many newer file systems (i.e., Veritas File System) use a modified contiguous allocation scheme Extent-based file systems allocate disk blocks in extents An extent is a contiguous block of disks –Extents are allocated for file allocation –A file consists of one or more extents

Allocation Methods - Linked Linked allocation – each file a linked list of blocks –File ends at nil pointer –No external fragmentation –Each block contains pointer to next block –No compaction, external fragmentation –Free space management system called when new block needed –Improve efficiency by clustering blocks into groups but increases internal fragmentation –Reliability can be a problem –Locating a block can take many I/Os and disk seeks FAT (File Allocation Table) variation –Beginning of volume has table, indexed by block number –Much like a linked list, but faster on disk and cacheable –New block allocation simple

Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk pointer block =

Linked Allocation

File-Allocation Table

Allocation Methods - Indexed Indexed allocation –Each file has its own index block(s) of pointers to its data blocks Logical view index table

Example of Indexed Allocation

37 Lets chat about project 2