0% found this document useful (0 votes)
12 views47 pages

All Pages Formatted OS Answers

The document is a solved question paper for Operating Systems for BCA 4th Semester, containing both short and long answer questions. It covers key concepts such as operations of operating systems, real-time systems, scheduling algorithms, memory management techniques like paging and demand paging, file operations, and security measures. The document provides detailed answers and explanations for each question, serving as a comprehensive study guide.

Uploaded by

tgxfriends
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)
12 views47 pages

All Pages Formatted OS Answers

The document is a solved question paper for Operating Systems for BCA 4th Semester, containing both short and long answer questions. It covers key concepts such as operations of operating systems, real-time systems, scheduling algorithms, memory management techniques like paging and demand paging, file operations, and security measures. The document provides detailed answers and explanations for each question, serving as a comprehensive study guide.

Uploaded by

tgxfriends
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/ 47

Operating System - Solved Question Paper (BCA 4th Sem)

PART A: Short Answer Questions (10 x 2 Marks)

Q1(a). List any four operations of Operating System.

Answer:

1(a) Four operations of Operating System:

1. Process Management: Handles creation, scheduling, and termination of processes.

2. Memory Management: Manages the allocation and deallocation of memory to processes.

3. File System Management: Controls creation, reading/writing, and organization of files.

4. Device Management: Manages device communication through drivers and I/O scheduling.

Q1(b). What are Real Time Systems?

Answer:

1(b) Real-Time Systems:

Real-Time Systems are systems that respond to inputs or events within a strict time constraint. They

are used where timely processing is crucial. Two types:

1. Hard Real-Time Systems: Missing deadlines can cause system failure (e.g., pacemakers).

2. Soft Real-Time Systems: Missing deadlines causes performance degradation (e.g., video
streaming).

Q1(c). What is SJF scheduling?

Answer:

1(c) SJF (Shortest Job First) Scheduling:

SJF is a CPU scheduling algorithm that selects the process with the smallest execution time. It can

be:

- Preemptive (Shortest Remaining Time First)

- Non-preemptive

It minimizes average waiting time but may cause starvation of longer processes.

Q1(d). List various scheduling queues.

Answer:

1(d) Scheduling Queues:

1. Job Queue: Holds all processes in the system.

2. Ready Queue: Holds processes that are ready to run.

3. Device Queue: Holds processes waiting for an I/O device.

Schedulers manage movement between these queues.


Q1(e). What is segmentation?

Answer:

1(e) Segmentation:

Segmentation is a memory management technique where memory is divided into logical units called

segments such as code, stack, and data. Each segment has a base and limit. It provides better

logical structuring and protection.

Q1(f). Define Demand Paging?

Answer:

1(f) Demand Paging:

Demand paging loads pages into memory only when they are needed. If the page is not in memory,

a page fault occurs. This saves memory and allows execution of large programs by keeping only

necessary pages in RAM.

Q1(g). What is page fault?

Answer:

1(g) Page Fault:

A page fault occurs when a program accesses a page that is not currently in main memory. The OS
retrieves the page from secondary storage and loads it into RAM, which may involve page

replacement if RAM is full.

Q1(h). What do you mean by user authentication?

Answer:

1(h) User Authentication:

User authentication verifies a user's identity before allowing access to system resources. Common

methods include:

- Passwords

- Biometrics

- Security Tokens

- Multi-factor Authentication

Q1(i). List any four file operations.

Answer:

1(i) File Operations:

1. Create: Make a new file.

2. Open: Access a file.

3. Read: Retrieve data from a file.


4. Write: Store data into a file.

5. Close: End access to a file.

Q1(j). What is system call?

Answer:

1(j) System Call:

A system call is a programmed request to the operating system for a service. Examples:

- Process control (fork, exec)

- File manipulation (open, read, write)

- Device manipulation

- Information maintenance

- Communication

PART B: Long Answer Questions (5 x 8 Marks)

Q2. (a) What is Operating System? Explain various functions of operating


systems.

Answer:

2. What is an Operating System? Explain functions:

An Operating System (OS) is system software that manages hardware and software resources and
provides services for computer programs.

Functions:

1. Process Management

2. Memory Management

3. Storage Management

4. I/O Device Management

5. File System Management

6. Security & Protection

