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

Operating Systems Basics

Uploaded by

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

Operating Systems Basics

Uploaded by

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

OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

3A) explain in detail how process management and memory management activities are
handled in operating systems, and apply this understanding to describe their roles in
system performence.

Ans)

Process Management:

Process management involves the creation,execution,updation and termination of the


processes. It ensures that the CPU is being utilized efficiently and that processes are
not interfering with each other.

Key components are:

1. Process Scheduler: The scheduler determines the CPU run time for each
process.
2. Process State: Process transition between states: new, ready, waiting and
Terminated.
3. Inter Process Communication(IPC): Enables processes to share data to
coordinate activites.
4. DeadLock Handling: Prevents and resolves Deadlocks using techniques like
resource allocation.

Impact On System Performs:

• Efficient process scheduling decreases CPU idle times.


• Avoiding dealocks and manages priorities for smooth multitasking

Memory Management:

Memory management ensures the optimal use of System memory while providing
isolation and security for processes.

Key Components are:

Memory allocation: Divides memory between processes dynamically or statically.

Virtual Memory: Uses disk space as an extension of RAM, allowing larger programs to
run,

Memory Protection: Prevents process from accessing each others memory.

Garbage Collection: Reclaims unused memory.


OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

4A)Apply your knowledge to list the functionalities and types of operating systems,
and illustrate how each type contributes to system operations.

Ans)

Simple batch operating systems:

• Similar Types of jobs or process are batched together and exectute at a time.
• The Os is always in System memory(RAM).

• The computer operators can delay or prioritize different batches easily.

Multi-Programming Operating System:

• System picks and begins executing one job or process one after another.
• CPU is never idle, it keeps on processing.
• Increases CPU utilization.

Real Time Operating System:

• The time interval is required to process and respond to inputs is so small


that it control in real time.
• Gives maximum consumption of CPU and gives us more outputs.

Multi-Process Operating System:

• Consists of many process running parallelly that shares a common


physical memory.
OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

• It provides higher computing power and speed.


• Enhanced performance.

5A) apply bestfit,worstfit,and first fit memory management algorithms to describe their
approaches and provide appropriate examples to illustrste each concept.

Ans)

These algorithms are used in dynamic memory allocation to allocate memory blocks to
process in a way that minimizes fragmentation.

BestFit: Allocates the smallest available block that is large enough to satisfy the
request.

Fragmentation is less likely to happen, but long searching time.

Example:

Memory blocks: [100KB, 500KB, 200KB, 300KB, 600KB]


Processes to allocate: [212KB, 417KB, 112KB, 426KB]

Steps:

1. 212KB → Allocates from 300KB (smallest sufficient block). Remaining: [100KB,


500KB, 200KB, 88KB, 600KB]

2. 417KB → Allocates from 500KB. Remaining: [100KB, 83KB, 200KB, 88KB, 600KB]

3. 112KB → Allocates from 200KB. Remaining: [100KB, 83KB, 88KB, 88KB, 600KB]

4. 426KB → Allocates from 600KB. Remaining: [100KB, 83KB, 88KB, 88KB, 174KB]

WorstFit: Allocates the largest available block to the process, aiming to leave gap for
future allocation.

Small search times but prone to fragmentation

Example: Memory blocks: [100KB, 500KB, 200KB, 300KB, 600KB]


Processes to allocate: [212KB, 417KB, 112KB, 426KB]

Steps:

1. 212KB → Allocates from 600KB (largest block). Remaining: [100KB, 500KB,


200KB, 300KB, 388KB]
OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

2. 417KB → Allocates from 500KB. Remaining: [100KB, 83KB, 200KB, 300KB,


388KB]

3. 112KB → Allocates from 300KB. Remaining: [100KB, 83KB, 200KB, 188KB,


388KB]

4. 426KB → Cannot be allocated (no block large enough).

FirstFit: Allocates the first found memory block that is large enough to satisfy the
request.

Simple and fast but may cause fragmentation.

Example: Memory blocks: [100KB, 500KB, 200KB, 300KB, 600KB]


Processes to allocate: [212KB, 417KB, 112KB, 426KB]

