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

Os Mid-2 2 Marks Answers

The document covers key concepts in operating systems, including process synchronization, deadlock, semaphores, virtual memory, demand paging, and file management. It defines critical terms and techniques, compares different methods of resource allocation, and outlines various algorithms related to disk scheduling and memory management. Additionally, it discusses file attributes, directory structures, and access control mechanisms.

Uploaded by

PAVANKUMAR KOTNI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Os Mid-2 2 Marks Answers

The document covers key concepts in operating systems, including process synchronization, deadlock, semaphores, virtual memory, demand paging, and file management. It defines critical terms and techniques, compares different methods of resource allocation, and outlines various algorithms related to disk scheduling and memory management. Additionally, it discusses file attributes, directory structures, and access control mechanisms.

Uploaded by

PAVANKUMAR KOTNI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

OS UNIT-3 PART-B 2 MARKS

1 Define Process Synchronization.


A) Process Synchronization is a technique used in operating
systems to coordinate the execution of multiple processes,
ensuring that they can safely share resources without
conflicts or errors. It helps prevent issues like race conditions
and ensures data consistency.
2 Define Deadlock.
A) Deadlock is a situation in an operating system where two
or more processes are unable to proceed because each is
waiting for a resource held by another process. As a result, all
processes involved remain blocked forever.
3 Define semaphore and list different types of semaphores
and its operations.
A) Semaphore is a synchronization tool used to control access
to shared resources by multiple processes in a concurrent
system.
Types of Semaphores:
 Binary Semaphore (values 0 or 1)
 Counting Semaphore (values range over an unrestricted
domain)
Operations:
 Wait (P): Decreases the semaphore value.
 Signal (V): Increases the semaphore value.
4 Compare deadlock avoidance and deadlock prevention.
 A) Deadlock Prevention ensures that at least one
necessary condition for deadlock cannot occur by
designing the system accordingly.
 Deadlock Avoidance allows the system to check
resource allocation requests and only grant them if they
do not lead to a deadlock.

5 Define Monitor and give the schematic view of monitor


A) Monitor: A monitor is a synchronization construct that
allows safe access to shared resources by multiple threads. It
contains shared variables, procedures, and synchronization
mechanisms (like mutex locks and condition variables).
Schematic View of Monitor
------------------------------
| Monitor Name |
|----------------------------|
| Shared Variables |
| Procedures (Functions) |
| Synchronization Mechanism |

UNIT-4 2 MARKS
1 Define Virtual Memory.
A) Virtual Memory: Virtual memory is a memory
management technique where secondary storage (like a hard
disk) is used to extend the apparent size of main memory. It
allows programs to use more memory than physically
available by swapping data between RAM and disk.

2 Articulate the need of Demand Paging?


A) Need for Demand Paging: Demand paging reduces
memory usage by loading pages into memory only when they
are needed, rather than loading the entire program at once.
This improves system efficiency, saves RAM space, and allows
more programs to run simultaneously.
3 Outline lazy swapping?
A) Lazy Swapping: Lazy swapping is a memory management
technique where a process is loaded into main memory only
when it is needed, not at the start. Initially, only essential
parts are loaded; the rest are swapped in on demand during
execution.
4 Define Page Fault.
A) Page Fault: A page fault occurs when a program tries to
access a page that is not currently in main memory. The
operating system then loads the required page from
secondary storage (disk) into RAM to continue execution.
5 Define Thrashing.
A) Thrashing: Thrashing is a situation where the operating
system spends more time swapping pages in and out of
memory than executing actual processes. This occurs when
there is not enough physical memory to support the running
processes, leading to constant page faults and a significant
slowdown in system performance.
6 List out the different page replacement algorithms.
A) Page Replacement Algorithms:
1. First-In, First-Out (FIFO)
2. Least Recently Used (LRU)
3. Optimal Page Replacement (OPT)
4. Clock (Second Chance)
5. Least Frequently Used (LFU)
7 Summarize the advantages and disadvantages of
Contiguous memory allocation.
A) Advantages of Contiguous Memory Allocation:
1. Simplicity: Easy to implement and manage.
2. Fast Access: Direct access to memory locations,
improving performance.
Disadvantages of Contiguous Memory Allocation:
1. External Fragmentation: Over time, memory becomes
fragmented, leading to inefficient use.
2. Limited Flexibility: Processes must fit into contiguous
memory blocks, causing difficulties in dynamic memory
allocation.
8 List out the different HDD scheduling algorithms
A) Different HDD Scheduling Algorithms:
1. First-Come, First-Served (FCFS)
2. Shortest Seek Time First (SSTF)
3. SCAN
4. C-SCAN (Circular SCAN)
5. LOOK
6. C-LOOK (Circular LOOK)
9 Differentiate between page and frame
A) Difference Between Page and Frame:
Page Frame
A page is a fixed-size block A frame is a fixed-size block of
of virtual memory. physical memory (RAM).
Frames are part of the actual
Pages are part of the virtual
physical memory that holds the
address space of a process.
pages.
Frames are used to store pages
The size of a page is the
when they are loaded into
same as the size of a frame.
memory.
10 Summarize the advantages and disadvantages of FCFS
Disk Scheduling.
A) Advantages of FCFS Disk Scheduling:
1. Simplicity: Easy to implement and understand.
2. Fairness: Each request is processed in the order it
arrives.
Disadvantages of FCFS Disk Scheduling:
1. Inefficiency: Can lead to long waiting times, especially
for disk requests far from the current head position.
2. Poor Performance: It doesn’t optimize seek time,
leading to increased overall disk access time.
UNIT-5 2 MARKS
1 Define File. List different types of files.
A) File: A file is a collection of related data or information that
is stored on a storage device, such as a hard drive or SSD.
Files are used to store data for use by programs or users.
Different Types of Files:
1. Text Files: Contain readable text and are usually stored
in plain text format (e.g., .txt).
2. Binary Files: Contain data in a format that is not human-
readable, used by programs (e.g., .exe, .bin).
3. Image Files: Store graphic data in formats like JPEG,
PNG, GIF (e.g., .jpg, .png).
4. Audio Files: Store sound data (e.g., .mp3, .wav).
5. Video Files: Store video data (e.g., .mp4, .avi).
6. Executable Files: Contain machine code that can be run
as a program (e.g., .exe, .bat).
2 List different attributes of a file.
A) Different Attributes of a File:
1. Name: The identifier of the file used to access it.
2. Type: Specifies the format or content type of the file
(e.g., text, image, executable).
3. Location: The path or address where the file is stored.
4. Size: The amount of space the file occupies on storage.
5. Creation Date: The date and time the file was created.
6. Modification Date: The last date and time the file was
modified.
7. Access Control Information: Specifies who can read,
write, or execute the file.
8. Owner: The user or process that owns the file.
3 Predict different directory structures.
A) Different Directory Structures:
1. Single-Level Directory: All files are stored in a single
directory, making it simple but less efficient as the
number of files grows.
2. Two-Level Directory: Organizes files into a root directory
and a separate directory for each user, improving file
management and isolation.
3. Hierarchical Directory: Files are organized into a tree
structure with multiple levels of directories, allowing
better organization and scalability.
4. Acyclic-Graph Directory: Allows files to be shared
between directories, forming a graph structure with no
cycles, providing greater flexibility in file management.
5. General Graph Directory: A more complex structure
where files can be linked in a graph with cycles, allowing
even more complex relationships.

