0% found this document useful (0 votes)
22 views13 pages

OS CIAT 2 Ans Key

The document provides a comprehensive overview of operating systems, covering topics such as resource management, process states, memory management techniques, and file systems. It also discusses various operating system architectures, virtualization concepts, and deadlock detection and recovery mechanisms. Additionally, it includes practical examples and comparisons of different memory and page replacement algorithms.

Uploaded by

msindhume
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)
22 views13 pages

OS CIAT 2 Ans Key

The document provides a comprehensive overview of operating systems, covering topics such as resource management, process states, memory management techniques, and file systems. It also discusses various operating system architectures, virtualization concepts, and deadlock detection and recovery mechanisms. Additionally, it includes practical examples and comparisons of different memory and page replacement algorithms.

Uploaded by

msindhume
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/ 13

CONTINUOUS INTERNAL ASSESSMENT - 1 ANSWER KEY

State the role of an operating system in resource management.


The operating system (OS) plays a critical role in resource management by acting as an
1 intermediary between users and computer hardware. It ensures that hardware resources—
such as the CPU, memory, storage, and input/output devices—are allocated efficiently and
fairly among all running programs and users.
Differentiate between kernel mode and user mode in an operating system.
Feature Kernel Mode User Mode
Limited access; cannot
Full access to all system
Access Level directly interact with
resources and hardware
hardware or kernel memory
Privilege High privilege mode Low privilege mode
OS kernel and core system User applications and some
2 Who operates here
processes services
Must use system calls to
System Calls Can execute all instructions
request OS services
Bugs or faults can crash the Faults are isolated; crash
Security Risk
whole system affects only the application
Disk drivers, memory
Example Web browser, text editor
management
What are the different states of a process in an operating system?
1. New
2. Ready
3 3. Running
4. Waiting (or Blocked)
5. Terminated (or Exit)
6. Suspended (optional in some systems)
Define the concept of time-sharing in operating systems.
Time-sharing in operating systems is a concept where multiple users or processes share the
4
system resources—especially the CPU—simultaneously by allocating each one a small time
slice or quantum of CPU time.
What are the advantages of using segmentation over paging in memory management?
Logical View of Memory
5 Supports Variable Size Segments
Simplifies Protection and Sharing
Better for Modular Programming
No Internal Fragmentation
6 State the effect of thrashing in an operating system.
1. Drastic Performance Degradation
2. Excessive Paging Activity
3. Increased Response Time
4. Resource Wastage
5. System Instability

Define the term “Mass Storage”.


Mass storage refers to large-capacity, non-volatile storage systems used to store vast amounts
7 of data for long-term retention. Unlike main memory (RAM), mass storage retains data even
when the computer is powered off.
Write the function of file systems.
1. Data Storage and Organization
2. File Management
3. Space Management
8
4. Access Control and Security
5. File Naming and Metadata
6. Data Integrity and Recovery
7. Performance Optimization
What is meant VMM?.
A VMM (Virtual Machine Monitor) is software or firmware that creates and manages virtual
9
machines (VMs) by abstracting the underlying physical hardware. It allows multiple
operating systems to run simultaneously and independently on a single physical machine.
List the different ways the OS handles memory management?
1. Contiguous Memory Allocation
2. Paging
3. Segmentation
4. Virtual Memory
10 5. Memory Allocation Strategies
6. Swapping
7. Memory Protection
8. Memory Sharing
9. Garbage Collection
10. Buddy System
PART – B

11 a. Discuss the different architecture of OS starting from simple structure, layered


structure, micro kernels, modules and hybrid system with suitable example.
Architecture: (4 Marks)
Microkernel (3 Marks)
Virtual Machine (3 Marks)
Comparison between Monolithic Kernel and Microkernel (3 Marks)
OR
(i) State the basic functions of OS and DMA.
Basic Functions of an Operating System. (6 Marks)
(i) Process Management
(ii) Memory Management
(iii) File System Management
(iv) Device Management
(v) Security and Access Control
b. (vi) User Interface
(vii) Input/Output Management
(viii) Networking

(ii) Explain system call system generation and OS generation.


System Call (System Generation) (3 Marks)
OS Generation (4 Marks)
(i) Customization for Hardware
(ii) Steps Involved in OS Generation
(iii) Purpose of OS Generation
Consider the following set of processes with the length of CPU burst time given in
milli seconds
Process Burst Time Priority Arrival
Time
P1 10 3 0
12 a. P2 1 1 1
P3 2 3 2
P4 1 4 1
P5 5 2 2
Draw the Gantt chart for the execution of these process using FCFS, SJF,
Preemptive and non-preemptive priority and round robin with the time slice of 2
ms, Find average waiting time and turn around time using each of the methods.
OR
Explain deadlock detection and recovery mechanism with suitable example.
1. Deadlock Detection (7 Marks)

