Important Questions: 2-Marks
Important Questions: 2-Marks
|| R-23
UNIT-2
2-Marks:
1. Define process.
2. List the process states
3. Define thread.
4. Define starvation
5. What is IPC.
6. Define pipe.
7. Compare user level thread and kernel level thread.
8. What is the use of race condition.
9. Define Turnaround time, waiting time, burst time.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
5/10 Marks
1. Define process. Draw a neat sketch of process life cycle.
2. Explain about Process Scheduling
3. Explain about IPC.
4. Define thread. What are the components of threads. explain about
multithreading models.
5. Write a short note on thread libraries.
6. Explain about multiple process scheduling
7. CPU Scheduling algorithms
1. FCFS 3.Priority
2.SJF 4. Round Robin
UNIT-3
2-Marks:
1. Define mutex
2. Define semaphore.
3. List the Deadlock Characterization.
4. What is the deadlock avoidance.
5. Define RAG.
6. Define synchronization.
7. What are the components in synchronization.
8. What are the different types of synchronization.
9. Compare wait & Signal in Semaphore.
5/10-Marks:
1. Explain about Critical section problem.
2. Define mutex. Elaborate mutex lock process.
3. Explain about semaphore with example.
4. Explain about classical problems in Synchronization.
i. Producer- Consumer Problem
ii. Dining-Philosopher Problem
iii. Readers-Writers Problem
iv. Sleeper-Writers Problem
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
5/10 -MARKS:
1. Define Paging .explain about paging with example.
2. What is Demand Paging. What are the steps involved in demand
padding. List the algorithms using in demand paging.
3. Page Replacement algorithms.
4. Disk Scheduling algorithms.
UNIT-5
2-Marks:
1. Define file system
2. List the directory information.
3. What are the different types of free space management.
4. Define protection.
5. List the advantages &Disadvantages of file system.
6. Define domain protection.
7. What are the types of security Authentication.
8. Define worm, virus, trojan horse.
5/10-Marks:
1. Explain about File system operations.
2. How to work directory implementation explain it.
3. What are the techniques used for Free space management.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Hints
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Unit-1
1. List and explain about Operating systems operations
Ans:
1. Process Management
o Process Scheduling:
o Process Creation and Termination
o Inter-Process Communication (IPC):
2. Memory Management
o Memory Allocation
o Memory Protection
o Virtual Memory
3. File System Management
o File Creation and Deletion
o File Access Control
o Storage Management
4. Device Management
o Device Drivers
o I/O Scheduling
5. User Interface
o User Commands
o System Feedback
6. Security and Access Control
o Authentication:
o Authorization
o Encryption
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
CreateProcess() fork()
Process Control ExitProcess() exit()
WaitForSingleObject() wait()
CreateFile() open()
ReadFile() read()
File Management
WriteFile() write()
CloseHandle() close()
SetConsoleMode() ioctl()
Device Management ReadConsole() read()
WriteConsole() write()
GetCurrentProcessID() getpid()
Information Maintenance SetTimer() alarm()
Sleep() sleep()
CreatePipe() pipe()
Communication CreateFileMapping() shmget()
MapViewOfFile() mmap()
Types of Booting:
UNIT-2
1. Define process. Draw a neat sketch of process life cycle.
Ans: A process is defined as an entity which represents the basic unit of work
to be implemented in the system.
1. Start
2. Ready
3. Running
4. wait
5. Terminated
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Short-Term Medium-Term
S.N. Long-Term Scheduler
Scheduler Scheduler
It is a process swapping
1 It is a job scheduler It is a CPU scheduler
scheduler.
Speed is in between
Speed is lesser than Speed is fastest
2 both short- and long-
short term scheduler among other two
term scheduler.
It provides lesser
It controls the degree of It reduces the degree of
3 control over degree of
multiprogramming multiprogramming.
multiprogramming
It is almost absent or
It is also minimal in It is a part of Time-
4 minimal in time sharing
time sharing system sharing systems.
system
Unit-3
1. Write a Petersson’s Solution details.
Ans: Peterson's solution is a classic algorithm used to address
the critical section problem in operating systems.
Key Principles of Peterson's Algorithm
Peterson's algorithm uses two shared variables:
1. flag: An array of Boolean values indicating whether a process
wants to enter its critical section.
2. turn: An integer variable indicating which process's turn it is
to enter the critical section.
Advantages and Disadvantages
Advantages:
• Mutual Exclusion: Ensures that only one process can be in the
critical section at a time.
• Simplicity: The algorithm is simple and easy to understand.
• No Deadlock: Eliminates the possibility of deadlock.
• Software-Based: Operates entirely in user mode and is
independent of hardware.
Disadvantages:
• Busy Waiting: Processes may spend a long time waiting for others
to exit the critical section, leading to inefficiency.
• Limited to Two Processes: The algorithm is designed for only
two processes.
• Not Suitable for Multi-CPU Systems: May not work correctly on
systems with multiple CPUs.
2.write a short note on Mutex Locks:
Mutex is very different from Semaphores.
1. Mutex is Binary in nature
2. Operations like Lock and Release are possible
3. Mutex is for Threads, while Semaphores are for processes.
4. Mutex works in user-space and Semaphore for kernel
5. Mutex provides locking mechanism
6. A thread may acquire more than one mutex
7. Binary Semaphore and mutex are different
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
• Process Synchronization
• Resource Management
• Reader-Writer Problem
• Avoiding Deadlocks
A mutex can only be modified by the Semaphore work with two atomic
process that is requesting or operations (Wait, signal) which can
releasing a resource. modify it.
Hold and Wait: A process can hold multiple resources and still request more
resources from other processes which are holding them. In the diagram given
below, Process 2 holds Resource 2 and Resource 3 and is requesting the Resource
1 which is held by Process 1.
No Pre-emption
A resource cannot be pre-empted from a process by force. A process can only
release a resource voluntarily. In the diagram below, Process 2 cannot preempt
Resource 1 from Process 1. It will only be released when Process 1 relinquishes
it voluntarily after its execution is complete.
Circular Wait
A process is waiting for the resource held by the second process, which is waiting
for the resource held by the third process and so on, till the last process is waiting
for a resource held by the first process. This forms a circular chain.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Unit-4
1. Define Paging .Explain about paging with example.
Ans: Paging is a storage mechanism used to retrieve processes from the
secondary storage into the main memory in the form of pages.
• The main idea behind the paging is to divide each process in the form of
pages. The main memory will also be divided in the form of frames.
Example
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Let us consider the main memory size 16 Kb and Frame size is 1 KB therefore the
main memory will be divided into the collection of 16 frames of 1 KB each.
There are 4 processes in the system that is P1, P2, P3 and P4 of 4 KB each.
Each process is divided into pages of 1 KB each so that one page can be stored in
one frame.
• Page Replacement
• Page Cleanup
Common Algorithms Used for Demand Paging in OS
Demand paging is a memory management technique that loads parts of a
program into memory only when needed.
❖ FIFO (First-In-First-Out
❖ LRU (Least Recently Used
❖ LFU (Least Frequently Used
❖ MRU (Most Recently Used
Page Replacement
In an operating system that uses paging for memory management, a page
replacement algorithm is needed to decide which page needs to be replaced when
a new page comes in. Page replacement becomes necessary when a page fault
occurs, and no free page frames are in memory.
• First In First Out (FIFO)
• Optimal Page replacement
• Least Recently Used (LRU)
• Most Recently Used (MRU)
Thrashing
• Thrashing occurs when the system is in a constant state of high paging
activity, where it’s spending more time swapping pages in and out of
memory than executing actual tasks. This results in a cycle of excessive page
faults, poor response times, and decreased overall system efficiency.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
o
1. FCFS (First Come First Serve)
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
FCFS is the simplest of all Disk Scheduling Algorithms. In FCFS, the requests are
addressed in the order they arrive in the disk queue.
Let us understand this with the help of an example.
Advantages of FCFS
Here are some of the advantages of First Come First Serve.
• Every request gets a fair chance
• No indefinite postponement
Disadvantages of FCFS
Here are some of the disadvantages of First Come First Serve.
• Does not try to optimize seek time
• May not provide the best possible service
SCAN Algorithm
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the
Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.
Therefore, the total overhead movement (total distance covered by the disk
arm) is calculated as
= (199-50) + (199-16) = 332
4. C-SCAN
In the SCAN algorithm, the disk arm again scans the path that has been scanned,
after reversing its direction. So, it may be possible that too many requests are
waiting at the other end or there may be zero or few requests pending at the
scanned area.
These situations are avoided in the CSCAN algorithm in which the disk arm
instead of reversing its direction goes to the other end of the disk and starts
servicing the requests from there. So, the disk arm moves in a circular fashion
and this algorithm is also like the SCAN algorithm hence it is known as C-SCAN
(Circular SCAN).
Example:
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Circular SCAN
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the
Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.
So, the total overhead movement (total distance covered by the disk arm) is
calculated as:
=(199-50) + (199-0) + (43-0) = 391
5. LOOK
LOOK Algorithm is similar to the SCAN disk scheduling algorithm except for the
difference that the disk arm in spite of going to the end of the disk goes only to
the last request to be serviced in front of the head and then reverses its direction
from there only. Thus it prevents the extra delay which occurred due to
unnecessary traversal to the end of the disk.
Example:
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
LOOK Algorithm
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the
Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.
So, the total overhead movement (total distance covered by the disk arm) is
calculated as:
= (190-50) + (190-16) = 314
6. C-LOOK
As LOOK is similar to the SCAN algorithm, in a similar way, C-LOOK is similar to
the CSCAN disk scheduling algorithm. In CLOOK, the disk arm in spite of going
to the end goes only to the last request to be serviced in front of the head and
then from there goes to the other end’s last request. Thus, it also prevents the
extra delay which occurred due to unnecessary traversal to the end of the disk.
Example:
1. Suppose the requests to be addressed are-82,170,43,140,24,16,190.
And the Read/Write arm is at 50, and it is also given that the disk arm
should move “towards the larger value”
C-LOOK
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Unit-5
1.Explain about File system Operations with suitable example?
Ans:
File Operation Description System Calls / APIs
• open() (Linux-like
Create a new file for
Creating Files systems)
data storage.
• CreateFile() (Windows)
1. Bitmap
2. Linked list
3. Grouping
4. Counting
1. Bitmap
This technique is used to implement the free space management. When the free
space is implemented as the bitmap or bit vector then each block of the disk is
represented by a bit. When the block is free its bit is set to 1 and when the block
is allocated the bit is set to 0.
The calculation of the block number is done by the formula:
(number of bits per words) X (number of 0-value word) + Offset of first 1 bit
For Example: Apple Macintosh operating system uses the bitmap method to
allocate the disk space.
Assume the following are free. Rest is allocated:
Example
Consider a disk where blocks 2, 3, 4, 5are free and the rest of the blocks are
allocated. The free-space bitmap would be: 010011100101
2. Linked List
This is another technique for free space management. In this linked list of all
the free block is maintained. In this, there is a head pointer which points the
first free block of the list which is kept in a special location on the disk.
3. Grouping
This is also the technique of free space management. In this, there is a
modification of the free-list approach which stores the address of the n free
blocks. In this the first n-1 blocks are free, but the last block contains the
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
4. Counting
Counting is another approach for free space management. Generally, some
contiguous blocks are allocated but some are free simultaneously.
5. Explain about file sharing system any Two types.
Ans: File Sharing
File Sharing in an Operating System(OS) denotes how information and files are
shared between different users, computers, or devices on a network.
Terminology Related to File Sharing
• Folder/Directory: It is basically like a container for all of our files on a
computer.
• Networking: It is involved in connecting computers or devices where we
need to share the resources.
• IP Address: It is numerical data given to every connected device on the
network
• Protocol: It is given as the set of rules which drives the communication
between devices on a network. In the context of file sharing, protocols
define how files are transferred between computers.
• File Transfer Protocol (FTP): FTP is a standard network protocol used
to transfer files between a client and a server on a computer network.
Various Ways to Achieve File Sharing
1. Server Message Block (SMB)
SMB is like a network-based file sharing protocol mainly used in windows
operating systems. It allows our computer to share files/printer on a network.
SMB is now the standard way for seamless file transfer method and printer
sharing.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
Note 1.
1. Read the Questions Once or Twice. After that u can write the
Answers.
2. Write the 2 marks questions answers either first or last (if order
missed also, no problem) 10 questions one place.
4. 1st Write Which question answer you know Clearly & Clarity.
5.For suppose any Question you don't the answer, you can write
what
question you learn but keep Question number same.
6. Use Glitter pens or Different colours for key points and side
headings.
11.Don’t take chits for exams. Suppose they can find means its
Malpractice.