4 Differentiate Contiguous and Indexed file allocation


methods.
A) Difference Between Contiguous and Indexed File
Allocation Methods:
Contiguous Allocation Indexed Allocation
Files are stored in Files are stored in non-
contiguous blocks of contiguous blocks, with an index
memory. block pointing to the locations.
Allows flexibility with non-
Simple and fast access
contiguous storage, but requires
since all blocks are
additional overhead for
adjacent.
managing the index.
Can lead to external Avoids fragmentation but can
fragmentation. suffer from index block overhead.
Difficult to expand files Easier to grow files by adding
Contiguous Allocation Indexed Allocation
dynamically due to the
more blocks as needed.
need for contiguous space.

5 Interpret various operations performed on a file.


A) Various Operations Performed on a File:
1. Create: A new file is created and allocated space on
storage.
2. Open: A file is accessed, and a file descriptor is returned
to allow reading or writing.
3. Read: Data is read from a file into memory.
4. Write: Data is written to a file from memory.
5. Close: The file is closed, and system resources are
released.
6. Delete: The file is removed from storage, and the space
it occupied is freed.
7. Rename: A file is given a new name.
8. Append: Data is added to the end of an existing file
without overwriting its current contents.

6 Define Seek time.


A) Seek Time: Seek time is the time taken by a hard disk
drive's (HDD) read/write head to move to the track where the
data is located. It is a crucial factor in determining the overall
time required to access data on the disk.
7 Define Field and Record of a file.
A) Field:
A field is a single unit of data in a file, typically representing a
single attribute or piece of information (e.g., "Name," "Age,"
or "Salary").
Record:
A record is a collection of related fields that together describe
a specific entity or object. For example, a record might
represent a single employee and contain fields like "Employee
ID," "Name," and "Department."

8 Explain about Access matrix


A) Access Matrix: An access matrix is a security model used
to define and control the access rights of users to system
resources. It is represented as a matrix where:
 Rows represent subjects (users or processes).
 Columns represent objects (files, devices, etc.).
 Matrix cells contain the access rights (e.g., read, write,
execute) a subject has over an object.
9 Define protection and explain the need of protection
A) Protection: Protection refers to the mechanisms and
policies used to safeguard a computer system's resources
(such as files, memory, and processes) from unauthorized
access, modification, or destruction.
Need for Protection:
1. Security: Ensures that sensitive data is only accessible by
authorized users or processes.
2. Preventing Unauthorized Access: Protects against
malicious or accidental data corruption or theft.
3. System Integrity: Ensures that the system functions
correctly without being compromised by unauthorized
actions.
10 Differentiate Linked and Indexed file allocation methods.
A) Difference Between Linked and Indexed File Allocation
Methods:
Linked Allocation Indexed Allocation
Each file is a linked list of
Each file has an index block
blocks, where each block
that contains pointers to all the
contains a pointer to the next
data blocks of the file.
block.
Allows dynamic file size Allows direct access to file
growth, as new blocks can be blocks, improving access
added easily. speed.
Slower access, as blocks are Faster access since the index
not stored contiguously and block provides direct pointers
require following links. to data blocks.
Fragmentation can occur as Reduces fragmentation by
Linked Allocation Indexed Allocation
allocating non-contiguous
blocks are scattered
blocks, but the index block can
throughout the disk.
grow large.

You might also like