Deadlock detection involves identifying when a system is in a deadlock state. In the case
of processes and resources, we often detect deadlocks by constructing a resource
allocation graph (RAG) or utilizing wait-for graphs.

b. Resource Allocation Graph (RAG):


Wait-for Graph
Example of Deadlock Detection
2. Deadlock Recovery (6 Marks)
(i) Process Termination:
Terminate all deadlocked processes
Terminate one process at a time
(ii) Resource Preemption:

(i) With a neat sketch, explain how logical address is translated into physical
address using paging mechanism.
Paging Mechanism: Translation of Logical Address to Physical Address
Architecture: (5 Marks)

13 a.

Components Involved:

1. Logical Address: (3 Marks)


(i) Page Number (P)
(ii) Offset (D)

2. Physical Address (3 Marks)


(i) Frame Number (F)
(ii) Offset (D)

3. Page Table (2 Marks)


OR

b. Consider the following page reference string 1,2,3,4,5,3,4,1,6,7,


8,7,8,9,7,8,9,5,4,4,5,3. How many page fault will occur for the following
replacement algorithms assuming four frames? Remembering all frames are
initially empty.
(i) LRU repalcement (4 Marks)
LRU replaces the least recently used page.
Frames after
Step Page Page Fault?
insertion
1 1 1 ✅ Yes
2 2 12 ✅ Yes
3 3 123 ✅ Yes
4 4 1234 ✅ Yes

5 5 2345 ✅ Yes (1 evicted)

❌ No (3 reused, just
6 3 2453
reordered)
7 4 2534 ❌ No

8 1 5341 ✅ Yes (2 evicted)

9 6 3416 ✅ Yes (5 evicted)

10 7 4167 ✅ Yes (3 evicted)

11 8 1678 ✅ Yes (4 evicted)

12 7 1687 ❌ No
13 8 1678 ❌ No

14 9 6789 ✅ Yes (1 evicted)

15 7 6897 ❌ No
16 8 6978 ❌ No
17 9 6789 ❌ No

18 5 7895 ✅ Yes (6 evicted)

19 4 8954 ✅ Yes (7 evicted)

20 4 8954 ❌ No
21 5 8945 ❌ No

22 3 9453 ✅ Yes (8 evicted)

(ii) FIFO replacement (4 Marks)


Replaces the oldest page in memory.
Uses a queue to manage insertion order.
Step Page Queue after insert Page Fault?
1 1 1 ✅ Yes
2 2 12 ✅ Yes
3 3 123 ✅ Yes
4 4 1234 ✅ Yes
5 5 2345 ✅ Yes (1 out)
6 3 2345 ❌ No
7 4 2345 ❌ No
8 1 3451 ✅ Yes (2 out)
9 6 4516 ✅ Yes (3 out)
10 7 5167 ✅ Yes (4 out)
11 8 1678 ✅ Yes (5 out)
12 7 1678 ❌ No
13 8 1678 ❌ No
14 9 6789 ✅ Yes (1 out)
15 7 6789 ❌ No
16 8 6789 ❌ No
17 9 6789 ❌ No
18 5 7895 ✅ Yes (6 out)
19 4 8954 ✅ Yes (7 out)
20 4 8954 ❌ No
21 5 8945 ❌ No
22 3 9453 ✅ Yes (8 out)

(iii) Optimal replacement (5 Marks)


Replaces the page that won’t be used for the longest time in the future.
Requires future knowledge of the reference string.
Replacement
Step Page Frame Contents Page Fault?
Logic
1 1 1 ✅ Initial insert
2 2 12 ✅ Insert
3 3 123 ✅ Insert
4 4 1234 ✅ Insert
1 used later →
5 5 2345 ✅
evict 1
6 3 2345 ❌ In memory
7 4 2345 ❌ In memory
2 won’t be used
8 1 3451 ✅
again soon
9 6 4516 ✅ 3 won’t be used
Replacement
Step Page Frame Contents Page Fault?
Logic
again soon
4 won’t be used
10 7 5167 ✅
until 19
5 used sooner
11 8 1678 ✅
than 1 → evict 5
12 7 1678 ❌ In memory
13 8 1678 ❌ In memory
14 9 1789 ✅ 6 not used again
15 7 1789 ❌ In memory
16 8 1789 ❌ In memory
17 9 1789 ❌ In memory
18 5 7895 ✅ 1 not used again
19 4 8954 ✅ 7 not used again
20 4 8954 ❌ In memory
21 5 8945 ❌ In memory
22 3 9453 ✅ 8 not used again
Examine different free space management techniques in file systems and compare
their efficiency.