7. Command Interpretation

OR

Types of Operating Systems:

1. Batch OS: Executes batches of jobs without interaction.

2. Time-Sharing OS: Allows multiple users to share system resources simultaneously.

3. Distributed OS: Manages a group of distinct computers.

4. Real-Time OS: Responds to input within a time limit.

5. Network OS: Supports network-based applications and user access.

6. Mobile OS: Designed for mobile devices (e.g., Android, iOS).

OR

Answer:
3. Paging in Memory Management:

Paging divides memory into fixed-size blocks called pages (logical) and frames (physical). When a

program executes, its pages are loaded into available frames.

Advantages:

- Eliminates external fragmentation

- Allows non-contiguous memory allocation

- Simple memory management

Disadvantages:

- Overhead of maintaining page table

- Page faults affect performance

OR

Virtual Memory & Demand Paging:

Virtual memory allows execution of processes that may not be fully in memory.

Demand paging loads a page into memory only when it's needed, reducing memory load.

Page Fault Handling:

1. Trap to OS

2. Find free frame

3. Load page from disk


4. Update page table

5. Resume process

Benefits:

- Efficient memory usage

- Supports large programs

(b) Explain various types of Operating Systems.

Answer:

4. CPU Scheduling Algorithms:

1. FCFS (First Come First Serve): Executes in order of arrival. Simple but causes high waiting time.

2. SJF (Shortest Job First): Executes shortest job next. Efficient but may cause starvation.

3. Priority Scheduling: Based on priority. May lead to starvation.

4. Round Robin: Uses time slices, good for time-sharing systems.

OR

Preemptive vs Non-Preemptive:

- Preemptive: Allows interruption (e.g., Round Robin).

- Non-Preemptive: Process runs till completion (e.g., FCFS).

Scheduling Queues:

- Ready Queue: Waiting for CPU


- Job Queue: All processes

- Device Queue: Waiting for I/O devices

Q3. (a) Explain the concept of Paging in Memory Management schemes.

Answer:

5. File and Directory:

File: Collection of data or information.

Directory: Special file containing other files and directories.

File Access Methods:

1. Sequential: Access data in order.

2. Direct: Access using address or index.

3. Indexed: Uses index block.

File Operations:

- Create, Delete, Open, Close

- Read, Write, Seek

OR

Page Replacement Algorithms:

1. FIFO: Removes oldest page.

2. LRU: Removes least recently used page.


3. Optimal: Removes page not needed for longest time.

Used when a page must be swapped due to full memory.

OR

Answer:

6. Security Measures in OS:

1. Authentication: Verifying identity

2. Authorization: Granting access rights

3. Encryption: Securing data

4. Firewall: Prevents unauthorized access

5. Auditing: Logging access attempts

OR

Protection and Access Matrix:

Protection controls access to resources.

Domain: Defines resources accessible by a process.

Access Matrix: Table defining access rights for subjects (users/processes) over objects

(files/resources).

Example:

File1 File2

User1 Read Write


User2 Write -

Operating System - Detailed Answer Key (BCA 4th Sem)

PART A: Short Answer Questions (10 x 2 Marks)

1(a) Four operations of Operating System:

1. Process Management: Handles creation, scheduling, and termination of processes.

2. Memory Management: Manages the allocation and deallocation of memory to processes.

3. File System Management: Controls creation, reading/writing, and organization of files.

4. Device Management: Manages device communication through drivers and I/O scheduling.

1(b) Real-Time Systems:

Real-Time Systems are systems that respond to inputs or events within a strict time constraint. They

are used where timely processing is crucial. Two types:

1. Hard Real-Time Systems: Missing deadlines can cause system failure (e.g., pacemakers).

2. Soft Real-Time Systems: Missing deadlines causes performance degradation (e.g., video

streaming).

1(c) SJF (Shortest Job First) Scheduling:

SJF is a CPU scheduling algorithm that selects the process with the smallest execution time. It can

be:
- Preemptive (Shortest Remaining Time First)

- Non-preemptive

It minimizes average waiting time but may cause starvation of longer processes.

1(d) Scheduling Queues:

1. Job Queue: Holds all processes in the system.

2. Ready Queue: Holds processes that are ready to run.

3. Device Queue: Holds processes waiting for an I/O device.

