File Management
File Concepts:
File: A named collection of related information, stored on secondary storage.
File Attributes: Information associated with a file, such as name, size, creation date, owner, permissions, etc.
File Operations: Operations performed on files, including create, delete, open, close, read, write, seek, etc.
Access Methods:
Sequential Access: Accessing data sequentially, starting from the beginning.
Direct Access: Accessing data directly, without reading intervening data.
Indexed Sequential Access: Accessing data sequentially or directly using an index.
Directory Structure:
Single-Level Directory: A simple directory structure where all files are in a single directory.
Two-Level Directory: A directory structure with a root directory and user directories.
Tree-Structured Directory: A hierarchical directory structure, resembling a tree.
Acyclic Graph Directory: A more flexible directory structure allowing shared subdirectories.
File System Mounting and Sharing:
Mounting: Attaching a file system to a directory in the file system hierarchy.
Sharing: Allowing multiple users or processes to access the same file or directory.
File Protection:
Access Control Lists (ACLs): A list of permissions for each user or group.
File Permissions: Basic permissions (read, write, execute) for the owner, group, and others.
Allocation Methods:
Contiguous Allocation: Allocating contiguous blocks of disk space to a file.
Linked Allocation: Allocating disk space in non-contiguous blocks, linked together.
Indexed Allocation: Allocating disk space using an index block that points to data blocks.
Free-Space Management:
Bit-Vector: A bitmap representing free and allocated blocks.
Linked List: A linked list of free blocks.
Grouping: Grouping free blocks into larger blocks for efficient allocation.
Directory Implementation:
Linear List: A simple list of file names and their attributes.
Hash Table: A hash table for efficient searching.
B-Tree: A balanced tree structure for efficient searching and insertion.
Device Management
Dedicated, Shared, and Virtual Devices:
Dedicated Device: A device assigned to a single process.
Shared Device: A device shared among multiple processes.
Virtual Device: A software emulation of a physical device.
Serial Access and Direct Access Devices:
Serial Access Device: A device that accesses data sequentially (e.g., tape).
Direct Access Device: A device that accesses data directly (e.g., disk).
Disk Scheduling Methods:
First-Come, First-Served (FCFS): Serves requests in the order they arrive.
Shortest Seek Time First (SSTF): Serves the request with the shortest seek time.
SCAN (Elevator Algorithm): Scans the disk from one end to the other, servicing requests along the way.
C-SCAN (Circular SCAN): Scans the disk in one direction only.
LOOK and C-LOOK: Similar to SCAN and C-SCAN, but the disk head only moves to the last request in the current direction.
Direct Access Storage Devices - Channels and Control Units:
Channel: A specialized processor that handles I/O operations.
Control Unit: A device that controls the operation of a specific device.
Inter-Process Communication (IPC)
Introduction to IPC Methods:
Pipes: A unidirectional communication channel between processes.
Shared Memory: A shared region of memory that multiple processes can access.
Message Queues: A queue of messages that processes can send and receive.
Semaphores: Synchronization primitives used to control access to shared resources.
Sockets: A network-based communication mechanism.
Pipes - popen and pclose Functions:
popen: Creates a pipe and executes a command in a child process.
pclose: Closes a pipe and waits for the child process to finish.
Shared Memory:
Shared Memory Segments: Regions of memory that can be accessed by multiple processes.
Synchronization Mechanisms: Needed to coordinate access to shared memory.
FIFOs (First-In-First-Out):
Named Pipes: Pipes that can be accessed by name, allowing communication between unrelated processes.
Unnamed Pipes: Pipes that can only be accessed by related processes.
Message Queues:
Message Queues: A queue of messages that processes can send and receive.
Message Queues: Provide a flexible and reliable way to communicate between processes.