1. Bitmaps (Bit Vectors) (2 Marks)


2. Linked List (Free List)(2 Marks)
3. Grouping (2 Marks)
4. Counting (2 Marks)

14 a. Comparison Table: (5 Marks)


Contiguous
Time Space
Technique Allocation Complexity
Efficiency Efficiency
Support
Bitmap Medium Good Good Low
Linked List Poor Excellent Poor Very Low
Grouping Medium-High Excellent Moderate
Medium
Counting High Excellent Excellent
High
OR
b. llustrate different directory structures and demonstrate how file protection
mechanisms work in a multi-user environment.
Directory Structures: (7 Marks)
1. Single-Level Directory
2. Two-Level Directory
3. Tree-Structured Directory
4. Acyclic Graph Directory
5. General Graph Directory
File Protection in a Multi-User Environment (6 Marks)
1. Access Control List (ACL)
2. UNIX-style Permissions (Owner, Group, Others)
3. Capability Lists
Explain in detail about the concept of virtualization and its building blocks.

Virtualization is the process of creating a virtual version of something—such as


hardware platforms, storage devices, network resources, or operating systems—by
abstracting physical resources using software. (2 Marks)

Building Blocks of Virtualization (11 Marks)

15 a. 1. Host Machine
2. Hypervisor (Virtual Machine Monitor - VMM)
3. Guest Machine (Virtual Machine - VM)
4. Virtual Hardware
5. Virtual Machine Manager / Orchestration Tools
6. Storage Virtualization
7. Network Virtualization
8. Snapshot and Cloning

b . Analyze
(i) Mobile OS
Primary Market Share
OS Developer Core Kernel
Language (2024 est.)
Google (Open Java, Kotlin, C+
Android Linux ~70-75%
Source) +
Darwin (BSD + Objective-C,
iOS Apple ~25-30%
Mach) Swift
Hybrid (LiteOS <2% (regional
HarmonyOS Huawei C/C++, Java
+ AOSP) use)
KaiOS HTML5, <1% (feature
KaiOS Linux
Technologies JavaScript phones)

(ii) Desktop OS
OS Developer Kernel Type Common Use Case

General-purpose,
Windows Microsoft Hybrid
gaming, enterprise

Creative work,
macOS Apple Hybrid (XNU) Apple ecosystem
users

Monolithic Developers, servers,


Linux Community-driven
(modular) customization

ChromeOS Google Monolithic (Linux) Web-centric users,


OS Developer Kernel Type Common Use Case
education
Security-focused,
BSD Variants FreeBSD, OpenBSD Monolithic
niche use

(iii) Multi-user OS
OS Description Use Case

True multi-user from the Servers, supercomputers,


Unix/Linux
ground up desktops

Multi-user via RDP &


Windows Server Enterprise environments
domain services
Supports multiple accounts
Personal/Creative
macOS (not simultaneous GUI
workstations
sessions)
Banking, large-scale
Mainframe OS (z/OS) Used in IBM mainframes
systems
Unix-based, strong in
Solaris Legacy enterprise use
multi-user management
PART-C
16 a. Consider the following snapshot of a system.

Allocation Max Available


Process
A B C D A B C D A B C D
P0 0 0 1 2 0 0 1 2 1 5 2 0
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6
Answer the following questions using the Banker’s Algorithm:

i. What is the content of the matrix Need?


Calculate the Need Matrix