Schedulers manage movement between these queues.

1(e) Segmentation:

Segmentation is a memory management technique where memory is divided into logical units called

segments such as code, stack, and data. Each segment has a base and limit. It provides better

logical structuring and protection.

1(f) Demand Paging:

Demand paging loads pages into memory only when they are needed. If the page is not in memory,

a page fault occurs. This saves memory and allows execution of large programs by keeping only

necessary pages in RAM.


1(g) Page Fault:

A page fault occurs when a program accesses a page that is not currently in main memory. The OS

retrieves the page from secondary storage and loads it into RAM, which may involve page

replacement if RAM is full.

1(h) User Authentication:

User authentication verifies a user's identity before allowing access to system resources. Common

methods include:

- Passwords

- Biometrics

- Security Tokens

- Multi-factor Authentication

1(i) File Operations:

1. Create: Make a new file.

2. Open: Access a file.

3. Read: Retrieve data from a file.

4. Write: Store data into a file.

5. Close: End access to a file.


1(j) System Call:

A system call is a programmed request to the operating system for a service. Examples:

- Process control (fork, exec)

- File manipulation (open, read, write)

- Device manipulation

- Information maintenance

- Communication

PART B: Long Answer Questions (5 x 8 Marks with all options)

2. What is an Operating System? Explain functions:

An Operating System (OS) is system software that manages hardware and software resources and

provides services for computer programs.

Functions:

1. Process Management

2. Memory Management

3. Storage Management

4. I/O Device Management

5. File System Management

6. Security & Protection


7. Command Interpretation

OR

Types of Operating Systems:

1. Batch OS: Executes batches of jobs without interaction.

2. Time-Sharing OS: Allows multiple users to share system resources simultaneously.

3. Distributed OS: Manages a group of distinct computers.

4. Real-Time OS: Responds to input within a time limit.

5. Network OS: Supports network-based applications and user access.

6. Mobile OS: Designed for mobile devices (e.g., Android, iOS).

3. Paging in Memory Management:

Paging divides memory into fixed-size blocks called pages (logical) and frames (physical). When a

program executes, its pages are loaded into available frames.

Advantages:

- Eliminates external fragmentation

- Allows non-contiguous memory allocation

- Simple memory management

Disadvantages:

- Overhead of maintaining page table

- Page faults affect performance


OR

Virtual Memory & Demand Paging:

Virtual memory allows execution of processes that may not be fully in memory.

Demand paging loads a page into memory only when it's needed, reducing memory load.

Page Fault Handling:

1. Trap to OS

2. Find free frame

3. Load page from disk

4. Update page table

5. Resume process

Benefits:

- Efficient memory usage

- Supports large programs

4. CPU Scheduling Algorithms:

1. FCFS (First Come First Serve): Executes in order of arrival. Simple but causes high waiting time.

2. SJF (Shortest Job First): Executes shortest job next. Efficient but may cause starvation.

3. Priority Scheduling: Based on priority. May lead to starvation.

4. Round Robin: Uses time slices, good for time-sharing systems.


OR

Preemptive vs Non-Preemptive:

- Preemptive: Allows interruption (e.g., Round Robin).

- Non-Preemptive: Process runs till completion (e.g., FCFS).

Scheduling Queues:

- Ready Queue: Waiting for CPU

- Job Queue: All processes

- Device Queue: Waiting for I/O devices

5. File and Directory:

File: Collection of data or information.

Directory: Special file containing other files and directories.

File Access Methods:

1. Sequential: Access data in order.

2. Direct: Access using address or index.

3. Indexed: Uses index block.

File Operations:

- Create, Delete, Open, Close

- Read, Write, Seek


OR

Page Replacement Algorithms:

1. FIFO: Removes oldest page.

2. LRU: Removes least recently used page.

3. Optimal: Removes page not needed for longest time.

Used when a page must be swapped due to full memory.

6. Security Measures in OS:

1. Authentication: Verifying identity

2. Authorization: Granting access rights

3. Encryption: Securing data

4. Firewall: Prevents unauthorized access

5. Auditing: Logging access attempts

OR

Protection and Access Matrix:

Protection controls access to resources.

Domain: Defines resources accessible by a process.

Access Matrix: Table defining access rights for subjects (users/processes) over objects

