📘 PAPER 5 – OPERATING SYSTEM (UNIT 3 – FILE SYSTEM & I/O MANAGEMENT) university of allahabad

 

🔴 UNIT 3 – FILE SYSTEM & I/O MANAGEMENT


1️⃣ File System – Introduction

✅ What is a File?

A file is a collection of related information stored on secondary storage.

✅ File System

The file system is a method used by the OS to:

  • Store files

  • Retrieve files

  • Organize data efficiently


2️⃣ File Attributes

Each file has the following attributes:

AttributeDescription
NameFile name
TypeFile extension
SizeFile size
LocationDisk location
ProtectionAccess rights
Time & DateCreation/modification time

3️⃣ File Operations

Common file operations:

✔ Create
✔ Open
✔ Read
✔ Write
✔ Close
✔ Delete


4️⃣ File Access Methods


🔹 1. Sequential Access

  • Data accessed sequentially

  • Example: Text file

✔ Simple
❌ Slow for random access


🔹 2. Direct Access

✔ Fast
✔ Efficient


🔹 3. Indexed Access

  • Uses index to locate data

  • Combination of sequential & direct


5️⃣ Directory Structure

Types of Directory Structures:


🔹 1. Single Level Directory


🔹 2. Two-Level Directory

  • Separate directories for each user


🔹 3. Tree Structure Directory


🔹 4. Acyclic Graph Directory

  • Shared files

  • No cycles


6️⃣ File Allocation Methods


🔹 1. Contiguous Allocation

✔ Fast access
❌ External fragmentation


🔹 2. Linked Allocation

✔ No fragmentation
❌ Slow access


🔹 3. Indexed Allocation

✔ Fast access
✔ No fragmentation


7️⃣ Free Space Management

Methods used to manage free disk space:

Bit vector
Linked list
Grouping
Counting


8️⃣ Disk Scheduling

Purpose:

Reduce disk access time


🔹 Disk Scheduling Algorithms


1️⃣ FCFS (First Come First Serve)

✔ Simple
❌ High seek time


2️⃣ SSTF (Shortest Seek Time First)

✔ Better than FCFS
❌ Starvation possible


3️⃣ SCAN (Elevator Algorithm)

✔ Moves in one direction
✔ Reduces starvation


4️⃣ C-SCAN

✔ Uniform wait time
✔ Used in modern OS


9️⃣ I/O Management

I/O System Responsibilities:

✔ Device communication
✔ Error handling
✔ Buffering
✔ Spooling


🔹 I/O Techniques

1. Programmed I/O

CPU controls I/O
❌ Slow


2. Interrupt Driven I/O

CPU works during I/O
✔ Better performance


3. Direct Memory Access (DMA)

  • Data transferred directly to memory

  • CPU not involved

✔ Fastest
✔ Efficient


🔟 Protection & Security


🔹 Protection

Ensures controlled access to resources.

🔹 Security

Prevents unauthorized access.


Protection Mechanisms:

✔ Passwords
Access control lists
Encryption


📌 EXAM IMPORTANT QUESTIONS (UNIT 3)

✔ Explain file allocation methods
✔ Disk scheduling algorithms
✔ Explain DMA
File access methods
Directory structure
✔ Difference between FCFS and SSTF

Comments

Popular Posts