Operating Systems File Systems
Lecture 13 Michael O’Boyle
1
Operating Systems File Systems Lecture 13 Michael OBoyle 1 - - PowerPoint PPT Presentation
Operating Systems File Systems Lecture 13 Michael OBoyle 1 Overview Roles Files Directories File Protection Unix inodes 2 Interface Layers Interface Layers Std. App. Disk Runtime OS Code Library
1
2
3
Device-type Dependent Commands Syscalls Procedure Calls Whatever…
4
Array of Blocks Directories, Directory Entries, Files,… Whatever / etc root OS + a tiny bit of file type / structure / etc root
5
/ etc root
Why does the OS define directories? Why not leave that to the library/application layer? (Why would you want to leave it to the app/library?)
6
7
8
9
bash$ cd /usr/local
bash$ cd /usr/local (absolute) bash$ cd bin (relative, equivalent to cd /usr/local/bin)
11
12
fd = open(“/one/two/three”, O_RDWR);
13
14
15
/etc/passwd /home/gribble /home/guest root rw rw rw gribble r rw r guest r principals
ACL capability
16
17
18
19
20
21
22
23
inode_size)
24
bash$ ls -i /home/foo 287663 /home/foo (This is the inode number of “foo”) bash$ ln /home/foo /tmp/foo bash$ ls -i /home/foo /tmp/foo 287663 /home/foo 287663 /tmp/foo
to read or write the file.
25
26
27 1 10 11 12
… … … … … …
28
29
30
31
superblock inode free list file block free list
inode for ‘/’ directory ‘/’ (table of entries) inode for ‘usr/’ inode for ‘var/’ directory ‘var/’ (table of entries) directory ‘usr/’ (table of entries)
‘bigfile.bin’ data blocks
indirection block
data blocks
Indirection block
data blocks
indirection block
32
33