(files/resources).

Example:
File1 File2

User1 Read Write

User2 Write -

Operating System - Answer Key (BCA 4th Sem)

PART A: Short Answer Questions (10 x 2 Marks)

1(a) Operations of Operating System:

- Process Management

- Memory Management

- File System Management

- Device Management

1(b) Real-Time Systems:

Real-time systems are systems that respond to inputs or events within a guaranteed time.

Examples: Embedded systems, Air traffic control.

1(c) SJF Scheduling:

Shortest Job First (SJF) scheduling is a CPU scheduling algorithm that selects the process with the

shortest execution time.


1(d) Scheduling Queues:

- Job Queue

- Ready Queue

- Device Queue

1(e) Segmentation:

Segmentation is a memory management technique where memory is divided into variable-sized

segments based on the logical divisions of a program.

1(f) Demand Paging:

Demand paging is a memory management technique where pages are loaded into memory only

when they are needed, reducing memory usage.

1(g) Page Fault:

A page fault occurs when a program tries to access a page that is not currently in memory,

triggering a page load from secondary storage.

1(h) User Authentication:

User authentication is the process of verifying the identity of a user through credentials like

usernames, passwords, or biometric data.


1(i) File Operations:

- Create

- Open

- Read

- Write

- Close

1(j) System Call:

A system call is a request made by a program to the operating system to perform low-level

operations like file access or process control.

PART B: Long Answer Questions (5 x 8 Marks)

2. What is Operating System?

An Operating System (OS) is system software that manages computer hardware and software

resources and provides services for computer programs.

Functions:

- Process Management

- Memory Management

- File System Management

- Device Management
- Security and Access Control

Types of Operating Systems:

- Batch OS

- Time-Sharing OS

- Distributed OS

- Real-Time OS

- Network OS

- Mobile OS

3. Paging in Memory Management:

Paging is a memory management scheme that eliminates the need for contiguous allocation of

physical memory. It divides the process into pages and memory into frames. Pages are loaded into

any available memory frame.

Advantages:

- Reduces fragmentation

- Easy to manage memory

- Increases efficiency

OR

Virtual Memory and Demand Paging:


Virtual memory allows execution of processes not completely in memory. Demand paging loads

pages only when needed.

Benefits:

- Efficient memory use

- Faster process switching

- Lower I/O overhead

4. CPU Scheduling Algorithms:

- FCFS (First-Come, First-Served)

- SJF (Shortest Job First)

- Priority Scheduling

- Round Robin

Preemptive vs Non-Preemptive:

- Preemptive allows interruption of current task for higher priority one.

- Non-preemptive executes the current task until completion.

Scheduling Queues:

- Ready Queue

- Waiting Queue

- Job Queue
5. File and Directory:

File: Logical unit of storage containing data.

Directory: Structure that contains references to files.

File Access Methods:

- Sequential Access

- Direct Access

- Indexed Access

File Operations:

- Open, Close

- Read, Write

- Create, Delete

OR

Page Replacement Algorithms:

- FIFO (First-In First-Out)

- LRU (Least Recently Used)

- Optimal Algorithm

6. Security Measures:

- Authentication

- Authorization
- Encryption

- Firewalls

- Auditing

OR

Protection:

Protection refers to controlling access to system resources.

Domain of Protection: Set of objects and access rights.

Access Matrix: Table that defines rights of each subject over each object.

Operating System - MST Test 1 & 2 (Detailed Answers)

MST Test-1

Q1. List any four functions of Operating System.

An operating system (OS) is system software that manages computer hardware and software

resources and provides services to computer programs. Here are four major functions:

1. **Process Management**: Handles the creation, scheduling, and termination of processes. It

manages process states and ensures smooth multitasking.

2. **Memory Management**: Allocates and deallocates memory space as needed by different

programs. Ensures efficient use of memory and avoids memory leaks.

3. **File System Management**: Manages files on different storage devices. It handles operations
like creation, deletion, reading, writing, and access control.

4. **Device Management**: Manages device communication via drivers. Handles input/output

devices like keyboards, printers, and disk drives, ensuring proper functioning.

Q2. What are software types? Name its types.

Software is a set of instructions, data, or programs used to operate computers and execute specific

tasks. There are mainly two types of software:

