0% found this document useful (0 votes)
6 views7 pages

OS

The document outlines key concepts in operating systems, including conditions for deadlock, virtual memory, paging, CPU-bound and I/O-bound programs, scheduling criteria, free space management using the bitmap method, fragmentation, file operations, memory management techniques, directory structures, and file allocation methods. It describes four conditions for deadlock: mutual exclusion, hold and wait, no preemption, and circular wait. Additionally, it explains fixed and variable memory management, various directory structures, and the linked file allocation method.
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)
6 views7 pages

OS

The document outlines key concepts in operating systems, including conditions for deadlock, virtual memory, paging, CPU-bound and I/O-bound programs, scheduling criteria, free space management using the bitmap method, fragmentation, file operations, memory management techniques, directory structures, and file allocation methods. It describes four conditions for deadlock: mutual exclusion, hold and wait, no preemption, and circular wait. Additionally, it explains fixed and variable memory management, various directory structures, and the linked file allocation method.
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/ 7

 describe any four condition for deadlock in operating system-4M

1.Mutual Exclusion

 At least one resource must be held in a non-shareable mode. This means that only one process can
use the resource at any given time. If another process requests the same resource, it must wait until
the resource is released.
 Example: A printer (resource) can only be used by one process at a time, so if one process is using it,
others must wait.

2. Hold and Wait

 A process that is holding at least one resource is waiting to acquire additional resources that are
currently being held by other processes.
 Example: Process A holds a printer (resource) and is waiting for a scanner (another resource) that is
held by Process B. Process B, meanwhile, is holding the scanner and waiting for the printer.

3. No Preemption

 Resources cannot be forcibly taken away from processes holding them. Once a process holds a
resource, it cannot be preempted (i.e., taken from it by force) until it releases the resource
voluntarily.
 Example: If a process is holding a resource and is not finished with it, no other process or the
operating system can forcibly take it away, even if other processes are waiting for that resource.

4. Circular Wait

 A set of processes exist such that each process is waiting for a resource that is held by the next
process in the set, forming a circular chain.
 Example: Process A is waiting for a resource held by Process B, Process B is waiting for a resource
held by Process C, and Process C is waiting for a resource held by Process A. This creates a cycle
where no process can proceed.

 Virtual Memory-2M

Virtual memory is a memory management technique used by modern operating systems to give an
application the illusion of having access to a large, contiguous block of memory, even if the physical memory
(RAM) is limited. It allows programs to address more memory than is physically available by using a
combination of main memory (RAM) and disk storage (usually on a hard drive or SSD).

 Paging in Operating System-2M

Paging is a memory management scheme that eliminates the need for contiguous memory allocation. In
paging, the virtual memory is divided into fixed-size blocks called pages, while the physical memory is divided
into fixed-size blocks called frames. The size of a page is typically the same as the size of a frame.

 CPU-bound Program -2M


A CPU-bound program is a program whose performance is primarily limited by the speed of the CPU. These
programs spend most of their time performing calculations, processing data, or executing CPU-intensive
operations, rather than waiting for input or output operations.

2) I/O-bound Program

An I/O-bound program is a program whose performance is primarily limited by the speed of I/O operations,
such as reading or writing data to disk, interacting with network devices, or waiting for user input. These
programs spend much of their time waiting for data from I/O devices rather than performing intensive
calculations.

 state and explain four scheduling criateria -2M

1. CPU Utilization

 Definition: CPU utilization refers to the percentage of time the CPU is actively being used. The goal
is to keep the CPU as busy as possible to maximize system throughput.

2. Throughput

 Definition: Throughput is the number of processes completed (or jobs finished) per unit of time.

3. Turnaround Time

 Definition: Turnaround time is the total time taken from the submission of a process to its
completion. It includes both waiting time and execution time.

4. Waiting Time

 Definition: Waiting time is the total time a process spends in the ready queue waiting for CPU time,
excluding the time spent executing on the CPU.

 describe concept of free space management technique using bit map method-4M

Free Space Management: Bitmap Method

In an operating system, free space management refers to the technique used to track which blocks (or pages)
of storage are currently free (unallocated) and which are occupied (allocated). The primary goal of free space
management is to efficiently utilize storage space by minimizing fragmentation and ensuring that the system
can quickly allocate and deallocate storage blocks as needed.

Key Concepts of the Bitmap Method:

1. Bit Array Representation:


o A bitmap is an array of bits where each bit corresponds to a block of data on the disk.
o The length of the bitmap is equal to the number of blocks on the disk.
o The bit at position i indicates the status of the i-th block on the disk:
 0 means the block is free.
 1 means the block is allocated.
