0% found this document useful (0 votes)
11 views33 pages

Important Questions: 2-Marks

The document outlines important questions and topics related to Operating Systems, structured into five units covering key concepts such as OS characteristics, process management, synchronization, CPU scheduling, and file systems. Each unit includes both 2-mark and 5/10-mark questions, emphasizing definitions, explanations, and comparisons of various OS components and mechanisms. Additionally, it provides hints and detailed explanations of specific topics like system calls, IPC, mutexes, and semaphores.

Uploaded by

marvelaslam1417
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)
11 views33 pages

Important Questions: 2-Marks

The document outlines important questions and topics related to Operating Systems, structured into five units covering key concepts such as OS characteristics, process management, synchronization, CPU scheduling, and file systems. Each unit includes both 2-mark and 5/10-mark questions, emphasizing definitions, explanations, and comparisons of various OS components and mechanisms. Additionally, it provides hints and detailed explanations of specific topics like system calls, IPC, mutexes, and semaphores.

Uploaded by

marvelaslam1417
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/ 33

PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE.

|| R-23

Operating system (23A035401T)


IMPORTANT QUESTIONS
UNIT-1
2-Marks:
1.Define OS. list the Characteristics of OS.
2.list the common OS’s?
3.why you are using computing Environments in OS.
4. List the Examples of Open-source OS’s?
5. differentiate CLI & GUI?
6.define System call. list the Linux System calls.
7.define debugging.
8. define system booting. list its types.
9. define kernel.
5/10 Marks
1. Define system calls. Explain Various types of system calls.
2. What are the different types of OS Structures explain any four.
3. List and explain OS Operations.
4. Define booting. list the booting types. Explain booting process.
5. Write a short note om OS system structure?

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.Explain about dead locks & types.


i. Deadlock Prevention
ii. Deadlock avoidance(Bankers Algorithm)
iii. Deadlock Detection & Recovery
UNIT-4
2 -MARKS:
1. Define paging
2. What is segmentation
3. Compare swap in, swap out.
4. Compare Internal Fragmentation & External Fragmentation.
5. Define Demand Paging.
6. Define COW.
7. Define Thrashing.
8. Define swapping. List its types.

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

4. Write a short note on


A). Security Authentication b).Threats to protection on
Security.

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

2. Explain about Computing Environments In Operating System?


Ans:
1. Personal Computing
Environment
2. Time Sharing Computing
Environment
3. Client Server Computing
Environment
4. Distributed Computing
Environment
5. Cloud Computing
Environment
6. Cluster Computing
Environment
3. Define system calls. Explain Various types of system calls.
Ans: A system call is a way for programs to interact with the operating system.

Types of System Calls


❖ Process Control
❖ File Management
❖ Device Management
❖ Information Maintenance
❖ Communication
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

Types of System Calls Windows Linux

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()

4. Explain about Operating system structure?


Ans: The operating system can be implemented with the help of various
structures.
Types of Operating Systems Structures
Depending on this, we have the following structures in the operating system:
• Simple Structure
• Monolithic Structure
• Micro-Kernel Structure
• Hybrid-Kernel Structure
• Exo-Kernel Structure
• Layered Structure
• Modular Structure
• Virtual Machines
5.Define booting. list the booting types. Explain booting process.
Ans: Booting is the process of starting a computer. It can be initiated by
hardware such as a button press or by a software command.
Sequencing of Booting
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

Types of Booting:

Booting Process in Operating System

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

2.Define schedulers. List and explain the different types of


schedulers.
Ans: Schedulers are special system software which handle process scheduling in
various ways.
Schedulers are of three types
• Long-Term Scheduler
• Short-Term Scheduler
• Medium-Term Scheduler

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

It selects processes It can re-introduce the


It selects those
from pool and loads process into memory
5 processes which are
them into memory for and execution can be
ready to execute
execution continued.
3.Explain about Inter-Process Communication(IPC)?
Ans: Inter Process Communication is a type of mechanism usually provided by
the operating system (or OS). The main aim or goal of this mechanism is to
provide communications in between several processes.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

0Synchronization in Interposes Communication


• Semaphore
• Mutual Exclusion
• Barrier
• Spinlock
4.Define thread. What are the components of threads. explain
about multithreading models.
Ans: A thread is a single sequence stream within a process. Threads are also
called lightweight processes as they possess some of the properties of processes.
Components of Threads
These are the basic components of the Operating System.
• Stack Space
• Register Set
• Program Counter
Types of Thread in Operating System
Threads are of two types. These are described below.
• User Level Thread
• Kernel Level Thread
Multithreading Models:
Multithreading allows the application to divide its task into individual threads.
In multi-threads, the same process or task can be done by the number of
threads.
Types:

o Many to one multithreading model


o One to one multithreading model
o Many to Many multithreading models
Many to one One to one Many to Many

5.Explain Types of CPU Scheduling Algorithms with examples


PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

1. First Come First Serve


2. Shortest Job First
3. Priority Scheduling
4. Round Robin Scheduling

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

These are several components of mutex locks:


• Lock: The core element that signals whether a resource is currently in
use
Status Indicators: Variables or flags indicating the state of the mutex,
whether it's locked or unlocked
Thread Synchronization Mechanisms: Protocols or methods ensuring
orderly access to the shared resource by multiple threads
Different Types of Mutex Locks in OS
There are several types of mutex locks that are designed for specific scenarios.
1.Binary Mutex Locks: Basic on/off locks that either allow or prevent access
2. Recursive Mutex Locks: Permits a thread to relock a resource it has
already locked
3.Adaptive Mutex Locks: Adjusts its behaviour based on the current system
conditions.
3. Explain about Semaphores with details.
Ans:
Wait: The wait operation decrements the value of its argument S, if it is
positive. If S is negative or zero, then no operation is performed.
wait(S)
{
while (S<=0);
S--;
}
Signal :The signal operation increments the value of its argument S.
signal(S)
{
S++;
}
Types of Semaphores
Binary Semaphore
Mutex lock is another name for binary Semaphore. It can only have two possible
values: 0 and 1, and its value is set to 1 by default.
Counting Semaphore
Counting Semaphore’s worth can be found anywhere in the world. It’s used to
restrict access to a resource with many copies.
Uses of Semaphores
• Mutual Exclusion
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

• Process Synchronization
• Resource Management
• Reader-Writer Problem
• Avoiding Deadlocks

4.Difference Between Mutex and Semaphore


Mutex Semaphore

A mutex is an object. A semaphore is an integer.

Mutex works upon the locking Semaphore uses signalling


mechanism. mechanism.

Operations on mutex: Operation on semaphore:


• Lock • Wait
• Unlock • Signal

Semaphore is of two types:


Mutex does not have any subtypes. • Counting Semaphore
• Binary Semaphore

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.

5. Write a short note on Classic problems of Synchronization


1. Bounded-buffer (or Producer-Consumer) Problem,
2. Dining-Philosophers Problem,
3. Readers and Writers Problem,
4. Sleeping Barber Problem
6. Explain about Deadlock Characterization:
Mutual Exclusion :There should be a resource that can only be held by one
process at a time. In the diagram below, there is a single instance of Resource 1
and it is held by Process 1 only.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

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

Methods for handling Deadlocks:


There are four approaches to dealing with deadlocks.
1. Deadlock Prevention
2. Deadlock avoidance (Banker's Algorithm)
3. Deadlock detection & recovery
4. Deadlock Ignorance (Ostrich Method)
7. Resource Allocation Graph (RAG) for Deadlock Detection
The resource allocation graph (RAG) is a popular technique for computer
system deadlock detection. The RAG is a visual representation of the processes
holding the resources and their current state of allocation. The resources and
processes are represented by the graph’s nodes, while their allocation
relationships are shown by the graph’s edges. A cycle in the graph of the RAG
method denotes the presence of a deadlock.
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.

2.What is Demand Paging. What are the steps involved in demand


padding. List the algorithms using in demand paging?
Ans: Demand paging is a memory management scheme used in operating
systems to improve memory usage and system performance.
The operating system‘s demand paging mechanism follows a few steps in its
operation.
• Program Execution
• Creating Page Tables
• Handling Page
• Page Fetch
• Resuming The Program
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

• 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

Advantages of Demand Paging


• Efficient use of physical memory
• Support for larger programs
• Faster programs start
• Reduce memory usage
Disadvantages of Demand Paging
• Page Fault Overload
• Degraded Performance
• Fragmentation
• Complexity

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

Disk Scheduling Algorithms


The list of various disks scheduling algorithm is given below. Each algorithm is
carrying some advantages and disadvantages. The limitation of each algorithm
leads to the evolution of a new algorithm.

o FCFS scheduling algorithm


o SSTF (shortest seek time first) algorithm
o SCAN scheduling
o C-SCAN scheduling
o LOOK Scheduling
o C-LOOK scheduling

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.

First Come First Serve


Example:
Suppose the order of request is- (82,170,43,140,24,16,190)
And current position of Read/Write head is: 50
So, total overhead movement (total distance covered by the disk arm) =
(82-50)+(170-82)+(170-43)+(140-43)+(140-24)+(24-16)+(190-16) =642

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

2. SSTF (Shortest Seek Time First)


In SSTF (Shortest Seek Time First), requests having the shortest seek time are
executed first. So, the seek time of every request is calculated in advance in the
queue and then they are scheduled according to their calculated seek time. As a
result, the request near the disk arm will get executed first. SSTF is certainly an
improvement over FCFS as it decreases the average response time and increases
the throughput of the system. Let us understand this with the help of an example.
Example:
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

Shortest Seek Time First


Suppose the order of request is- (82,170,43,140,24,16,190)
And current position of Read/Write head is: 50
So,
total overhead movement (total distance covered by the disk arm) =
(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-140)+(190-170) =208
Advantages of Shortest Seek Time First
Here are some of the advantages of Shortest Seek Time First.
• The average Response Time decreases
• Throughput increases
Disadvantages of Shortest Seek Time First
Here are some of the disadvantages of Shortest Seek Time First.
• Overhead to calculate seek time in advance
• Can cause Starvation for a request if it has a higher seek time as
compared to incoming requests
• The high variance of response time as SSTF favors only some requests
3. SCAN
In the SCAN algorithm the disk arm moves in a particular direction and services
the requests coming in its path and after reaching the end of the disk, it reverses
its direction and again services the request arriving in its path. So, this algorithm
works as an elevator and is hence also known as an elevator algorithm. As a
result, the requests at the midrange are serviced more and those arriving behind
the disk arm will have to wait.
Example:
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

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

Advantages of SCAN Algorithm


Here are some of the advantages of the SCAN Algorithm.
• High throughput
• Low variance of response time
• Average response time
Disadvantages of SCAN Algorithm
Here are some of the disadvantages of the SCAN Algorithm.
• Long waiting time for requests for locations just visited by disk arm

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

Advantages of C-SCAN Algorithm


Here are some of the advantages of C-SCAN.
• Provides more uniform wait time compared to SCAN.

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)