1. **System Software**: It includes the operating system and all utility programs that manage

computer resources at a low level. Examples: Windows, Linux, MacOS.

2. **Application Software**: It includes programs designed for end users to perform specific tasks.

Examples: MS Word, Excel, Browsers, Games.

Other types include middleware, programming software, and firmware.

Q3. Difference between Preemptive & Non-Preemptive Scheduling.

**Preemptive Scheduling** allows the operating system to forcibly remove a process from the CPU

to assign it to another. It ensures better response time.

**Non-Preemptive Scheduling** means once a process starts execution, it runs until it completes.

No other process can take the CPU in the meantime.

Examples:
- Preemptive: Round Robin, Shortest Remaining Time First

- Non-Preemptive: FCFS (First Come First Serve), SJF (Shortest Job First)

Q4. Define PCB.

**PCB (Process Control Block)** is a data structure used by the operating system to store all the

information about a process. It includes:

- Process ID

- Process state (Ready, Running, Waiting, etc.)

- CPU registers

- Memory management info

- Scheduling information

- I/O status

PCB helps the OS to keep track of all processes.

Q5. Explain Time Sharing System and Distributed System.

**Time Sharing System** allows multiple users to access a computer system concurrently. Each

user gets a time slice of the CPU, making it appear as if all users are using the system

simultaneously. Example: University terminals accessing one mainframe.

**Distributed System** consists of multiple independent computers that appear to the user as a

single system. These systems communicate and coordinate over a network. Example: Google
servers distributed globally.

Q6. Define Process. Explain various states of process.

A **Process** is a program in execution. It consists of the program code, current activity, and

resources (memory, files, etc.).

**States of a Process**:

1. **New** Process is being created.

2. **Ready** Waiting to be assigned to a processor.

3. **Running** Instructions are being executed.

4. **Waiting** Waiting for some event (like I/O).

5. **Terminated** Process has finished execution.

6. **Suspended** Temporarily stopped, can be resumed later.

Q7. Explain any five CPU Scheduling algorithms.

1. **FCFS (First Come First Serve)**: Processes are executed in the order they arrive. Simple but

can lead to long waiting times.

2. **SJF (Shortest Job First)**: Executes the process with the shortest burst time. Efficient but hard

to predict burst time.

3. **Round Robin**: Each process gets equal CPU time in turns. Good for time-sharing systems.
4. **Priority Scheduling**: Each process is assigned a priority. Higher priority processes are

executed first.

5. **Multilevel Queue Scheduling**: Processes are divided into queues based on priority or type

(interactive, batch, etc.) and scheduled accordingly.

MST Test-2

Q1. What is demand paging?

**Demand Paging** is a memory management scheme in which pages are loaded into memory only

when they are needed (on demand), rather than loading all pages of a process at once. If a required

page is not in memory, a page fault occurs and the operating system loads it from the disk.

This improves efficiency by avoiding unnecessary loading of pages, thereby saving memory and

improving system responsiveness.

Advantages:

- Reduces memory usage

- Faster program start-up time

- Allows more processes to be in memory simultaneously

Disadvantage:

- Can cause page faults, which slow down execution.


Q2. Differentiate between Logical Address Binding and Physical Address
Binding.

**Logical Address Binding** refers to the mapping of a program's logical addresses (also called

virtual addresses) to its actual physical addresses in memory.

| Basis | Logical Address | Physical Address |

|----------------------|------------------------------|--------------------------------|

| Definition | Generated by the CPU | Location in physical memory |

| Visibility | Used by programs and users | Used by the memory unit |

| Binding Time | Done during compilation or execution | Resolved at runtime by MMU |

| Example | 0x0040 (virtual) | 0x1A040 (physical) |

Operating systems use **Memory Management Unit (MMU)** to perform this translation.

Q3. What is thrashing?

**Thrashing** occurs when the operating system spends most of its time swapping pages in and out

of memory rather than executing actual processes. It happens when there is too little memory and

too many processes are active, each requiring frequent page replacement.

Signs of thrashing:

- High page fault rate

- CPU utilization drops

- System becomes slow and unresponsive


Solution:

- Reduce number of active processes

- Increase RAM

- Use better page replacement algorithms

Q4. Define page replacement.

**Page Replacement** is the process of swapping out a page from main memory to make room for a

