Lecture 44 Syed Mansoor Sarwar

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

1 Chapter 11: File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection  Chapter.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
Chapter 10: File-System Interface
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
04/02/2004CSCI 315 Operating Systems Design1 File System Interface.
File System Implementation
04/05/2010CSCI 315 Operating Systems Design1 Virtual Memory Wrap-up; File System Interface.
Chapter 12: File System Implementation
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
Linux+ Guide to Linux Certification, Second Edition
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 11: File System Implementation.
File System Structure §File structure l Logical storage unit l Collection of related information §File system resides on secondary storage (disks). §File.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
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.
04/07/2010CSCI 315 Operating Systems Design1 File System Implementation.
File Concept §Contiguous logical address space §Types: l Data: Numeric Character Binary l Program.
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 10: File-System Interface.
Silberschatz, Galvin and Gagne  Operating System Concepts File Concept Contiguous logical address space Smallest user allocation Non-volatile.
Linux+ Guide to Linux Certification, Second Edition
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
1 CMSC421: Principles of Operating Systems Nilanjan Banerjee Principles of Operating Systems Acknowledgments: Some of the slides are adapted from Prof.
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 ©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.
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.
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.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
File Systems. 2 What is a file? A repository for data Is long lasting (until explicitly deleted).
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
Allocation Methods An allocation method refers to how disk blocks are allocated for files: Contiguous allocation Linked allocation Indexed allocation.
Operating Systems Files, Directory and File Systems Operating Systems Files, Directory and 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.
File-System Management
File System Implementation
File-System Implementation
Chapter 11: File System Implementation
Module 10: File-System Interface
Chapter 11: File-System Interface
Chapter 11: File System Implementation
Lecture 45 Syed Mansoor Sarwar
Subject Name: Operating Systems Subject Code:10CS53
File Sharing Sharing of files on multi-user systems is desirable
Chapter 11: File System Implementation
File system(conti..) Lecture November 2018.
Chapter 11: File-System Interface
Chapter 11: File System Implementation
Lecture 32 Syed Mansoor Sarwar
Lecture 43 Syed Mansoor Sarwar
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.
Introduction to Operating Systems
Operating Systems Lecture 1.
Lecture 37 Syed Mansoor Sarwar
Chapter 11: File System Implementation
Lecture 35 Syed Mansoor Sarwar
Lecture 34 Syed Mansoor Sarwar
Module 10: File-System Interface
Lecture 4: File-System Interface
Presentation transcript:

Lecture 44 Syed Mansoor Sarwar Operating Systems Lecture 44 Syed Mansoor Sarwar

© Copyright Virtual University of Pakistan Agenda for Today Review of the previous lecture File Sharing File Protection In-Memory Data Structures Space Allocation Techniques Contiguous, Linked, Index UNIX Allocation File Allocation Table (FAT) 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Review of Lecture 43 Directory Structures Links in UNIX/Linux File System Mounting 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File Sharing Sharing of files on multi-user systems is desirable. Sharing may be done through Duplicating files Common login for members of a team Setting appropriate access permissions Common groups for members of a team Links 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Protection File owner/creator should be able to control What can be done By whom Types of access Read Write Execute Append Delete List 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan UNIX Protection Mode of access: read, write, and execute (r, w, x) Three classes of users: owner, group, and others r w x a) Owner access: 7  1 1 1 b) Group access: 6  1 1 0 c) Public access: 1  0 0 1 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan UNIX Protection Ask system administrator to create a group and add some users to the group For a particular file or subdirectory, set appropriate access permissions for proper protection 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Default Permissions 777 for executable files and directories 666 for text files Can be changed with the umask command 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan UNIX Protection chmod 761 game1 owner group others Read Write Execute Read Write Execute 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan UNIX Protection chmod 755 projectAthena owner group others Read Write Search Read Search Read Search 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan UNIX Protection Sample commands chmod 700 ~ chmod 744 ~/file chmod 755 ~/directory ls –l ~ ls –ld ~ ls –l prog1.c ls –ld ~/courses 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan UNIX Protection The umask Command Sets default permissions on newly created files and directories as (default permissions – mask value) umask umask 022 touch temp1 ls –l temp1 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan File Control Block UNIX inode 19 November 2018 © Copyright Virtual University of Pakistan

In-Memory Data Structures The following upper-level data structures needed for file system support. Mapping directory entry for the file to the file control block at the time of opening a file. Mapping used while reading or writing a file. 19 November 2018 © Copyright Virtual University of Pakistan

In-Memory Data Structures 19 November 2018 © Copyright Virtual University of Pakistan

Per Process File Descriptor Table File Descriptor to File Contents Per Process File Descriptor Table File Table Inode Table File Descriptor 1 2 3 4 OPEN_MAX — 1 File’s contents … … … … … 19 November 2018 © Copyright Virtual University of Pakistan

Space Allocation Methods Contiguous allocation Linked allocation Indexed allocation 19 November 2018 © Copyright Virtual University of Pakistan

Contiguous Allocation Each file occupies a set of contiguous blocks on the disk Best-fit, first-fit, or worst-fit algorithm Directory entry contains starting block number and file size (in blocks) Good sequential and random access External fragmentation User needs to declare file size Expensive file growth 19 November 2018 © Copyright Virtual University of Pakistan

Contiguous Allocation 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. Simple – need only starting address No wastage of space No random access 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Linked Allocation 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Index Allocation Brings all pointers together into the index block Logical view Index table Data blocks 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Index Allocation 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Recap of Lecture File Sharing File Protection In-Memory Data Structures Space Allocation Techniques Contiguous, Linked, Index 19 November 2018 © Copyright Virtual University of Pakistan

© Copyright Virtual University of Pakistan Operating Systems Lecture 44 Syed Mansoor Sarwar 19 November 2018 © Copyright Virtual University of Pakistan