0% found this document useful (0 votes)
9 views2 pages

Ex 09

The document outlines the layered architecture of file systems, detailing components such as the I/O Control Layer, Basic File System, File-Organization Module, and Logical File System. It also discusses file system implementation, including in-memory data structures like Volume Control Block and Directory Structure, as well as partition types. Additionally, it covers directory implementation methods and allocation strategies, highlighting their advantages and trade-offs.

Uploaded by

quyendz767
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Ex 09

The document outlines the layered architecture of file systems, detailing components such as the I/O Control Layer, Basic File System, File-Organization Module, and Logical File System. It also discusses file system implementation, including in-memory data structures like Volume Control Block and Directory Structure, as well as partition types. Additionally, it covers directory implementation methods and allocation strategies, highlighting their advantages and trade-offs.

Uploaded by

quyendz767
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

File System Structure

File system typically follow a layered architecture, where each level builds on the one below
it:

- I/O Control Layer: Handles physical data transfer between disk and memory using device
drivers and interrupt handlers.

- Basic File System: Manages reading and writing raw disk blocks via generic commands.

- File-Organization Module: Maps logical file blocks to physical disk blocks, manages free
space, and handles block allocation.

- Logical File System: Manages metadata including directory structures, file-control blocks
(FCB), and access control.

File System implementation


The OS also maintains in-memory data structures to manage file systems:

- Volume Control Block: Stores volume information (e.g., block size, free blocks, and number
of files). Called the superblock in UFS and master file table in NTFS.

- Directory Structure: Organizes files and directories.

- System-wide Open-File Table: Tracks all open files across the system.

Image: FCB.png

- Per-Process Open-File Table: Keeps file handles specific to each process, linked to the
system-wide table.

- Buffers: Temporarily hold file system blocks during I/O operations.

Disks are divided into partitions, each treated as a separate logical disk. A partition may be:

- Raw: Unformatted, used directly by applications like databases or swap space.

- Cooked: Contains a formatted file system.

Image: file system structures.png

Virtual file system


The key to a Virtual File System (VFS) is that it provides a unified interface for applications
to access diverse file systems, abstracting away their specific implementations.

Image: VFS.png
Section 12.3: Directory Implementation
Two primary methods are used to implement directory structures:

- Linear List: A simple list of file names and pointers to file data blocks. It’s easy to
implement but inefficient for large directories due to slow search times.

- Hash Table: Improves lookup speed by hashing file names to quickly locate entries.

Section 12.4: Allocation Methods


Different strategies are used to allocate disk blocks to files, each with advantages and trade-
offs:

- Contiguous Allocation: Files occupy a continuous block range on disk. It supports fast
access but suffers from:

- External Fragmentation: Difficulty in finding large enough free spaces.

- Poor support for dynamic file growth.

Image: Contiguous allocation.png

- Linked Allocation: Each file block contains a pointer to the next block. While it eliminates
external fragmentation and simplifies growth:

- It only supports sequential access.

- It introduces overhead for storing pointers.

- A variation, File Allocation Table (FAT), centralizes the block pointers into a table
indexed by block number.

Image: Linked allocation.png

- Indexed Allocation: An index block contains all pointers to a file’s data blocks. It supports
both direct and sequential access and avoids fragmentation. For large files:

- Multilevel indexing (single, double, triple indirect blocks) extends addressability.

- UNIX-based file systems use inodes that store a combination of direct and indirect
pointers.

Image: Indexed allocation.png

You might also like