2. Structure:
o Suppose a disk has N blocks. The bitmap will have N bits.
o The bitmap is stored in memory or on disk itself, and the operating system refers to it when
performing block allocation or deallocation operations.

How It Works

1. Disk Layout and Bitmap Representation:


o Suppose a disk has 8 blocks. The status of each block is represented by a bit in the bitmap:

Block Number Status


Block 1 1 (Allocated)
Block 2 0 (Free)
Block 3 1 (Allocated)
Block 4 0 (Free)
Block 5 0 (Free)

The corresponding bitmap for this disk is:Bitmap: 10100101

 Advantages of the Bitmap Method

Simple and Efficient, Fast Allocation and Deallocation, Compact Representation, efficient Space Management

 Fragmentation in Operating Systems -2M

Fragmentation refers to the condition where storage space is used inefficiently, leading to wasted space. It
typically occurs when free memory or storage is divided into small, non-contiguous blocks, preventing
efficient allocation of resources. Fragmentation can affect both memory (RAM) and disk storage. There are
two main types of fragmentation:

1. Internal Fragmentation
2. External Fragmentation

1) Internal Fragmentation

Definition: Internal fragmentation occurs when the memory or storage block allocated to a process or file is
larger than the space required. As a result, the extra space within the allocated block remains unused, leading
to wasted space within the block.

2) External Fragmentation

Definition: External fragmentation occurs when free memory or storage is split into small, non-contiguous
blocks scattered across the system. Even though there may be enough total free space available to satisfy a
request, it cannot be allocated because the free space is fragmented into smaller blocks that are not
contiguous.

 list any 6 file operations in operating syatem -2M


1) Create
2) Open
3) Read
4) Write
5) Close
6) Delete

 Explain fixed and variable memory management in operating system-2M

1. Fixed Memory Management (Fixed Partitioning)

Definition: In fixed memory management, the memory is divided into fixed-size partitions before the system
starts running. Each partition is a specific, predefined size, and it can hold only one process at a time. The
number of partitions is fixed, and the system does not change the size of these partitions during execution.

2. Variable Memory Management (Dynamic Partitioning)

Definition: In variable memory management, the system allocates memory dynamically based on the size of
the process. The memory is divided into partitions that can vary in size, depending on the needs of the
processes. A process is allocated exactly as much memory as it requires, and the partitions are created and
managed as needed.

 draw and explain directory structure of a file system in terms of single level, two level and tree level

A directory is a container that is used to contain folders and files. It organizes files and folders in a
hierarchical manner. In other words, directories are like folders that help organize files on a computer. Just
like you use folders to keep your papers and documents in order, the operating system uses directories to
keep track of files and where they are stored. Different structures of directories can be used to organize these
files, making it easier to find and manage them.

1) Single-Level Directory

The single-level directory is the simplest directory structure. In it, all files are contained in the same
directory which makes it easy to support and understand.

 Advantages
1) Since it is a single directory, so its implementation is very easy.
2) If the files are smaller in size, searching will become faster.

2) Two-Level Directory

As we have seen, a single level directory often leads to confusion of files names among different users.
The solution to this problem is to create a separate directory for each user.

 Advantages

1) A security would be there which would prevent user to access other user’s
files.
2) Searching of the files becomes very easy in this directory structure.

3) Tree Structure/ Hierarchical Structure

Tree directory structure of operating system is most commonly used in our personal computers. User can
create files and subdirectories too, which was a disadvantage in the previous directory structures.

Advantages

1) This directory structure allows subdirectories inside a directory.


2) The searching is easier.

 draw the diagram of linked file allocation methods and explain it-4M
The allocation methods define how the files are stored in the disk blocks.

- There are three main disk space or file allocation methods.

1) Contiguous Allocation

2) Linked Allocation

3)Indexed Allocation

2. Linked List Allocation

-In this scheme, each file is a linked list of disk blocks which need not be contiguous. The disk blocks can be
scattered anywhere on the disk.

-The directory entry contains a pointer to the starting and the ending file block. Each block contains a
pointer to the next block occupied by the file.

-The file ‘jeep’ in following image shows how the blocks are randomly distributed. The last block (25)
contains -1 indicating a null pointer and does not point to any other block.

Linked

Advantages:

1) This is very flexible in terms of file size. File size can be increased easily
since the system does not have to look for a contiguous chunk of memory.
2) This method does not suffer from external fragmentation. This makes it
relatively better in terms of memory utilization.

Disadvantages:
3) Because the file blocks are distributed randomly on the disk, a large
number of seeks are needed to access every block individually. This makes
linked allocation slower.
4) It does not support random or direct access. We can not directly access the
blocks of a file.

You might also like