










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
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A part of the lecture notes for comp 310: operating systems, specifically lecture 20. The lecture covers the implementation of virtual memory in nachos and the basics of file management. Topics include understanding how to implement vm in nachos, properties of physical disks, the file system abstraction, disk structure, disk performance, and disk scheduling. Announcements include office hours and project time.
Typology: Study Guides, Projects, Research
1 / 18
This page cannot be seen from the preview
Don't miss anything!
Announcements I will be gone Thursday through next Wednesday Office hours next week moved:
Friday: Dr. Glick—project time! Monday: Dr. Jiang—More on filesystems Before we get back to the worksheet…
OS (Course) Components Programs: Processes, Threads, Synchronization I/O: Hardware, Interrupts, Direct Memory Access Memory/Disk: Virtual Memory, Paging, Naming Distributed Systems , Security
Up-to-the-minute research File Systems: Goals File systems are yet another abstraction that the OS provides to programs Disks are messy physical devices
All this should be hidden from the higher level software
Disk Structure Disk Interaction Is Complicated Specifying a disk request requires a lot of detailed information
Modern disks are even worse…
Disk Scheduling—when is it worth it? Disk scheduling doesn’t have much impact unless there are request queues (i.e. lots of processes that want to access the disk at once)
Modern disks often do scheduling themselves
File Systems: Abstraction for accessing data on disk We have already seen one way that disk is used. What was it? Why not do everything this way?
File Systems The file system is the ABSTRACTION the OS provides for the data on the disk File systems:
Files A file is data with some properties A file can also have a type
name owner protection last read/write etc
How do we oraganize files?
For users—organize files For system—naming interface (why not just store everything in one directory?)
Two ways to refer to a given file… Implementing Directories A directory is a list of entries
List is usually unordered
Where are directories (lists) stored?
Tree-Structured directories
Acyclic Graph Structure
Accessing Directories
Open directory / Where does OS find this directory? Look for “one” in this directory go to location of “one” Open directory “one”, get location of “two” Open directory “two”, get location of “three” Open file “three”
This is why open != read/write OS can cache prefixes for performance File Sharing What kind of directory structure is needed? Key issues:
Protection File systems implement some kind of protection system
A protection system dictates whether an action (read/write/execute) performed by a process/thread/user on a file should be allowed
Representing Protection Dr. Alvarado rx rx r OSStudent2 rwx rwx rw OSStudent1 rwx rwx rw /code /threads /synch.cc
Disk Layout Strategies
Unix Inodes Unix inodes implement an indexed structure for files Also store metadata info (what is this meta-data?) Each inode contains 15 block pointer First 12 are direct blocks (e.g. 4KB blocks) Then single, double and triple indexed prot, time, length, etc meta data 0 1 2 13 14
Unix Inodes and Path Search
Directories are files, so inodes also describe where they are placed
To open /one user Master Block to find inode for / Open /, look for entry for one Read the inode for one into memory The inode says where first data block is on disk Read that block into memory to read file… Read Ahead Many File Systems implement “read ahead”
When is this an advantage?