0% found this document useful (0 votes)
0 views

Operating_Systems_Answers

The document covers various topics in operating systems, including the architecture and functionalities of a Smart TV OS, program execution and process creation, scheduling problems in a bank help desk scenario, and deadlock avoidance in resource allocation. It includes diagrams, code examples, and calculations for average waiting and turnaround times. Each section is structured with specific questions and detailed answers, providing a comprehensive overview of the subject matter.

Uploaded by

Riyaz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Operating_Systems_Answers

The document covers various topics in operating systems, including the architecture and functionalities of a Smart TV OS, program execution and process creation, scheduling problems in a bank help desk scenario, and deadlock avoidance in resource allocation. It includes diagrams, code examples, and calculations for average waiting and turnaround times. Each section is structured with specific questions and detailed answers, providing a comprehensive overview of the subject matter.

Uploaded by

Riyaz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Operating Systems - Part A (10×10 = 100 Marks)

Q1. Smart TV Operating System - Block Diagram and Functionalities (10 Marks)

Answer:

A Smart TV operating system must efficiently manage hardware components, applications, and user

interactions.

Block Diagram:

+--------------------------------+

| Applications |

| (YouTube, Netflix, Games, etc.)|

+--------------------------------+

| Application Framework |

+--------------------------------+

| System Services (API) |

| (Window Manager, Media, etc) |

+--------------------------------+

| OS Kernel (Linux Based) |

| (Process Mgmt, Memory Mgmt, I/O)|

+--------------------------------+

| Hardware Abstraction |

| (Drivers for GPU, Audio, etc.) |

+--------------------------------+

| Hardware Components |

| (CPU, RAM, Storage, Sensors, etc)|


+--------------------------------+

Hardware Components:

- CPU: Process and execute instructions.

- RAM: Temporary memory for apps.

- Storage (eMMC/SSD): Save apps and data.

- Wi-Fi Module: Internet connectivity.

- GPU: Graphics processing for video.

- I/O Devices: Remote, Touch, HDMI ports.

Default Functionalities:

- Manage user apps and system apps.

- Handle video/audio streaming.

- Manage network connectivity (Wi-Fi, Bluetooth).

- Perform updates and patches.

- Interface with external devices (USB, HDMI).

- Provide security (sandboxing apps).

Q2. Program Execution and Process Creation (10 Marks)

(a) Program X Execution Steps (with Diagram)

When a program X is to be executed by Operating System Y:

1. New State: Program is loaded into memory (Job Queue).

2. Ready State: OS places it into Ready Queue.

3. Running State: Dispatcher picks and allocates CPU.

4. Waiting State: If I/O needed, it waits.

5. Terminated State: After execution ends.


State Diagram:

New --> Ready --> Running --> (Waiting/Ready) --> Terminated

(b) Process Creation Program (1 Parent + 3 Children)

(see next page)


#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>

int main() {
pid_t pid1, pid2, pid3;

pid1 = fork(); // First child


if (pid1 == 0) {
sleep(2);
printf("First Child terminates\n");
return 0;
} else {
pid2 = fork(); // Second child
if (pid2 == 0) {
sleep(1);
printf("Second Child terminates\n");
return 0;
} else {
pid3 = fork(); // Third child
if (pid3 == 0) {
printf("Third Child terminates first\n");
return 0;
} else {
wait(NULL);
wait(NULL);
wait(NULL);
printf("Parent terminates last\n");
}
}
}
return 0;
}

Q3. Bank Help Desk - Scheduling Problems (10 Marks)

Given:

Customer | Arrival(ms) | Service(ms) | Token

C1 3 5 3

C2 8 3 1

C3 0 9 2

C4 5 4 4
(a) Minimum Service Time First (SJF)

Order: C2, C4, C1, C3

Average Waiting Time = 10.5 ms

Average Turnaround Time = 15.75 ms

(b) Based on Token Numbers

Order: C2, C3, C1, C4

Average Waiting Time = 13 ms

Average Turnaround Time = 18.25 ms

(c) Round Robin (2ms time slice)

Average Waiting Time ~10.25 ms

Average Turnaround Time ~15.5 ms

Q4. Deadlock Avoidance - Restaurant Resource Allocation (10 Marks)

(a) Safety of Allocation

Available = (2, 1, 2)

Safe sequence possible: B -> C -> A

Yes, the allocation is safe.

(b) Request by A for 1 More Knife

Available R1 = 1, request can be granted.

System remains safe.

You might also like