COMP 3500 Introduction to Operating Systems Directory Structures Block Management Dr. Xiao Qin Auburn University

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

Chapter 4 : File Systems What is a file system?
File Systems.
File Management. Persistent storage Shared device Why Programmers Need Files HTML Editor HTML Editor … … Web Browser Web Browser Structured information.
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.
Chapter 11: File System Implementation
File System Implementation
File System Implementation
Chapter 12: File System Implementation
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
1 File Management in Representative Operating Systems.
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
File System Implementation
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
Chapter 10 File System Interface
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
OSes: 11. FS Impl. 1 Operating Systems v Objectives –discuss file storage and access on secondary storage (a hard disk) Certificate Program in Software.
Dr. T. Doom 11.1 CEG 433/633 - Operating Systems I Chapter 11: File-System Implementation File structure –Logical storage unit –Collection of related information.
Silberschatz and Galvin  Operating System Concepts File-System Implementation File-System Structure Allocation Methods Free-Space Management.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
File System Implementation
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
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.
12.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 12: File System Implementation Chapter 12: File System Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
10.1 CSE Department MAITSandeep Tayal 10 :File-System Implementation File-System Structure Allocation Methods Free-Space Management Directory Implementation.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 11 File-System Implementation Slide 1 Chapter 11: File-System Implementation.
Page 112/7/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  File system structure – layered, block based.
CE Operating Systems Lecture 17 File systems – interface and implementation.
Slide 13-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter File Management.
File Systems. 2 What is a file? A repository for data Is long lasting (until explicitly deleted).
Fall 2000M.B. Ibáñez Lecture 24 File-System III File System Implementation.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
File Systems. Linked block allocation Each block contains a header with –Number of bytes in the block –Pointer to next block Blocks need not be contiguous.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
File Systems.  Issues for OS  Organize files  Directories structure  File types based on different accesses  Sequential, indexed sequential, indexed.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and File Systems.
FILE SYSTEM IMPLEMENTATION 1. 2 File-System Structure File structure Logical storage unit Collection of related information File system resides on secondary.
W4118 Operating Systems Instructor: Junfeng Yang.
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.
File Systems and Disk Management
File System Implementation
File-System Implementation
Chapter 11: File System Implementation
COMP 3500 Introduction to Operating Systems File Management
File System Implementation
Chapter 11: File System Implementation
Operating Systems (CS 340 D)
Filesystems.
File Sharing Sharing of files on multi-user systems is desirable
Chapter 11: File System Implementation
Chapter 11: File System Implementation
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
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.
Overview: File system implementation (cont)
Chapter 14: File-System Implementation
Chapter 11: File System Implementation
File Systems.
File Systems.
Presentation transcript:

COMP 3500 Introduction to Operating Systems Directory Structures Block Management Dr. Xiao Qin Auburn University Slides are adopted and modified from materials developed by Drs. Stallings and Nutt 1

File Descriptors External name Current state Sharable Owner User Locks Protection settings Length Time of creation Time of last modification Time of last access Reference count Storage device details How to design a file control block (a.k.a., file descriptor)? From “File Systems Requirements” to “File Attributes” From “File Attributes” to “a File Control Block” 2

In-Memory File System Structures 3

An open() Operation Locate the on-device (external) file descriptor Extract info needed to read/write file Authenticate that process can access the file Create an internal file descriptor in primary memory (“System-wide”) Create an entry in a “per process” open file status table Allocate resources, e.g., buffers, to support file usage 4

File Manager Data Structures External File Descriptor Open File Descriptor Copy info from external to the open file descriptor 1 Process-File Session Keep the state of the process- file session 2 Return a reference to the data structure 3 5

Virtual File Systems Virtual File Systems (VFS) provide an object- oriented way of implementing file systems. VFS allows the same system call interface (the API) to be used for different types of file systems. The API is to the VFS interface, rather than any specific type of file system. 6

Schematic View of a Virtual File System 7

Directory Structure A collection of nodes containing information about all files F 1 F 2 F 3 F 4 F n Directory Files Both the directory structure and the files reside on disk Backups of these two structures are kept on storage systems 8

Single-Level Directory A single directory for all users Naming problem Grouping problem Good News? Problems? 9

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

Tree-Structured Directories 11

Block Management The job of selecting & assigning storage blocks to the file For a fixed sized file of k blocks – File of length m requires N =  m/k  blocks – Byte b i is stored in block  i/k  Three basic strategies: – Contiguous allocation – Linked lists – Indexed allocation 12

Contiguous Allocation Maps the N blocks into N contiguous blocks on the secondary storage device Difficult to support dynamic file sizes Head position237 … First block785 Number of blocks25 File descriptor 13

Linked Lists Each block contains a header with – Number of bytes in the block – Pointer to next block Blocks need not be contiguous Files can expand and contract Seeks can be slow First block … Head: Length Byte 0 Byte Length Byte 0 Byte Length Byte 0 Byte Block 0Block 1Block N-1 14

Indexed Allocation Extract headers and put them in an index Simplify seeks May link indices together (for large files) Index block … Head: Byte 0 Byte Byte 0 Byte Byte 0 Byte Block 0 Block 1 Block N-1 Length 15

UNIX Files Data mode owner … Direct block 0 Direct block 1 … Direct block 11 Single indirect Double indirect Triple indirect inode Data Index Data Index Data Index Data 16

Unallocated Blocks How should unallocated blocks be managed? Need a data structure to keep track of them – Linked list Very large Hard to manage spatial locality – Block status map (“disk map”) Bit per block Easy to identify nearby free blocks Useful for disk recovery 17

Summary Directory Structures – Single-Level Directory – Two-Level Directory – Tree-Structured Directory Block Management – Contiguous Allocation – Linked Lists – Indexed Allocation 18