Process P0:
Need = Max - Allocation = (0, 0, 1, 2) - (0, 0, 1, 2) = (0, 0, 0, 0)
Process P1:
(1, 7, 5, 0) - (1, 0, 0, 0) = (0, 7, 5, 0)
Process P2:
(2, 3, 5, 6) - (1, 3, 5, 4) = (1, 0, 0, 2)
Process P3:
(0, 6, 5, 2) - (0, 6, 3, 2) = (0, 0, 2, 0)
Process P4:
(0, 6, 5, 6) - (0, 0, 1, 4) = (0, 6, 4, 2)
Need Matrix
Process A B C D
P0 0 0 0 0
P1 0 7 5 0
P2 1 0 0 2
P3 0 0 2 0
P4 0 6 4 2
(ii) Is the system in a safe state?
The system is in a safe state.
(iii) If a request from thread T₁ arrives for (0,4,2,0), can the request be granted
immediately?
The request (0,4,2,0) cannot be granted immediately because it would lead to an unsafe
state.
OR
b. Suppose that the disk drive has 5000 cylinders number 0 to 4999. The drive is serving a
request at cylinder 145. The queue of pending request in FIFO order is 86, 1470, 913,
1774, 948, 1509, 1022, 1750, 130 starting from the head position, what is the total
distance (cylinder) that the disk arm moves to satisfy all the pending request for each of
the disk scheduling algorithms. FCFS, SSTF, SCAN, CSCAN, LOOK, CLOOK.
Explain the pros and cons of all the disk scheduling algorithm.
FCFS (First Come First Serve)
Sequence:
Start at 145 → 86 → 1470 → 913 → 1774 → 948 → 1509 → 1022 → 1750 → 130
Head Movements:
145 → 86 = 59
86 → 1470 = 1384
1470 → 913 = 557
913 → 1774 = 861
1774 → 948 = 826
948 → 1509 = 561
1509 → 1022 = 487
1022 → 1750 = 728
1750 → 130 = 1620
Total = 59 + 1384 + 557 + 861 + 826 + 561 + 487 + 728 + 1620 = 7083 cylinders.
SSTF (Shortest Seek Time First)
Always go to the closest request from the current position.
Start at 145
Queue: [86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130]
Steps:
From 145 → 130 (15)
From 130 → 86 (44)
From 86 → 913 (827)
From 913 → 948 (35)
From 948 → 1022 (74)
From 1022 → 1470 (448)
From 1470 → 1509 (39)
From 1509 → 1750 (241)
From 1750 → 1774 (24)
Total = 15 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24 = 1747 cylinders
SCAN
Moves in one direction (e.g., toward 0), servicing requests, then reverses at the end.
Assume initial direction is toward 0
Sorted queue: [86, 130, 913, 948, 1022, 1470, 1509, 1750, 1774]
Split:
Left of 145: [130, 86]
Right of 145: [913, 948, 1022, 1470, 1509, 1750, 1774]
Sequence: 145 → 130 → 86 → 0 (end) → 913 → ... → 1774
Movements:
145 → 130 = 15
130 → 86 = 44
86 → 0 = 86
0 → 913 = 913
913 → 948 = 35
948 → 1022 = 74
1022 → 1470 = 448
1470 → 1509 = 39
1509 → 1750 = 241
1750 → 1774 = 24
Total = 15 + 44 + 86 + 913 + 35 + 74 + 448 + 39 + 241 + 24 = 1919 cylinders
C-SCAN (Circular SCAN)
Like SCAN but after reaching end, jumps to beginning without servicing during the
return.
Direction: Toward 0
Sequence:
145 → 130 → 86 → 0 → jump to 4999 → 913 → ... → 1774
Movements:
145 → 130 = 15
130 → 86 = 44
86 → 0 = 86
Jump from 0 → 4999 = 4999
4999 → 913 = 4086
913 → 948 = 35
948 → 1022 = 74
1022 → 1470 = 448
1470 → 1509 = 39
1509 → 1750 = 241
1750 → 1774 = 24
Total = 15 + 44 + 86 + 4999 + 4086 + 35 + 74 + 448 + 39 + 241 + 24 = 11,091
cylinders
LOOK
Like SCAN but only goes as far as the last request in the direction before reversing (not
to 0 or 4999).
Sorted Requests:
[86, 130, 913, 948, 1022, 1470, 1509, 1750, 1774]
Start at 145, direction toward 0 → 130 → 86
Then reverse: 913 → ... → 1774
Movements:
145 → 130 = 15
130 → 86 = 44
86 → 913 = 827
913 → 948 = 35
948 → 1022 = 74
1022 → 1470 = 448
1470 → 1509 = 39
1509 → 1750 = 241
1750 → 1774 = 24
Total = 15 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24 = 1747 cylinders
C-LOOK
Like C-SCAN, but only jumps to lowest request after servicing highest one (no full
jump to 4999).
Sequence:
145 → 130 → 86 → jump to 913 → ... → 1774
Movements:
145 → 130 = 15
130 → 86 = 44
Jump from 86 → 913 = 827
913 → 948 = 35
948 → 1022 = 74
1022 → 1470 = 448
1470 → 1509 = 39
1509 → 1750 = 241
1750 → 1774 = 24
Total = 15 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24 = 1747 cylinders
COURSE FACULTY HOD

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy