Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

OSY Question bank

2 marks
1. **Define:**
i. **Process:**
- A process is an instance of a computer program that is being executed by
one or many threads. It is an independent and dynamic entity that executes a set
of instructions within a computer system. A process has its own memory space,
resources, and state.

ii. **PCB (Process Control Block):**


- A Process Control Block is a data structure maintained by the operating
system to store information about a process. It contains details such as process
state, program counter, register values, memory allocation, and other relevant
information needed for process management.

2. **What is Process Management?**


- Process management involves the coordination and control of processes
within a computer system. It includes creating, scheduling, terminating, and
managing processes, as well as providing mechanisms for processes to
communicate and synchronize.

3. **Define Scheduler and state its types:**


- **Scheduler:** A scheduler is a component of the operating system
responsible for deciding which process/thread should run next. It determines the
order and priority of processes in the ready queue.
- **Types of Schedulers:**
1. **Long-Term Scheduler (Job Scheduler):** Selects which processes
should be brought into the ready queue for execution.
2. **Short-Term Scheduler (CPU Scheduler):** Selects which process
should be executed next and allocates CPU time.
4. **Define Thread and its advantages (any 2):**
- **Thread:** A thread is the smallest unit of a process, and it represents a
single sequence of execution within that process.
- **Advantages:**
1. **Concurrency:** Threads allow multiple tasks to be executed
concurrently within a process, improving overall system efficiency.
2. **Resource Sharing:** Threads within the same process share resources
such as memory space, which can lead to more efficient communication and
data sharing.

5. **What is Process Scheduling? State its objectives:**


- **Process Scheduling:** It is the mechanism used by the operating system
to manage the execution of processes. It involves selecting processes from the
ready queue and allocating the CPU to them.
- **Objectives:**
1. **Fairness:** Ensure fair allocation of CPU time among competing
processes.
2. **Efficiency:** Maximize CPU and system utilization.
3. **Throughput:** Maximize the number of processes completed in a
given time.

6. **What is non-preemptive scheduling?**


- Non-preemptive scheduling is a type of scheduling where a process cannot
be interrupted during its execution. Once a process starts running, it continues
until it completes or voluntarily yields the CPU. No other process can
preemptively force it to release the CPU.

7. **State scheduling criteria:**


- **Scheduling Criteria:**
1. **CPU Utilization:** Maximizing CPU usage for increased system
throughput.
2. **Throughput:** The number of processes completed per unit of time.
3. **Turnaround Time:** The total time taken to execute a process,
including waiting time and execution time.
4. **Waiting Time:** The total time a process spends waiting in the ready
queue.
5. **Response Time:** The time between submitting a request and
receiving the first response.

8. **Define Virtual Memory:**


- Virtual memory is a memory management technique that provides an
"idealized abstraction of the storage resources that are actually available on a
given machine" which creates the illusion to users of a very large (main)
memory.

9. **Define Physical Address:**


- A physical address refers to a specific location in the physical memory
(RAM) hardware of a computer. It is the actual location where data is stored in
the computer's memory.

10. **Describe any four file attributes:**


- **File attributes describe various properties and characteristics of a file.**
1. **Name:** The unique identifier or label given to the file.
2. **Size:** The amount of storage space occupied by the file.
3. **Timestamps:** Information about the last modification time, creation
time, and access time of the file.
4. **Permissions:** The set of rules that determine who can access the file
and what operations they can perform on it..
4 marks
1. **Process States and State Transitions:**
- **Process States:**
1. **New:** The process is being created.
2. **Ready:** The process is ready to execute but waiting for the CPU.
3. **Running:** The process is currently being executed.
4. **Blocked (Waiting):** The process is waiting for an event (e.g., I/O) to
complete.
5. **Terminated:** The process has finished execution.

- **Process State Transitions Diagram:**


![Process State Transitions Diagram](https://i.imgur.com/8y9tXzD.png)

2. **PCB (Process Control Block) with Diagram:**


- **PCB Diagram:**
![PCB Diagram](https://i.imgur.com/dkqN8Um.png)
- **Explanation:**
- The PCB contains information about the process, including process ID,
state, program counter, CPU registers, memory information, and other details
needed for process management.

3. **Differentiate between Long-Term and Short-Term Scheduler:**


- **Long-Term Scheduler (Job Scheduler):**
- **Function:** Selects processes from the job pool and loads them into the
ready queue.
- **Frequency:** Executes infrequently.
- **Goal:** Optimize overall system performance and throughput.

- **Short-Term Scheduler (CPU Scheduler):**


- **Function:** Selects processes from the ready queue and allocates CPU
time.
- **Frequency:** Executes frequently, in milliseconds.
- **Goal:** Optimize CPU utilization and response time.

4. **Explain Partitioning with its Types:**


- **Partitioning:** Memory partitioning involves dividing the physical
memory into fixed-size or variable-size partitions to accommodate multiple
processes.
- **Types:**
1. **Fixed Partitioning:**
- Memory is divided into fixed-size partitions.
- Each partition can hold one process.
- Inefficient for varying process sizes.
2. **Variable Partitioning:**
- Memory is divided into variable-size partitions.
- Can accommodate processes of different sizes.
- Requires dynamic memory management.

5. **Explain Free Space Management Techniques:**


- **Free Space Management:**
- Techniques to keep track of free and allocated memory space.
- **Techniques:**
1. **Bit Vector or Bitmap:**
- Each bit represents a block of memory.
- 0 indicates free, 1 indicates allocated.
2. **Linked List:**
- Maintain a linked list of free memory blocks.
- Each block points to the next free block.
3. **Buddy System:**
- Memory is split into blocks of powers of 2.
- Allocates and deallocates in blocks of size 2^n.

6. **Describe Sequential and Direct Access Methods:**


- **Sequential Access:**
- Data is accessed in a linear, sequential order.
- Suitable for tapes and files where data is accessed sequentially.
- **Direct Access (Random Access):**
- Data can be accessed directly, not necessarily in a sequential order.
- Suitable for disks and databases.
- Allows for quick retrieval of specific data using a direct address or key.

7. **Explain Linked File Allocation Method:**


- **Linked Allocation:**
- Each file is a linked list of disk blocks.
- File allocation table (FAT) stores pointers to the blocks.
- Supports dynamic file size changes.
- May lead to fragmentation and inefficient use of space.

These explanations provide a basic understanding of the concepts. For detailed


illustrations and further study, referring to textbooks or additional resources
would be beneficial.

8. Calculate average waiting time


using FCFS scheduling algorithm.

10.n Calculate average waiting time and turn around time using round robin
scheduling algorithm.
( time quantum = 2 )

11.Calculate average waiting time and turn around time using SJF scheduling
algorithm preemptive

12.Calculate average waiting time and turn around time using priority
scheduling algorithm.

You might also like