Professional Documents
Culture Documents
CH 10
CH 10
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007
Chapter 10: File-System Interface
File Concept
Access Methods
Directory Structure
File-System Mounting
File Sharing
Protection
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.2 Silberschatz, Galvin and Gagne ©2007
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
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.3 Silberschatz, Galvin and Gagne ©2007
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
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.4 Silberschatz, Galvin and Gagne ©2007
File Operations
Create
Write
Read
Reposition within file
Delete
Truncate
Open(Fi) – search the directory structure on disk for
entry Fi, and move the content of entry to memory
Close (Fi) – move the content of entry Fi in memory
to directory structure on disk
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.5 Silberschatz, Galvin and Gagne ©2007
Open Files
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.6 Silberschatz, Galvin and Gagne ©2007
File Types – Name, Extension
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.7 Silberschatz, Galvin and Gagne ©2007
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
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.8 Silberschatz, Galvin and Gagne ©2007
Sequential-access File
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.9 Silberschatz, Galvin and Gagne ©2007
Simulation of Sequential Access on a Direct-access File
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.10 Silberschatz, Galvin and Gagne ©2007
Example of Index and Relative Files
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.11 Silberschatz, Galvin and Gagne ©2007
A Typical File-system Organization
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.12 Silberschatz, Galvin and Gagne ©2007
Directory Structure
Directory
Files
F1 F2 F4
F3
Fn
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.13 Silberschatz, Galvin and Gagne ©2007
Operations Performed on Directory
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.14 Silberschatz, Galvin and Gagne ©2007
Organize the Directory (Logically) to Obtain
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.15 Silberschatz, Galvin and Gagne ©2007
Single-Level Directory
A single directory for all users
Called the root directory
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.16 Silberschatz, Galvin and Gagne ©2007
Two-Level Directory
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.17 Silberschatz, Galvin and Gagne ©2007
Tree-Structured Directories
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.18 Silberschatz, Galvin and Gagne ©2007
Path Names
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.19 Silberschatz, Galvin and Gagne ©2007
Acyclic-Graph Directories
Allow sharing of subdirectories and files
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.20 Silberschatz, Galvin and Gagne ©2007
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
Backpointers using a daisy chain organization
Reference count for each file
New directory entry type
Link – another name (pointer) to an existing file
Resolve the link – follow pointer to locate the file
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.21 Silberschatz, Galvin and Gagne ©2007
General Graph Directory
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.22 Silberschatz, Galvin and Gagne ©2007
General Graph Directory (Cont.)
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.23 Silberschatz, Galvin and Gagne ©2007
File System Mounting
mount(“/dev/fd0”, “/mnt”, 0)
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.24 Silberschatz, Galvin and Gagne ©2007
Protection
File owner/creator should be able to control:
what can be done
by whom
Types of access
Read
Write
Execute
Append
Delete
List
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.25 Silberschatz, Galvin and Gagne ©2007
Categories of Users
Individual user
Log in establishes a user-id
Might be just local on the computer or could be
through interaction with a network service
Groups to which the user belongs
For example, “nahum” is in “w4118”
Again could just be automatic or could involve talking
to a service that might assign, say, a temporary
cryptographic key
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.26 Silberschatz, Galvin and Gagne ©2007
UNIX Access Rights
Mode of access: read, write, execute
Three classes of users
RWX
a) owner access 7 111
RWX
b) group access 6 110
RWX
c) public access 1 001
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.
owner group public
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.27 Silberschatz, Galvin and Gagne ©2007
Issues with UNIX Access Rights
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.28 Silberschatz, Galvin and Gagne ©2007
Windows XP Access-control List Management
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.29 Silberschatz, Galvin and Gagne ©2007
File Sharing
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.31 Silberschatz, Galvin and Gagne ©2007
File Sharing – Client-Server Model
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 10.32 Silberschatz, Galvin and Gagne ©2007
End of Chapter 10
Operating System Concepts with Java – 7th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007