Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze
Copyright Notice
2000
2000--2005 David A. Solomon and Mark Russinovich
Nonvolatile memory
UNIX files are unstructured text files
Organized in a directory structure
File Attributes
Files are named
For the convenience o
off the human user
File names are case
case--sensitive
File Operations
A file is an abstract data type
Values + set of applicable operations
A set of basic file operations has to be supported by the OS
Creating a file
Allocate space in the file system, generate directory entry
Writing
g a file
Name of the file and information to be written has to be specified
System hast to maintain a write pointer for the file
Reading a file
File name and a pointer to memory to receive data has to be
specified
System maintains a read pointer for the file
Deleting a file
Release all file space; erase directory entry
Instead of deleting a file
file, UNIX allows to unlink() files file is
deleted by the OS if the last link to a file disappears
Truncating a file
File attributes remain unchanged
File length is set to zero (or to some specified value)
Read pointer
Additional ops:
Append
Rename
Set attributes
...
Write pointer
UNIX supports the truncation-on-close
flag to truncate files
7
Directories
Record information about groups of files
Management of files
Single--Level directory: most simple; all files in the same directory
Single
Two--Level directory: separate directory for each user
Two
Tree--Structured (hierarchical) directories: most common
Tree
Operations
p
on directories:
Search for a file
Create a file (directory entry)
Delete a file (directory entry)
List a directory
Rename a file
Traverse the file system (recursive)
UNIX Directories
Fully hierarchical, treetree-structured
Directories are represented as files
Problem: Truncation
10
11
File Protection
Access rights can be independently defined for:
(u) user
(g) group
Group
(o) other
Example:
luna test ( 48 ))--% ls -lisa
total 2
421908
1 drwxr
drwxr--xr
xr--x
apolze
1024
116884
1 drwxr
drwxr--xr
xr--x
13
apolze
2048
Jan 7 15:06 .
116992
0 -rw
rw-------------
apolze
116991
0 -rw
rw--rw
rw--rw
rw--
apolze
Jan 7 15:06 ..
12
(w)
(x)
Binary representation:
(x):
Bit 0 (+1)
(w):
Bit 1 (+2)
(r):
Bit 2 (+4)
13
SUN NFS
Client/Server--System (based on remote procedure call (RPC))
Client/Server
File system operations are forwarded from client to server
Server executes actual file system operations, returns results
Client has access to remote resources
Stateless operation (Reliability !)
14
15
Exported to moon
Exported to all computers on the net
16
17
Further Reading
Mark E. Russinovich and David A. Solomon,
Microsoft Windows Internals, 4th Edition, Microsoft
Press, 2004.
File System Formats (from pp. 689)
Abraham Silberschatz, Peter B. Galvin, Operating
System Concepts, John Wiley & Sons, 6th Ed., 2003;
Chapter 11 - File
File--System Interface
Chapter 12 - File
File--System Implementation
Chapter 16 - Distributed File Systems
19