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

Os Pyq Answers

The document provides a compilation of repeated questions and answers related to operating systems, covering key concepts such as the difference between processes and programs, context switching, demand paging, and virtual memory. It also discusses types of operating systems, kernel operations, process states, critical sections, and synchronization mechanisms like semaphores. Additionally, it outlines file organization, access methods, and various OS services.

Uploaded by

toneme4974
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)
17 views4 pages

Os Pyq Answers

The document provides a compilation of repeated questions and answers related to operating systems, covering key concepts such as the difference between processes and programs, context switching, demand paging, and virtual memory. It also discusses types of operating systems, kernel operations, process states, critical sections, and synchronization mechanisms like semaphores. Additionally, it outlines file organization, access methods, and various OS services.

Uploaded by

toneme4974
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

Operating System - PYQ Answers with Highlights (Repeated Questions Marked)

SECTION A (2 Marks Each)

(Repeated) 1. Difference between Process and Program:

• A program is a passive set of instructions stored on disk, while a process is the active execution of
those instructions by the CPU. A program becomes a process when it is loaded into memory and
starts execution. A process has attributes like PID, memory, registers, and program counter.

(Repeated) 2. Context Switching:

• Context switching is the mechanism where the CPU switches from one process or thread to another.
It involves saving the current process state (PCB) and loading the state of the next scheduled
process. It's essential for multitasking OS.

(Repeated) 3. Demand Paging:

• Demand paging is a memory management technique where pages are loaded from disk into RAM
only when they are required, reducing memory usage. If a needed page is not in memory, a page
fault occurs.

(Repeated) 4. Virtual Memory:

• Virtual memory allows execution of processes that may not be completely in memory. It uses disk as
an extension of RAM, providing the illusion of a large contiguous address space. Techniques include
paging and segmentation.

(Repeated) 5. Directory vs File:

• A file is a collection of related data stored on a storage device. A directory is a special type of file that
contains references to other files or directories. Directories help organize files in a hierarchical
structure.

(Repeated) 6. Multiprogramming System:

• It allows multiple programs to be loaded into memory and executed concurrently, maximizing CPU
utilization. The OS switches between processes, improving throughput and responsiveness.

(Repeated) 7. Internal vs External Fragmentation:

• Internal fragmentation: Occurs when memory allocated is more than required. Unused space is
within the block.
• External fragmentation: Occurs when free memory is scattered and non-contiguous, making it hard
to allocate large blocks.

1
(Repeated) 8. Critical Section:

• The critical section is a code segment where shared resources are accessed. To prevent race
conditions, only one process should enter the critical section at a time. Synchronization techniques
like mutex, semaphores are used.

(Repeated) 9. Threads:

• Threads are lightweight processes that share the same address space but can run independently.
They improve application performance by parallel execution. Types: user-level and kernel-level
threads.

(Repeated) 10. Operating System Definition:

• An operating system is system software that acts as an intermediary between users and computer
hardware. It manages resources like CPU, memory, I/O devices, and provides services like
multitasking, security, file management.

SECTION B (10 Marks Each)

(Repeated) 1. Types of Operating Systems:

• Batch OS: Executes batches of jobs without user interaction.


• Time-Sharing OS: Allows multiple users to interact with the system at once (via timeslicing).
• Distributed OS: Manages a group of independent computers to appear as a single system.
• Real-Time OS: Provides responses within a strict time limit (used in embedded systems).
• Network OS: Provides services to computers connected over a network.
• Mobile OS: Designed for mobile devices (Android, iOS).

(Repeated) 2. Kernel and its Operations:

• The kernel is the core component of the OS, managing system resources.
• Operations:
• Process management
• Memory management
• File system handling
• Device management
• System calls and interrupt handling

(Repeated) 3. Cause and Handling of Thrashing:

• Thrashing occurs when the system spends more time swapping pages in/out of memory than
executing processes.
• Causes: Excessive paging, insufficient memory, overcommitment.
• Solutions:
• Use working set model
• Reduce degree of multiprogramming

2
• Use better page replacement algorithms

(Repeated) 4. Process States and PCB:

• States: New, Ready, Running, Waiting, Terminated.


• Process Control Block (PCB):
• Process ID
• Program Counter
• CPU Registers
• Memory limits
• Status of I/O devices

(Repeated) 5. Critical Section and Dekker’s Solution:

• Critical section problem occurs when multiple processes access shared resources.
• Dekker’s solution uses shared variables (flags and turn) to ensure mutual exclusion without busy
waiting.

(Repeated) 6. Producer-Consumer Problem using Semaphore:

semaphore mutex = 1;
semaphore full = 0;
semaphore empty = n;

producer() {
wait(empty);
wait(mutex);
// add item to buffer
signal(mutex);
signal(full);
}

consumer() {
wait(full);
wait(mutex);
// remove item from buffer
signal(mutex);
signal(empty);
}

(Repeated) 7. File Organization and Access Methods:

• File Organization: How data is arranged (contiguous, linked, indexed).


• Access Methods:
• Sequential Access
• Direct Access
• Indexed Access

3
(Repeated) 8. OS Services:

• Program Execution
• I/O Operation
• File System Manipulation
• Communication Services
• Error Detection
• Resource Allocation
• Security and Protection

Continued in the next update with Section C answers and diagrams...

You might also like