































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
During the course of work of the Operating Systems, Distributed Computation, we learn the core of the programming. The main points disucss in these lecture slides are:File Systems, File System Interface, File System Implementation, Sequence of Words, Complex Structures, Attributes of File, User Identification, File Concept, Blocking, Sequential Access, Access Methods
Typology: Slides
1 / 39
This page cannot be seen from the preview
Don't miss anything!
































10: File Systems 1
10: File Systems 2
10: File Systems 4
FILE SYSTEMS INTERFACE
A file can have various kinds of structure
None - sequence of words, bytes
File
Concept
10: File Systems 5
FILE SYSTEMS INTERFACE
Attributes of a File
Name – only information kept in human-readable form
and usage monitoring
maintained on the disk.
File
Concept
10: File Systems 7
FILE SYSTEMS INTERFACE
Access
Methods
10: File Systems 8
FILE SYSTEMS INTERFACE Access Methods
10: File Systems 10
Example 1: Index contains the name appearing as the first record in each block. There are as many index entries as there are blocks.
Example 2: Index contains the block number where "A" begins, where "B" begins, etc. Here there are only 26 index entries.
FILE SYSTEMS INTERFACE
Access
Methods
Smith
Smith, John | data
Adams Arthur Asher
Saarnin
Smith, John | data
Adams Baker Charles
Adams | Data Arthur | Data Asher | Data Baker | Data
Saarnin | data
10: File Systems 11
Directories maintain information about files:
For a large number of files, may want a directory structure - directories under directories.
Information maintained in a directory:
Name The user visible name. Type The file is a directory, a program image, a user file, a link, etc. Location Device and location on the device where the file header is located. Size Number of bytes/words/blocks in the file. Position Current next-read/next-write pointers. Protection Access control on read/write/ execute/delete. Usage Open count Usage time of creation/access, etc. Mounting a filesystem occurs when the root of one filesystem is "grafted" into the existing tree of another filesystem.
There is a need to PROTECT files and directories.
Actions that might be protected include: read, write, execute, append, delete, list
FILE SYSTEMS INTERFACE Directory Structure
10: File Systems 13
Attaching portions of the file system into a directory structure.
FILE SYSTEMS INTERFACE Other Issues
10: File Systems 14
FILE SYSTEMS INTERFACE Protection
what can be done by whom
Read Write Execute Append Delete List
owner group public
chmod 761 game
Attach a group to a file “chgrp G game”
10: File Systems 16
When talking about “the file system”, you are making a statement about both the rules used for file access, and about the algorithms used to implement those rules. Here’s a breakdown of those algorithmic pieces. Application Programs The code that's making a file request.
Logical File System This is the highest level in the OS; it does protection, and security. Uses the directory structure to do name resolution.
File-organization Module Here we read the file control block maintained in the directory so we know about files and the logical blocks where information about that file is located.
Basic File System Knowing specific blocks to access, we can now make generic requests to the appropriate device driver.
IO Control These are device drivers and interrupt handlers. They cause the device to transfer information between that device and CPU memory.
Devices The disks / tapes / etc.
10: File Systems 17
FILE SYSTEM
IMPLEMENTATION
Layered File
System
Handles the CONTENT of the file. Knows the file’s internal structure.
Handles the OPEN, etc. system calls. Understands paths, directory structure, etc.
Uses directory information to figure out blocks, etc. Implements the READ. POSITION calls.
Determines where on the disk blocks are located.
Interfaces with the devices – handles interrupts.
10: File Systems 19
FILE SYSTEM
IMPLEMENTATION
Virtual File Systems
provide an object-oriented way of implementing file systems.
call interface (the API) to be used for different types of file systems.
rather than any specific type of file system.
10: File Systems 20
FILE SYSTEM
IMPLEMENTATION
a) Accessing the file requires a minimum of head movement. b) Easy to calculate block location: block i of a file, starting at disk address b , is b + i. c) Difficulty is in finding the contiguous space, especially for a large file. Problem is one of dynamic allocation (first fit, best fit, etc.) which has external fragmentation. If many files are created/deleted, compaction will be necessary.
Allocation Methods