Impartant IA1 Questions
Impartant IA1 Questions
Write the Difference Between Batch systems and Time sharing systems . (2)
Execution Mode:
Batch Systems
Time-Sharing Systems
User Interaction
Batch Systems
1 Time-Sharing Systems
Resource Allocation
Batch Systems
Time-Sharing Systems
Response Time:
Batch Systems
Time-Sharing Systems
How does an Interrupt differ from a Trap? (2)
Interrupt: and Trap (Exception):
Origin
2 Purpose
Triggering
Handling
Priority
What are the disadvantages of Multiprocessor System? (2)
Complexity
Scalability Challenges
Programming Complexity
3
Increased Hardware Costs
Contention and Bottlenecks
Increased Power Consumption and Heat Dissipation.
Software Compatibility and Portability
Under What circumstances CPU scheduling decision takes place? (2)
Process Creation
Process Termination
Process Blocking
4 Process Preemption
Interrupt Handling
Time Quantum Expiration
Processor Affinity
System Load Changes:
Define thread? (2)
Threads are lightweight compared to processes because they share resources with other threads within
the same process. Creating, switching, and terminating threads typically require less overhead than processes,
making threads a more efficient mechanism for multitasking.
Execution Unit.
5
Lightweight: Concurrent Execution
Shared Resources
Scheduling
User-Level Threads vs. Kernel-Level Threads
Thread States:
Explain the various types of System calls with an example for each? (3*4=12)
Process Control System Calls:
File Management System Calls:
Device Management System Calls:
Examples:
o read(), write()
o example, read()
7. a
o ioctl
Communication System Calls
Examples:
o pipe():socket():
Memory Management System Calls:
Examples:
o brk(), sbrk(),mmap
(OR)
Discuss about the functionality of system boot with respect to operating system. (6*2=12)
Power-On Self-Test (POST):
Initialization of Basic Input/Output System (BIOS) or Unified Extensible Firmware Interface (UEFI):
Bootloader Execution:
b.
Operating System Initialization:
User Interface Initialization
User Login or Application Startup:
Explain the FCFS, preemptive and non-preemptive versions of Shortest-Job First and Round Robin (time
slice = 2) scheduling algorithms with Gantt charts for the four Processes given. Compare their average
turnaround and waiting time. (4*3=12)
Process Arrival Time Waiting Time
P1 0 8
P2 1 4
P3 2 9
8. a.
P4 3 5
ANS:
1. FCFS (First-Come, First-Served):
| P1 | P2 | P3 | P4 |
0 8 12 21 26
2.Average Turnaround Time:
(Turnaround Time of P1 + Turnaround Time of P2 + Turnaround Time of P3 + Turnaround Time of P4) / 4
= ((8 + 8) + (12 + 4) + (21 + 9) + (26 + 5)) / 4
= (16 + 16 + 30 + 31) / 4
= 23.25
Average Waiting Time:
(Waiting Time of P1 + Waiting Time of P2 + Waiting Time of P3 + Waiting Time of P4) / 4
= (8 + 4 + 9 + 5) / 4
= 6.5
Preemptive SJF (Shortest-Job First)
Gantt Chart:
| P1 | P2 | P4 | P3 |
0 8 9 14 23
Average Turnaround Time:
(Turnaround Time of P1 + Turnaround Time of P2 + Turnaround Time of P3 + Turnaround Time of P4) / 4
= ((8 + 8) + (9 + 4) + (23 + 9) + (14 + 5)) / 4
= (16 + 13 + 32 + 19) / 4
= 20
Average Waiting Time
(Waiting Time of P1 + Waiting Time of P2 + Waiting Time of P3 + Waiting Time of P4) / 4
= (8 + 4 + 9 + 5) / 4
= 6.5
Non-Preemptive SJF (Shortest-Job First)
Gantt Chart:
| P1 | P2 | P4 | P3 |
0 8 9 14 23
Average Turnaround Time
(Turnaround Time of P1 + Turnaround Time of P2 + Turnaround Time of P3 + Turnaround Time of P4) / 4
= ((8 + 8) + (9 + 4) + (23 + 9) + (14 + 5)) / 4
= (16 + 13 + 32 + 19) / 4
= 20
Average Waiting Time:
(Waiting Time of P1 + Waiting Time of P2 + Waiting Time of P3 + Waiting Time of P4) / 4
= (8 + 4 + 9 + 5) / 4
= 6.5
Round Robin (Time Slice = 2)
Gantt Chart:
| P1 | P2 | P3 | P4 | P1 | P3 | P1 | P3 | P3 |
0 2 4 6 8 10 12 14 16 18
Average Turnaround Time:
(Turnaround Time of P1 + Turnaround Time of P2 + Turnaround Time of P3 + Turnaround Time of P4) / 4
= ((8 + 8) + (4 + 4) + (18 + 9) + (12 + 5)) / 4
= (16 + 8 + 27 + 17) / 4
= 17
Average Waiting Time:
(Waiting Time of P1 + Waiting Time of P2 + Waiting Time of P3 + Waiting Time of P4) / 4
= (6 + 2 + 9 + 3) / 4
=5
Comparison:
FCFS Scheduling:
Gantt chart: P1 -> P2 -> P3 -> P4
Average Turnaround Time = (8 + 12 + 21 + 26) / 4 = 16.75
Average Waiting Time = (0 + 8 + 12 + 21) / 4 = 10.25
Non-preemptive SJF Scheduling:
Gantt chart: P1 -> P2 -> P4 -> P3
Average Turnaround Time = (8 + 12 + 17 + 26) / 4 = 15.75
Average Waiting Time = (0 + 8 + 12 + 17) / 4 = 9.25
Preemptive SJF Scheduling:
Gantt chart: P1 -> P2 -> P4 -> P3
Average Turnaround Time = (8 + 12 + 17 + 26) / 4 = 15.75
Average Waiting Time = (0 + 8 + 12 + 17) / 4 = 9.25
Round Robin Scheduling:
Gantt chart: P1 -> P2 -> P3 -> P4 -> P1 -> P3 -> P2 -> P4 -> P3 -> P1
Average Turnaround Time = (16 + 12 + 26 + 22) / 4 = 19
Average Waiting Time = (8 + 4 + 16 + 12) / 4 = 10
Comparing the average turnaround and waiting times:
FCFS: Turnaround = 16.75, Waiting = 10.25
Non-preemptive SJF: Turnaround = 15.75, Waiting = 9.25
Preemptive SJF: Turnaround = 15.75, Waiting = 9.25
Round Robin: Turnaround = 19, Waiting = 10
(OR)
Consider the following set of processes, with the length of the CPU – burst time given in Milliseconds:
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
The processes are arrived in the order P1, P2, P3, P4, P5, all at time 0.
1. Draw 4 Gantt charts illustrating the execution of these processes using FCFS, SJF
Priority and RR (Time Slice = 1) scheduling
2. What is the turnaround time of each process for each of the scheduling?
3. Calculate the waiting time for each of the process (4*3=12)
Ans:
FCFS (First-Come, First-Served) Scheduling:
|P1|P2|P3|P4|P5|
SJF Priority Scheduling:
|P2|P5|P3|P1|P4|
Round Robin (RR) Scheduling (Time Slice = 1):
|P1|P2|P3|P4|P5|P1|P3|P5|P1|
calculate the turnaround time and waiting time for each process:
FCFS Scheduling:
Turnaround time:
P1: 10
P2: 11
P3: 13
P4: 14
b P5: 19
Waiting time:
P1: 0
P2: 10
P3: 11
P4: 13
P5: 14
SJF Priority Scheduling:
Turnaround time:
P1: 25
P2: 2
P3: 15
P4: 16
P5: 7
Waiting time:
P1: 15
P2: 0
P3: 13
P4: 14
P5: 2
Round Robin (RR) Scheduling (Time Slice = 1):
Turnaround time:
P1: 22
P2: 2
P3: 16
P4: 17
P5: 12
Waiting time:
P1: 12
P2: 0
P3: 14
P4: 15
P5: 7
PART-C (1*14=14 Marks)
Describe three general methods for passing parameters to the operating system with example? (3+3+8=14)
Ans:
1. Command-line arguments
Ex: $ ./my_program arg1 arg2 arg3
2. Environment variables
Ex: $ export MY_VARIABLE=value
3. System calls
Ex: #include <unistd.h>
#include <fcntl.h>
9 a
int main() {
const char *file_path = "/path/to/file";
int file_descriptor = open(file_path, O_RDONLY);
if (file_descriptor == -1) {
// Handle error
}
// File opened successfully, continue processing...
close(file_descriptor);
return 0;
}
(OR)
Sketch the structure of Direct Memory Access in details? (7*2=14)
Ans:
DMA Controller
DMA Channels
DMA Registers
b
Bus Arbitration
Interrupt Handling
DMA Buffering
Memory Access Control
Programming Interface
PART-B (3*12=36 Marks)
Discuss the different multiprocessor organizations with block diagrams? (4+4+4)
Symmetric Multiprocessing (SMP)
6. a. Non-Uniform Memory Access (NUMA)
Clustered Multiprocessing:
(OR)
Explain important and need of cache with its working principle? (6+6)
Importance of Cache
Speed:
Performance:
b.
Efficiency
Cost-effectiveness
Working Principle of Cache:
Temporal Locality
Spatial Locality
Explain system calls, system programs and OS generation? (4+4+4)
System Calls
open()
read() and write()
fork() and exec()
exit():
ioctl():
System Programs
File Management Programs
Process Management Programs
7. a
Device Management Programs
Networking Programs
System Administration Programs
OS Generation
Requirements Analysis
Design.
Implementation
Testing
Deployment
Maintenance
(OR)
State and explain the major activities of an operating system with regard to file management?(6*2=12)
Ans:
File Creation
File Opening and Closing
File Reading and Writing
File Seeking
b.
File Attribute Manipulation
Directory Management
File System Navigation
File System Security
File System Maintenance
File System Backup and Recovery
Write detail about several CPU scheduling algorithms. (6*2=12)
Ans:
First Come, First Served (FCFS):
o Principle
8. a. o Advantages.
o Disadvantages
Shortest Job Next (SJN) or Shortest Job First (SJF):
o Principle
o Advantages
o Disadvantages
Priority Scheduling
o Principle
o Advantages
o Disadvantages
Round Robin (RR):
o PrincipleAdvantages
o Disadvantages
Multilevel Queue Scheduling:
o Principle
o Advantages
o Disadvantages
Multilevel Feedback Queue Scheduling:
o Principle
o Advantages
o Disadvantages
(OR)
Consider the following set of processes, with the length of the CPU – burst time given in Milliseconds:
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
The processes are arrived in the order P1, P2, P3, P4, P5, all at time 0.
1. Draw 4 Gantt charts illustrating the execution of these processes using FCFS, SJF
Priority and RR (Time Slice = 1) scheduling
2. What is the turnaround time of each process for each of the scheduling?
3. Calculate the waiting time for each of the process (4*3= 2)
Ans:
FCFS (First-Come, First-Served) Scheduling:
|P1|P2|P3|P4|P5|
SJF Priority Scheduling:
|P2|P5|P3|P1|P4|
Round Robin (RR) Scheduling (Time Slice = 1):
|P1|P2|P3|P4|P5|P1|P3|P5|P1|
calculate the turnaround time and waiting time for each process:
b. FCFS Scheduling:
Turnaround time:
P1: 10
P2: 11
P3: 13
P4: 14
P5: 19
Waiting time:
P1: 0
P2: 10
P3: 11
P4: 13
P5: 14
SJF Priority Scheduling:
Turnaround time:
P1: 25
P2: 2
P3: 15
P4: 16
P5: 7
Waiting time:
P1: 15
P2: 0
P3: 13
P4: 14
P5: 2
Round Robin (RR) Scheduling (Time Slice = 1):
Turnaround time:
P1: 22
P2: 2
P3: 16
P4: 17
P5: 12
Waiting time:
P1: 12
P2: 0
P3: 14
P4: 15
P5: 7
Advantages:
Uniformity and Simplicity
Consistency
b
Flexibility
Abstraction
Disadvantages:
Lack of Specialization
Performance Overhead
Complexity in Implementation
Security Concerns
PART-B (3*12=36 Marks)
Describe evolution of operating system? (6*2=12)
Batch Processing Systems (1950s-1960s):
Time-Sharing Systems (1960s-1970s):
6. a. Personal Computing Era (1980s-1990s):
Client-Server Computing (1990s-2000s):
Distributed and Cloud Computing (2000s-Present):
Mobile Computing and IoT (2010s-Present):
(OR)
Explain Cache memory and its mapping? (6+6)
Functionality of Cache Memory:
Temporal Locality
Spatial Locality
Cache Mapping Techniques:
Direct Mapping:
b.
Set-Associative Mapping:
Fully Associative Mapping:
Cache Memory Operation:
Cache Hit
Cache Miss: