In-Depth Notes on Device Management in Computer Systems
Device Management
Memory Management in Early Systems
- Single-user systems
- Fixed partitions
- Dynamic partitions
- Relocatable partitions
Memory Management in Recent Systems
- Swapping (moving processes in and out of the memory)
- Paging
- Paged Memory Allocation (JT, PMT, MMT)
- Demand Paging Memory Allocation (JT, PMT - Modified, MMT)
- Segmentation
- Segmented Memory Allocation (JT, SMT, MMT)
- Segmented/Demand Paged Allocation (JT, PMT, SMT, MMT)
- Page Replacement Algorithms
- FIFO (First-In-First-Out)
- LRU (Least Recently Used)
- OPT (Optimal)
- Important Terms
- Trashing
- Page Fault
- Working Set
- Reference Bit
- Modified Bit
- Virtual Memory
Introduction to Device Management
- System Device
- Device Handler Seek Strategies
- Groups of Storage Media
- I/O System Component
- Communication Among Devices
- Management of I/O Requests
Device Management Functions
- Tracking the Status of Each Device
- Examples include disk drives, printers, modems, etc.
- Using Preset Policies
- Determines which process gets a device and duration
- Allocating Devices
- Reallocating Devices
- At the process level
- At the job level
Peripheral Devices Categories
Dedicated Devices
- Assigned only to one job at a time (e.g., tape drives, printers)
- Disadvantage: Inefficient if not used 100% of the time
Shared Devices
- Assigned to several processes (e.g., disk pack)
- Interleaving requests must be controlled by Device Manager
- Conflicts resolved based on policies
Virtual Devices
- Dedicated devices transformed into shared (e.g., using spooling for printers)
- Spooling speeds up slow dedicated I/O devices
I/O Scheduling Algorithms
Goals of Scheduling Algorithms:
- Minimize arm movement
- Minimize mean response time
- Minimize variance in response time
Seek Strategies:
- FCFS (First-Come-First-Served)
- Average performance, high arm movement
- SSTF (Shortest Seek Time First)
- Minimizes overall seek time; prefers nearest request
- SCAN
- Moves arm from outer to inner tracks, servicing requests
- LOOK
- Similar to SCAN, but doesn't go to track edges unless needed
- N-Step SCAN
- Holds requests until arm returns
- C-SCAN (Circular SCAN)
- Serves requests on its path and then jumps back to the start
- C-LOOK
- Stops at the last requested track and jumps back
Disk Scheduling Example
- Scenario: Disk drive with cylinder requests in FIFO order
- Tasks: Calculate distances moved by different scheduling methods:
- FCFS
- SSTF
- LOOK
Storage Media Types
- Sequential Access Media
- Records stored sequentially
- Direct Access Storage Devices (DASD)
- Records can be accessed directly
- Categories include:
- Magnetic Disks
- Optical Discs
- Flash Memory
- Magneto-Optical Disks
Optical and Flash Memory
- Optical Discs
- High-intensity laser creates pits and lands to store data
- Speed classification (e.g., 32x) indicates spin rate
- CD-R Technology
- Write-once, read-many
- Uses a dye layer that is burned to mark data
- CD-RW Technology
- Data can be written, changed, and erased using phase change technology
- DVD-ROMs
- Store more data and have tighter spirals compared to CDs
- Flash Memory
- Emulates RAM but retains data without power
- Frequent forms include Compact Flash and USB drives
I/O Subsystem Efficiency
- Direct Memory Access (DMA)
- Control unit accesses memory without CPU intervention
- Buffers
- Temporarily store data to synchronize I/O actions
- Device Manager Responsibilities
- Manages device activity and optimizes performance through task division
Key Takeaways
- Different Seek Strategies perform differently under various loads.
- The I/O subsystem's design significantly impacts data retrieval times and system efficiency.
- Flash memory and various storage media types play crucial roles in modern computing systems.