0% found this document useful (0 votes)
4 views4 pages

OS 5 Mark Answers

The document discusses various types of memory fragmentation, including internal and external fragmentation, as well as compaction methods. It explains the concept of virtual memory with paging, segmentation, and TLB, and describes partition selection algorithms like First Fit, Best Fit, and Worst Fit. Additionally, it covers page replacement strategies, types of file organization, disk scheduling techniques, and the Linux Virtual File System (VFS).

Uploaded by

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

OS 5 Mark Answers

The document discusses various types of memory fragmentation, including internal and external fragmentation, as well as compaction methods. It explains the concept of virtual memory with paging, segmentation, and TLB, and describes partition selection algorithms like First Fit, Best Fit, and Worst Fit. Additionally, it covers page replacement strategies, types of file organization, disk scheduling techniques, and the Linux Virtual File System (VFS).

Uploaded by

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

Q1. What are the Different Types of Memory Fragmentation?

Memory fragmentation occurs when memory is not used efficiently. There are three types:

1. Internal Fragmentation

Happens when fixed-size memory blocks are allocated, and the process doesn't use the entire block.

Example: Allocating 100 KB for a 94 KB process wastes 6 KB.

2. External Fragmentation

Occurs when total free memory is enough, but it is scattered and not contiguous.

Example: Free blocks: 100 KB, 200 KB, and 300 KB. A request for 500 KB can't be fulfilled.

3. Compaction

A method to deal with external fragmentation by combining all free spaces into one large block. However, it is

CPU-intensive.

Q2. Explain virtual memory concept with respect to paging, segmentation and TLB

Virtual Memory allows execution of processes that may not be completely in main memory. It uses disk space

to extend RAM virtually. It's implemented using:

1. Paging

Divides memory into fixed-size pages (logical) and frames (physical). The OS maps pages to frames using a

page table.

2. Segmentation
Divides memory into logical units called segments (code, data, stack). Each segment has a base and a limit.

3. TLB (Translation Lookaside Buffer)

A cache that stores recent page table entries to speed up address translation.

Q5. Partition Selection Algorithm + Problem

Partition selection algorithms allocate memory to processes from available memory blocks.

Given:

Memory Blocks: 150K, 500K, 200K, 300K, 550K

Processes: 220K, 430K, 110K, 425K

First Fit:

220K -> 500K -> Remaining: 280K

430K -> 550K -> Remaining: 120K

110K -> 200K -> Remaining: 90K

425K -> No fit available

Best Fit:

220K -> 300K -> Remaining: 80K

430K -> 500K -> Remaining: 70K

110K -> 150K -> Remaining: 40K

425K -> 550K -> Remaining: 125K

Worst Fit:

220K -> 550K -> Remaining: 330K


430K -> 500K -> Remaining: 70K

110K -> 330K -> Remaining: 220K

425K -> No fit.

Conclusion: Best Fit makes the most efficient use of memory in this case.

Q6. Page Replacement (LRU, Optimal, FIFO)

Reference String: 3, 0, 4, 3, 2, 1, 4, 6, 3, 0, 8, 9, 3, 8, 5

Page Frame Size = 3

Page Faults:

FIFO: 12

LRU: 10

Optimal: 9

Conclusion: Optimal < LRU < FIFO

Q7. Types of File Organization

1. Sequential: Easy next access, hard random access.

2. Direct: Uses hash function for fast access.

3. Indexed: Combines random access with order.

4. Heap: Records placed anywhere; slow search.

Q8. Techniques of Disk Scheduling


1. FCFS: Simple, but high seek time.

2. SSTF: Shortest seek, can starve long requests.

3. SCAN: Moves back and forth like an elevator.

4. LOOK: Like SCAN, but stops at last request.

5. C-SCAN: One direction only, jumps to start.

6. C-LOOK: Like C-SCAN but smarter.

Q15. Linux Virtual File System (VFS)

VFS is an abstraction in Linux that allows different file systems to be accessed using a common interface.

Components:

- Superblock: File system info

- Inode: File metadata

- Dentry: Directory entries

- File: Open file representation

Benefits:

- Supports multiple FS types

- Easy to extend

You might also like