new page when memory is full. This occurs during demand paging when a page fault happens, and

there is no free space in memory.

The OS must choose which page to remove, using **page replacement algorithms** like:

- FIFO (First In First Out)

- LRU (Least Recently Used)

- Optimal Algorithm

Goal: Minimize the number of page faults and improve performance.

Q5. Explain various file operations in file management.

File management in OS allows programs and users to store and retrieve data from storage devices.

Common file operations include:

1. **Create**: Make a new file and allocate space.


2. **Open**: Load file metadata for access.

3. **Read**: Transfer data from file to memory.

4. **Write**: Store data from memory to file.

5. **Close**: Save changes and release resources.

6. **Delete**: Remove the file and free space.

7. **Rename**: Change file name.

8. **Seek**: Move the file pointer to a specific location.

Each of these operations is essential for managing files effectively in an OS.

Q6. Explain any one page replacement algorithm.

**LRU (Least Recently Used)** Page Replacement Algorithm:

LRU replaces the page that has not been used for the longest time. It assumes that pages used

recently will likely be used again soon.

Steps:

1. Maintain a list of pages with most recently used at the top.

2. When a page needs replacement, remove the least recently used one.

Example:

Pages: [1, 2, 3, 4, 2, 1, 5, 2]

Memory: 3 frames
Result: Replace the page that hasnt been used for the longest.

Advantage: Better than FIFO in many cases

Disadvantage: Costly to implement in hardware

Q7. What is memory management? Explain paging in detail.

**Memory Management** is a function of the OS that handles the allocation and deallocation of

memory spaces to processes.

It ensures efficient use of memory, protects memory space, and enables multitasking.

**Paging**:

Paging is a memory management scheme that eliminates the need for contiguous allocation of

physical memory. It divides physical memory into fixed-size blocks called frames, and logical

memory into blocks of the same size called pages.

When a process is executed, its pages are loaded into any available memory frames.

Advantages:

- Avoids external fragmentation

- Efficient and easy memory allocation

Disadvantage:

- May cause internal fragmentation

■› ■■ ■„■■■■ ■] ■v ■P ■Ç■’■■■■ ■u ■µ ■■ ■’■■ ■] ■} ■v ■’ ■■ ■v ■ˆ


■v ■’■Á■■ ■„■’

Pa r t1 Que sti ons

1.

Q1. L i s t an y fourfun ct i on s of Op erat in g Sys t em.

A n sw er: Op erat i ng syst ems p erform t he follow i n g fun ct i on s : Proces s M an ag emen t , M


emory

M an ag emen t , F i le M an ag emen t , Devi ce M an ag emen t .

2.

Q2. Wh at are

s oft w are t yp es ? Name it s t yp es .

A n sw er: Soft w are t yp es i n clud e Syst em Softw are an d A pp li cat i on Soft w are. Syst em

s oft w are in clud es OS , comp i lers , et c. A p p li cat i on soft w are in clud es M S Word , Excel, et c.
3.

Q3. Di fferen ce bet w een Preemp t i ve & Non

Preemp t i ve Sch

ed uli n g .

A n sw er: Preemp t i ve Sched uli n g allow s in t errup t i on of t as ks, w hereas Non

Pre emp t i ve run s

t o comp let i on . Exa mp les : R oun d R obi n (p reemp t i ve) , F CF S ( n on

p reemp t i ve) .

4.

Q4. Defi n e PCB.

A n sw er: PCB st and s forProces s Con t rol Block. It st ores p roces s in for

mat i on li ke Proces s ID,


S t at e, R eg i st ers , et c.

5.

Q5. Exp l ai n Ti me Shari n g Syst em an d Di st ri but ed S ys t em.

A n sw er: Ti me Shari n g Syst em allow s mult i p le us ers t o us e t he syst em si mult an eous ly .

Di s t ri but ed S ys t em con s i st s of mult i p le comp ut ers that commun i cat e an

d coord i n at e.

6.

Q6. Defi n e Pro ces s . Exp l ai n vari ous st at es of p roces s .

A n sw er: A p roces s is a p rog ram in execut i on . St at es : New , R ead y, R un n i n g , Wai t in g ,

Termi n at ed .

7.

Q7. Exp l ai n an y fi ve CPU Sched uli n g alg ori t hms .


