<aside>
💡
Summary of Section 14.1: File-System Structure (C191 - Operating Systems for Programmers, zyBooks)
</aside>
Overview
This section discusses the file-system structure, which governs how data is stored, accessed, and managed in an operating system. It explains the roles of storage devices (such as disks and nonvolatile memory) and the various layers involved in file-system implementation.
1. Storage Devices and File-System Needs
- Disks are the primary secondary storage medium for file systems due to two key characteristics:
- They support in-place rewriting.
- They allow direct access to any block of information.
- Nonvolatile memory (NVM) devices are also increasingly used but differ as they cannot be rewritten in place and have unique performance traits.
To enhance I/O efficiency, data transfers between memory and mass storage occur in blocks (usually 512 bytes or 4,096 bytes). These blocks are managed by a layered file-system structure.
2. Layered File-System Structure
The file system consists of multiple layers, each with specific responsibilities:
a. I/O Control Layer
- Handles device drivers and interrupt handlers.
- Device drivers act as translators, converting high-level requests (e.g., "retrieve block 123") into hardware-specific commands.
b. Basic File System
- Also called the "block I/O subsystem" in Linux.
- Issues generic read/write commands to device drivers.
- Manages I/O request scheduling and memory buffers.
- Uses caches to store frequently accessed metadata for performance optimization.