CSE 7343/5343, Spring 2003
Topic 3-1: Files, I/O, and Mass-Storage Management
Prof. Jeff Tian, CSE/SEAS/SMU, Dallas, TX 75275
tian@engr.smu.edu; www.engr.smu.edu/~tian/class/7343.03s
- Dates: 4/1-4/8:
- Reading: Ch11, Ch12 (only briefly), Ch13, Ch14.
File systems: concept
- basic concept: online storage
- file system: files and directories
- contrast user/system view:
- user: logical view of storage = file
- system: physical storage = disk, tape, etc.
- physical media: persistent or non-volatile
- execution and access: related to process/memory management
PCB contents?
loading
swapping
virtual memory
interaction between memory and backing store
- file system organization:
user applications to physical devices
- layers in file systems
- access methods:
- sequential access
- direct access
- more later
- related: allocation methods
- contiguous, list, index
- similarity/comparison to memory allocation
- in connection with access methods later
File systems: Attributes and Information
- file types and attributes
- operations based on types and attributes
- basic attributes
- name
- type: basic types, program or data,
detailed common types: Fig 11.1 (p.377)
- location (mostly for system)
- size
- protection: access control
- time, date, user identification: creation/modification/use
- information kept in the directory structure
- example information:
UNIX example: Fig 11.13 (p.406)
description of the fields 11.6.4 (p.406 too)
File systems: Operations and Assess Methods
- file operations
- files as an ADT (abstract data type)
- ADT = content and pre-defined operations
- basic operations
- creating
- writing
- reading
- repositioning
- deleting
- truncating
- others as combinations of the the above
copying, appending, renaming, etc.
- information for management/operations
- file status: open, closed, etc.
- file pointer
- open count
- disk location
- file type => (internal) file structure and interpretation (semantics)
- access methods
- to support different operations
- affect different implementations
- basic access methods
- sequential access: tape, etc.
current position for access, reposition
- direct access: more flexible
- other access build on basic access methods
- protection and access (later)
- other access methods:
- use of index
example Fig 11.4 (p.382)
- file hierarchy
- DBMS vs files
File systems: Directories
- directories and directory structure
- motivation: too many files
- usability and efficiency concerns
- collection of files as a directory
- generalization: tree-structured directories
example: Fig 11.8 (p.388)
single-/two-level directory as special cases of trees
(Figs 11.6 and 11.7)
- sharing: acyclic graph instead of tree
example: Fig 11.9 (p.390)
- general graph, not commonly used
- files and directories: implementation issues
- physical view:
- directory as index (title/ToC)
- followed by individual files
- example: Fig 11.5 (p.383)
- sequential vs direct access impact on implementation
- allocation: contiguous, list, index
- free-space management: similar to free memory management
- directory tables/lists
- efficiency
- performance
- reliability and quality (consistency)
- many implementation issues covered in Ch.12
File systems: Other issues
- mounting file system:
similar to opening individual files
for a sub-tree
- sharing
- client-server model
- ftp, web, etc.
- protection: authorized vs. unauthorized access
- directory/read/write/execute
- general access protection: rwx
for who?
- UNIX example: user-group-universal rwx
again, Fig 11.13 (p.406)
- other types of access: append, delete, list, etc.
- discussed in book in more details
I/O systems
- I/O and I/O systems
- basic concepts
- I/O operation handling
- hardware: architecture class
- device driver:
part of OS, but device specific
- I/O management through polling
- basic ideas
- CPU controlled
- passive devices
- if I/O needed during polling, service it
- consequences
- easily managed
- busy waiting by CPU
- no immediate service for urgent request
- => other ideas of I/O management
- interrupt based I/O management
- basic ideas
- request I/O, generate interrupt
- active devices
- interrupt handling: similar to procedure/function calls
- compare to Fig 13.3 (p.461)
- interrupt types and priority
- maskable vs. nonmaskable
- hardware vs. software
- priority
- handling priority: selective masking
- advantages over polling
- but requires more management overhead
- more commonly used
- interrupt for purposes other than I/O
- basic operations/utilities: clock
- administrative purposes: monitoring etc.
- power and other disturbances
- RR implementation example
- I/O through DMA
- direct memory access
- if no CPU involvement is constantly needed
- improved efficiency/parallelism
- general sequence: set-up, DMA, clear-up
- example: Fig 13.5 (p.465)
Mass-storage management
- main topics in mass-storage management
- storage hierarchy: back in Fig 2.6 (p.39)
- mass-storage: secondary and tertiary storage
- main secondary device: disks
- main tertiary device: tapes
- speed differences
- disk scheduling algorithms
- other mass-storage management
- disk access
- logical block: typically 512, 1024 bytes
- mapped to sectors
- tracks and cylinders
- logical address => physical address (cylinder/track/sector)
- access: seek time + rotational latency
- seek time: head to correct cylinder
- rotational latency: spin/rotate to correct sector
- seek time dominant
- scheduling: cylinders in the disk queue
Mass-storage management: Disk Scheduling
- disk scheduling algorithms
- FCFS (or FIFO)
- SSTF (shortest seek time first)
- SCAN or elevator algorithm
- C-SCAN (circular SCAN)
- LOOK and C-LOOK
- FCFS (or FIFO)
- simple to implement
- but efficiency problem
- head movement (seek time)
- back and forth, large movements
- example
- SSTF (shortest seek time first)
- to improve FCFS performance
- back and forth, small movements
- comparison to SJF CPU scheduling
- possible starvation problem
- optimality?
- example
- SCAN, C-SCAN, LOOK, C-LOOK
- minimize back and forth movement
- avoid starvation
- C-SCAN: one directional with reset
- LOOK: not going all the way if not necessary
- C-LOOK: similar modifications
- examples
- more commonly used: why?
Mass-storage management: Other Issues
- other issues with disk management
- formatting
- boot blocks and boot disks
- bad blocks
- disk reliability through redundant arrays, etc.
- swap space management
- details in textbook
- tertiary storage structure
- removable disks: floppy disks, CD-ROM etc.
- tapes: mostly for backup and archiving
- OS: virtual memory and virtual machines
- management of all the extensions
Prepared by Jeff Tian
(tian@engr.smu.edu).
Last update April 2, 2003.