A n sw er: Examp les in clud e F CF S , SJF , Pri ori t y

S cheduli n g , R oun d R obi n ,M ult i level Qu eue ,

et c.

Pa r t2 Que sti ons

8.

Q1. Wh at is d eman d p agi n g ?

A n sw er: Deman d p ag i n g i s a memory man ag em en t scheme w h ere p ag es are lo ad ed on ly

w hen n eed ed .

9.

Q2. Di fferen t i at e bet w een L og i cal ad d res s bi nd i ng an d Phys i cal


ad d res s

bin d in g .

A n sw er: L og i cal ad d res s is g en erat ed by CPU , p hys i cal is act ua l lo cat i on in memory. Bi n
ding
map s log i cal t o p hys i cal .

10.

Q3. Wh at is t hras hi n g ?

A n sw er: Thras hi n g occurs w hen t oo much t i me is sp en t sw app in g p ag es i n an d out of

memory.

11.

Q4. Defi n e p ag e

rep l acem en t .

A n sw er: Pag e rep lace men t rep laces o ld p ag es w i t hn ew on es w hen memory is full.

A lg ori t hms in clud e F IFO, L R U , et c.

12.

Q5. Exp l ai n vari ous fi le op er at i on s in fi le man ag eme n t .


A n sw er: F i le op erat i on s in clud e creat e, op en , re ad , w ri t e, clos e, d el et e

13.

Q6. Exp l ai n an y on e p ag e rep lac emen t alg ori t hm.

A n sw er: F IF O( F i rs t

In

F i rst

Out ) alg ori t hm rep laces t he old es t p ag e in memory.

14.

Q7. Wh at is memory man ag em en t ? Exp lai n p ag i n g in d et ai l.


A n sw er: M emory man ag emen t han d les al loc at i on of memory. Pag i n g

d i vid es memory in t o

fi xed

s i ze p ag es and frames .

Operating System - Detailed Answers

PART A - Short Answer Questions

(a) List any four operations of Operating System.

The four fundamental operations of an Operating System (OS) are:

1. **Process Management**: The OS manages processes in a system including process scheduling,

creation, termination, and synchronization.

2. **Memory Management**: It keeps track of each byte in a computer's memory and manages

allocation and deallocation.

3. **File System Management**: The OS manages data storage using file systems including access,

storage, retrieval, naming, and protection.

4. **Device Management**: It manages device communication via their respective drivers and

provides a way to perform I/O operations.

(b) What are Real Time Systems?


Real-Time Systems are computing systems that must respond to inputs or events within a strict

timing constraint. These systems are used where timely execution is critical. There are two types:

1. **Hard Real-Time Systems**: Systems that must meet deadlines without fail (e.g., flight control

systems).

2. **Soft Real-Time Systems**: Missing deadlines is tolerable to a limited extent (e.g., multimedia

systems).

(c) What is SJF scheduling?

SJF (Shortest Job First) is a CPU scheduling algorithm that selects the process with the shortest

execution time. It is a non-preemptive algorithm.

**Advantages**:

- Minimizes average waiting time.

**Disadvantages**:

- May cause starvation for longer processes.

- Not suitable if job lengths are unknown.

(d) List various scheduling queues.

The types of scheduling queues are:

1. **Job Queue**: All processes in the system.

2. **Ready Queue**: All processes in main memory, ready and waiting to execute.
3. **Device Queue**: Processes waiting for an I/O device.

4. **Waiting Queue**: Processes that are in the waiting state for a particular event.

(e) What is segmentation?

Segmentation is a memory management scheme that divides the process into segments based on

logical divisions like functions, objects, or data. Each segment has a segment number and offset. It

simplifies handling growing data structures and improves protection and sharing.

(f) Define Demand Paging.

Demand Paging is a memory management scheme where pages are not loaded into memory until

they are required. It reduces memory usage and improves performance by loading only the

necessary pages.

(g) What is page fault?

A page fault occurs when a program tries to access a page that is not currently in main memory.

The OS then loads the required page from secondary storage to main memory, which can cause a

delay.

(h) What do you mean by user authentication?

User authentication is the process of verifying the identity of a user before granting access to the

system. Methods include passwords, biometrics, and two-factor authentication.


(i) List any four file operations.

