Operating Systems - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Operating Systems

Description:

Sometimes use a block status map (disk bitmap) -- the ith entry is set if the ... approach has the same problems bitmaps had when dealing with memory. Reading ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 22
Provided by: SteveC1
Category:

less

Transcript and Presenter's Notes

Title: Operating Systems


1
Operating Systems
  • Files II - Implementation
  • 11/20/00

2
File Implementation - Low Level
  • Sequential vs. random access storage devices
  • Secondary storage devices have
  • volume directories
  • external file descriptors (for each file)
  • the files
  • Block management
  • assigning blocks to files
  • keeping track of free blocks

3
Opening a file
  • Locate file descriptor in file system
  • Extract info about file from file descriptor and
    info about process from process descriptor
  • Verify that process may access file
  • Create an entry in the file status table
  • Allocates I/O buffers (and other resources) to
    handle file usage

4
Closing a file
  • Complete pending operations
  • Release I/O buffers
  • Release any locks the process holds on the file
  • Updates the external file descriptor
  • Deallocates the file status table entry

5
(No Transcript)
6
(No Transcript)
7
Contiguous Allocation
  • Random device behaves like a sequential one
  • Sequential blocks may be accessed quickly (little
    head movement on the device)
  • May not have dynamic file sizes
  • Tends to promote external disk fragmentation

8
(No Transcript)
9
Doubly linked lists - to improve performance
10
(No Transcript)
11
Unix
12
Unallocated blocks
  • System uses a free list to monitor/keep track of
  • Use a linked list or an indexed list
  • Usually very large, so indexed list not good
  • Using a ll, not easy to allocate disk blocks in
    the same area
  • Sometimes use a block status map (disk bitmap) --
    the ith entry is set if the ith block is
    allocated
  • This approach has the same problems bitmaps had
    when dealing with memory

13
Reading/Writing blocks
  • 2 steps
  • reading/writing to/from memory copy of block
  • reading/writing memory lt---gtstorage devices
  • Reading (unpacking) -- converting secondary
    storage blocks into a byte stream
  • Writing (packing) -- moving bytes into copies of
    secondary storage, and writing them to secondary
    storage blocks when they become full

14
Tricky operations
  • Insertion/Deletion
  • Seeking

15
(No Transcript)
16
Block I/O
  • For performance reasons, block buffering may be
    used
  • Information is generally accessed sequentially

17
Other levels of file implementation
  • Structured sequential files -- a full record is
    read at a time
  • Indexed sequential files
  • multiple records in 1 block
  • each block gets its own record
  • buffering doesnt help

18
Other levels (contd)
  • DBMSs
  • use a storage manager instead of a file manager
  • specialized strategies for different DBs
  • Multimedia
  • documents generally implemented via abstract data
    types
  • high bandwidth throughput
  • multiple blocks requested at once

19
Memory mapped files
  • File access is more complicated than regular
    memory acess
  • Some OSs allow mapping of files into a running
    process AS
  • MAP, UNMAP
  • file becomes the backing for the file
  • works best in a system that supports segmentation

20
(No Transcript)
21
Problems
  • Hard to know exact lengths of output files
  • Inconsistencies if file is opened for writing by
    1 process, but conventional read by another
  • File may be larger than the segment
Write a Comment
User Comments (0)
About PowerShow.com