Os 2
Os 2

3. **Process Control Block (PCB)**: PCB is a data structure maintained by the operating system
for each process. It contains information about the process's state, including:
4. **Role of Process Scheduler**: The process scheduler is responsible for selecting which
process should run next on the CPU. Its role includes:
6. The term that describes saving the state of one process and restoring the state of another is
**context switching**. It involves saving the state of the currently executing process and loading
the saved state of another process to allow it to run.

9. On UNIX systems, the system call that creates a process is `fork()`. When a process creates
a new process using `fork()`, the following state is shared between the parent process and the
child process:
- **c. Shared memory segments**
10. The system call that terminates a process on UNIX systems is `exit()`.
- **Zombie Process**: A process that has completed execution but still has an entry in the
process table.
- **Orphan Process**: A child process whose parent process has terminated or ended
unexpectedly.
11. **Independent process** operates separately and does not share data or resources with
other processes. **Cooperating process** can share data and resources, allowing them to
communicate and synchronize. Cooperation is necessary for tasks such as resource sharing,
communication, and distributed computing.
13. The two bursts that CPU schedulers are designed around are:
- **CPU Burst**: The time a process spends executing on the CPU.
- **I/O Burst**: The time a process spends waiting for I/O operations to complete.
15. **Preemptive scheduling** allows the operating system to interrupt a process and allocate
the CPU to another process. **Nonpreemptive scheduling** does not allow such interruptions; a
process keeps the CPU until it voluntarily relinquishes it.
16.
a. **Average turnaround time for FCFS scheduling**:
Average Turnaround Time = ((0 + 8) + (8 + 4) + (12 + 1)) / 3 = 33 / 3 = 11 time units.