Four file operations are:

1. Create

2. Read

3. Write

4. Delete

(j) What is system call?

A system call is a way for programs to interact with the Operating System. It provides services such

as file manipulation, process control, and communication. Examples include fork(), exec(), read(),

and write().

PART B - Long Answer Questions

Q.2 What is Operating System? Explain various functions of operating


systems.

An Operating System (OS) is a system software that acts as an intermediary between users and

computer hardware. It provides an environment in which users can execute programs in a

convenient and efficient manner.

**Functions of Operating System**:

1. **Process Management**: Handles creation, scheduling, and termination of processes.


2. **Memory Management**: Manages physical and virtual memory allocation.

3. **File System Management**: Organizes data into files and directories.

4. **Device Management**: Coordinates and assigns input/output devices.

5. **Security and Protection**: Ensures data security and user authentication.

6. **User Interface**: Provides CLI or GUI for user interaction.

7. **Networking**: Allows sharing of resources over networks.

8. **Job Scheduling**: Decides the order of task execution.

The OS ensures efficient and secure system operation, resource utilization, and user-friendly

interfaces.

Q.3 Explain the concept of Paging in Memory Management schemes.

Paging is a memory management scheme that eliminates the need for contiguous allocation of

physical memory. It breaks both physical and logical memory into fixed-size blocks called frames

and pages, respectively.

**How it works**:

- Logical memory is divided into pages.

- Physical memory is divided into frames.

- A page table is maintained which maps pages to frames.

- When a process is to be executed, its pages are loaded into any available memory frames.
**Advantages**:

- Avoids external fragmentation.

- Simplifies memory allocation.

**Disadvantages**:

- Can lead to internal fragmentation.

- Increases overhead due to page table management.

**Page Faults**: Occur when the required page is not in memory. OS brings the page from

secondary memory causing delay.

Paging ensures efficient use of memory and better performance in multiprogramming systems.

Q.4 Explain various CPU Scheduling algorithms.

CPU Scheduling algorithms determine which process runs at a given time. Major types include:

1. **First-Come, First-Served (FCFS)**:

- Executes in order of arrival.

- Simple but can cause long waiting times.

2. **Shortest Job First (SJF)**:

- Executes the shortest process next.

- Optimal for minimizing average waiting time but suffers from starvation.

3. **Round Robin (RR)**:


- Time-sharing algorithm giving each process a fixed time quantum.

- Ensures fairness, suitable for time-sharing systems.

4. **Priority Scheduling**:

- Each process has a priority; higher priority executed first.

- Can lead to starvation of low-priority processes.

5. **Multilevel Queue Scheduling**:

- Processes are classified into queues based on priority or type.

- Different queues may use different scheduling algorithms.

Each algorithm has specific use-cases based on the system requirements and goals.

Q.5 What is file and directory? Explain various file access methods and file
operations.

**File**: A collection of related data stored on secondary storage. It has a name and attributes.

**Directory**: A special type of file that contains information about other files and directories.

**File Access Methods**:

1. **Sequential Access**: Data is accessed in a linear order. Common for text files.

2. **Direct Access**: Data can be read/written randomly. Used in databases.

3. **Indexed Access**: Uses an index to jump to data blocks. Efficient for large files.

**File Operations**:

1. **Create**: Make a new file.


2. **Open**: Prepare file for access.

3. **Read**: Retrieve data from file.

4. **Write**: Store data in file.

5. **Delete**: Remove file.

6. **Rename**: Change file name.

7. **Seek**: Move file pointer.

Proper file management is essential for efficient data storage and retrieval.

Q.6 Explain various security measures used for operating system.

Operating Systems employ various security measures to protect data and system resources:

1. **User Authentication**: Validates identity using passwords, biometrics, etc.

2. **Access Control**: Ensures that only authorized users can access specific resources.

3. **Encryption**: Secures data by converting it into unreadable form unless decrypted.

4. **Firewalls**: Monitor and control network traffic to prevent unauthorized access.

5. **Audit Logs**: Maintain records of user activity for accountability.

6. **Anti-virus and Malware Protection**: Prevents malicious software attacks.

7. **System Updates**: Regular patching to fix vulnerabilities.

These measures ensure confidentiality, integrity, and availability of the system.

You might also like