Download presentation
Presentation is loading. Please wait.
Published bySimon O’Connor’ Modified over 6 years ago
1
CSE 451: Operating Systems Spring 2006 Module 12
CSE 451: Operating Systems Spring Module 12.5 Secondary Storage Overview John Zahorjan Allen Center 534 1
2
Interface Layers Std. Runtime Library App. Code OS Disk
Device-type Dependent Commands Procedure Calls Whatever… Syscalls 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
3
Exported Abstractions
App. Code Std. Runtime Library OS Disk OS + a tiny bit of file type / structure Directories, Directory Entries, Files,… Array of Blocks Whatever / / etc root .xls root etc 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
4
Primary Roles of the OS (file system)
Hide hardware specific interface Allocate disk blocks Check permissions Understand directory file structure Maintain metadata Performance Flexibility OS Disk 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?) / etc root 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
5
© 2006 Gribble, Lazowska, Levy, Zahorjan
What Is A File? At this level, what we think of as a file is an “inode” An inode keeps track of where the data blocks are It also keeps track of metadata (e.g., permissions, last modification time, etc.) OS Disk / root etc 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
6
What Is A Directory? OS Disk Ok, so what is a “hard link”? / root etc
/ passwd root etc hosts 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
7
Obtaining Performance: Caching
OS Disk read write readblock writeblock No… Block in cache? Why cache? How does it affect applications? 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
8
Obtaining Performance: open
OS Disk int fd = open(“/root/xxx”, O_RDONLY) [ read(fd,…) write(fd,…) ] readblock writeblock No… Per-process open file table inode / 1 2 3 … root etc file pointer 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
9
Multiple File Systems readblock writeblock ext2 disk ext2 read write
fat fat disk readblock writeblock Each filesystem: Decides which blocks to allocate for what (inodes, directories, file data) Decides what the format of a directory is Not really disks, but partitions. We’ll get to that later… 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
10
Supporting Multiple File Systems: vfs
ext2 disk read write ext2 vfs fat fat disk 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
11
Extending Functionality
ext2 disk read write ext2 fat vfs /dev fat disk /proc /dev: direct access to hardware blocks /proc: “virtual files” (computed, not stored, results) /proc is to the file system what cgi’s are to a web server (sort of) 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
12
Are Directories Fundamental?
What is the logical role of the directories? What practical role(s) do they have? Are there alternatives? 1/2/2019 © 2006 Gribble, Lazowska, Levy, Zahorjan
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.