0% found this document useful (0 votes)
20 views6 pages

Os (Written)

Uploaded by

elbendarysherif4
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)
20 views6 pages

Os (Written)

Uploaded by

elbendarysherif4
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/ 6

1-What is process spawning?

It is the act of creating a new process (Child Process) by an existing


process (Parent Process). This mechanism is used in multitasking
systems to execute tasks concurrently.

2-List four characteristics of a suspended process.


 Not executing
 Resides in secondary storage
 Can be resumed
 Dependent on an external event

3-For what types of entities does the OS maintain tables of


information for management purposes?
 Processes
 Memory
 Files
 Devices
 Users
 Threads
 Resources (e.g., semaphores, mutexes)
4-What are the elements of a process image?
 Program Code (Text Segment)
 Program Counter (PC)
 Process Stack
 Data Section
 Heap
 Process Control Block (PCB)
 File Descriptors
5-What are the steps performed by an OS to create a new
process?
 Assign a Process ID (PID)
 Allocate Memory
 Create Process Control Block (PCB)
 Load Program into Memory
 Set Process State
 Update Process Table
 Assign Resources
 Schedule the Process
6-What is the difference between an interrupt and a trap?
 Interrupt:

 Triggered by hardware events.


 Asynchronous.
 Can be masked or ignored.

 Trap:

 Triggered by software events


 Synchronous.
 Cannot be ignored.

7-Give three examples of an interrupt?


 Timer Interrupt
 Keyboard Interrupt
 Disk I/O Interrupt
8- What is the difference between a User mode and a Kernel mode?

 User Mode:

 Limited access to system resources.


 User applications run in this mode.
 Cannot directly execute privileged instructions.

 Kernel Mode:

 Full access to system resources.


 Operating system runs in this mode.
 Can execute all instructions, including privileged ones.

9- In a fixed partitioning scheme, what are the advantages of


using unequal-size partitions?
1. Better Memory Utilization
2. Reduced Internal Fragmentation
3. Support for Larger Processes

10 What is the difference between internal and external


fragmentation? How we solve each of them?
 Internal Fragmentation:

 Occurs when allocated memory is larger than the requested memory, leaving
unused space within a partition.
 Solution: Use smaller or variable-sized partitions, or use paging.

 External Fragmentation:

 Occurs when free memory is scattered in small blocks, making it difficult to


allocate contiguous memory.
 Solution: Use compaction or paging techniques.
11. list the types of placement Algorithms?
1. First-Fit
2. Best-Fit
3. Worst-Fit
4. Next-Fit
5. Buddy System

12. What is the difference between a page and a frame?


 Page:

 A fixed-size block of logical memory in a virtual memory system.

 Frame:

 A fixed-size block of physical memory in RAM that can hold a page.

13. Identify the advantages and disadvantages of preemptive


scheduling?

Advantages of Preemptive Scheduling:

1. Better responsiveness for interactive tasks.


2. Ensures fair distribution of CPU time.
3. Prevents a single process from monopolizing the CPU.
4. Improves system utilization by quickly switching between processes.

Disadvantages of Preemptive Scheduling:

1. Increased context switching overhead.


2. Potential for more complex synchronization and resource management.
3. Can lead to starvation for low-priority processes.
4. Higher system complexity due to frequent state saving and restoring.
14- Briefly define FCFS scheduling?
FCFS (First-Come, First-Served) Scheduling:

 A non-preemptive algorithm.
 Processes are executed in the order they arrive in the ready queue.
 The first process to arrive is the first to execute.
 The CPU is allocated to processes without interruption until they complete.

15. Briefly define round-robin scheduling?

Round-Robin Scheduling:

 A preemptive algorithm.
 Each process is assigned a fixed time slice (quantum).
 The CPU is allocated in a circular order.
 When a process’s time slice expires, it moves to the back of the queue.
 This continues until all processes are completed.

16. Briefly define shortest job first scheduling?

Shortest Job First (SJF) Scheduling:

 A non-preemptive algorithm.
 The process with the shortest burst time (execution time) is executed first.
 If two processes have the same burst time, they are scheduled in arrival
order.
 Minimizes average waiting time but can lead to "starvation" of longer
processes.
17. What is the difference between preemptive and non-preemptive
scheduling?

Preemptive Scheduling:

 The CPU can be taken from a running process before it completes, allowing
another process to run.
 Provides better responsiveness and fair distribution of CPU time.
 Example: Round-Robin, Preemptive Shortest Job First (SJF).

Non-Preemptive Scheduling:

 Once a process starts execution, it runs to completion or until it voluntarily


gives up the CPU (e.g., via I/O).
 Simpler to implement but can lead to poor responsiveness and inefficient
CPU usage.
 Example: First-Come, First-Served (FCFS), Non-preemptive Shortest Job
First (SJF).

You might also like