Steps:

1. 212KB → Allocates from 500KB (first suitable block). Remaining: [100KB, 288KB,
200KB, 300KB, 600KB]

2. 417KB → Allocates from 600KB. Remaining: [100KB, 288KB, 200KB, 300KB,


183KB]

3. 112KB → Allocates from 288KB. Remaining: [100KB, 176KB, 200KB, 300KB,


183KB]

4. 426KB → Cannot be allocated (no block large enough).

Note: example are for understanding purposes, they are not required to learn.

2A)Illustrate the concept of lottery scheduling to a scenario with two process with one
has 75% of tickets and and the other has 25% of the tickets. Explain how this scheduling
would manage their execution.

Ans) Lottery Scheduling: It is a scheduling process that relies on lottery methods to


allocate CPU time. It works based on tickets and each process holds a number of
tickets and If the drawn lottery has the ticket number, that process gets CPU time.

Example:

For example,
OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

Process A has 75 tickets.(0 to 74).

Process b has 25tickets.(75 to 99).

The drawn Lottery has numbers (23(A),78(B),96(B),99(B))

Like this, the more both processes fight over the lotteries, the more process time they
get to their needed time.

2B) demonistrate your understanding of a process and process life cycle to summarize
their key stages and transitions.

Ans) Process: A process in computers is an instance of a program in execution.

Process Life Cycle: It describes the stages a process goes through from its creation to
termination.

Stages:

New(creation): The process is created and necessary resources are allocated.

Ready: The process is prepared for execution but waiting for the CPU. It is in the queue
managed by scheduler.

Running: The process is actively being executed on the CPU. Only one process per CPU
core can be in this state at any time.

Waiting(Blocked): The process is waiting for an event to happen. It is not eligible for CPU
time.

Terminated: The process is either completed or terminated by exernal signal. The OS


reclaims the resources.

2C) analyze the function of translation lookaside buffer(TLB) and interpret its impact on
memory management
OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

Ans)TLB is an specialized , Fast cache that stores the recent transitions between virtual
memory to physical memory(RAM) addresses. It is critical in systems that use Virtual
Memory .

Impact of TLB on Memory Management:

• Performance Improvement.
• Reducing page Table overhead.
• Impact on multi level page tables.
• Impact on cache performance.
• Scalability issues.

2D) Develop a detailed explanation of paging concept for memory management,


including an algorithm approach and a suitable example to illustrate the process.

Ans)

Paging is an scheme that eliminates the need for continuos allocation of Physical
memory, theirby avoiding fragmentation and making efficient use of memory.

It divides processe’s logical address and physical address into fixed size blocks, called
pages and frames respectively.

Types of Pagings:

Simple paging: A basic implementation of paging where physical memory is divided into
fixed size frames and logical address is divided into fized size pages.

Demand paging: Pages are loaded into memory only when they are needed.

Pure demand paging: not even a single page is loaded into memory when they are not
needed.
OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

1A)

Time sharing system: A system which multiple users share the computing resources of
by time slicing(servers or mainframes).

Distributed system: Multiple system work together to achieve a common goal.

1B)

Shell: Shell is a command line interface that allows users to type in commands to
control OS.

Shell Script: Writing a series of commands in a text file(codes) to automate tasks.

1C)

Preemptive scheduling: Each process has a pre defined CPU time.

Non Preemptive scheduling: A process keeps running until it completes or goes to


waiting state.

1D)

Virtual Memory:

Virtual Memory is using disk space as Main memory (RAM) which allows running large
programmes and better efficiency.

1E)

Splitting: It refers to the process of dividing large empty space into usable small blocks,
when there is a request for storage.

Coalescing: It is reverse process of splitting, it means merging of smaller blocks of


storage into large empty space.

1F)

Benefits:

Segmentation divides memory into logical units, making it easier for programmers to
access specific parts of memory.
OPERATING SYSTEMS SEM_ IN-1 THEORY QUESTIONS AND ANSWERS

Drawbacks:

Overtime, as segmentation is allocated and deallocated, very small gaps in memory


can happen which is not easily utilized.

You might also like