• mkdir() (Linux systems)


Creating Create a new directory
• CreateDirectory()
Directories for organizing files.
(Windows)

Open a file that you


• open() (Linux systems)
Opening Files already have open to
• CreateFile() (Windows)
read or write from.

Retrieve data from an • read() (Linux systems)


Reading Files
open file. • ReadFile() (Windows)

Store data in an open • write() (Linux systems)


Writing Files
file. • WriteFile() (Windows)

Renaming Files If you want to rename a • rename() (Linux systems)


and Directories file or directory,. • MoveFile() (Windows)

• unlink() (Linux systems)


• remove() (Linux systems)
Deleting Files Remove files or
• DeleteFile() (Windows)
and Directories directories.
• RemoveDirectory()
(Windows)

2. Explain about Free space management. Its types?


Free Space that is allocated to files must be managed and space which is not allocated
to any file must be managed.
Methods or Techniques to implement a free space list
There are some methods or techniques to implement a free space list. These are as
follows:
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

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

address of the n blocks.

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

SMB File Sharing


2. Network File System (NFS)
NFS is a distributed based file sharing protocol mainly used in Linux/Unix
based operating System. It allows a computer to share files over a network as if
they were based on local. It provides an efficient way of transfer of files between
servers and clients.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

NFS File Sharing


3. File Transfer Protocol (FTP)
It is the most common standard protocol for transferring of the files between a
client and a server on a computer network. FTPs supports both uploading and
downloading of the files, here we can download, upload and transfer of files
from Computer A to Computer B over the internet or between computer
systems.

FTP File Sharing


4. Cloud-Based File Sharing
It involves the famous ways of using online services like Google Drive, Drop Box
, One Drive ,etc. Any user can store files over these cloud services and they can
share that with others, and providing access from many users. It includes
collaboration in real time file sharing and version control access.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

3. Difference between Security and Protection


Security Protection
Ensures system safety from Controls system access to prevent
various threats. misuse.
Safeguard system resources and Restrict unauthorized access to
data. system resources.
Utilizes technical and procedural
Enforces access control mechanisms.
measures.
Prevents security risks and
Limits unauthorized actions.
vulnerabilities.
Enhances system resilience and Affects system performance and
trustworthiness. usability.
4. Threats to Protection and Security
A threat is a program that is malicious in nature and leads to harmful effects for
the system. Some of the common threats that occur in a system are −
Virus
Viruses are generally small snippets of code embedded in a system. They are
very dangerous and can corrupt files, destroy data, crash systems etc.
Trojan Horse
A trojan horse can secretly access the login details of a system. Then a malicious
user can use these to enter the system as a harmless being and wreak havoc.
Trap Door
A trap door is a security breach that may be present in a system without the
knowledge of the users. It can be exploited to harm the data or files in a system
by malicious people.
Worm
A worm can destroy a system by using its resources to extreme levels. It can
generate multiple copies which claim all the resources and don't allow any
other processes to access them.
Denial of Service
These types of attacks do not allow the legitimate users to access a system. It
overwhelms the system with requests so it is overwhelmed and cannot work
properly for another user.
PAPPI REDDY B. Tech, M. Tech (Ph. D) || Associate Professor || Dept. of CSE. || R-23

All the best dear students for your External Exams.

Way of Presentation is most important in External Exams.

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.

3.Something you can write in 2 marks answers don't leave the


questions.

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.

7.Draw Each and every page, page border.

8. Example Programs are more Important

9. Syntaxes are also more Important

10. Don't forget Hall Tickets.

11.Don’t take chits for exams. Suppose they can find means its
Malpractice.

12. Please stay in Exam Hall min 2.30min.

You might also like