Unit 5
Unit 5
Types of OS
📘 Key Points:
Operating System: Software that manages hardware and software resources and
provides services to users and programs.
Main Functions:
o Process Management
o Memory Management
📝 Examples of Questions:
Batch OS
Multiprogramming OS
Time-sharing OS
Real-Time OS
Distributed OS
📘 Key Points:
Time-Sharing
Each task gets CPU for a small time slice Unix, Linux
OS
RTOS in embedded
Real-Time OS Responds to inputs immediately
systems
📝 Example Questions:
🔶 3. Process Management
Process States
Context Switching
Scheduling Algorithms
📘 Key Points:
Round Robin Time slice for each process Preemptive, good for time-sharing
📝 Formulas:
📝 Example Questions:
🔶 4. Memory Management
📘 Key Concepts:
Algorithm Strategy
📝 Example Questions:
🔶 5. Deadlock
📘 Key Concepts:
Necessary Conditions:
1. Mutual Exclusion
3. No Preemption
4. Circular Wait
📝 Example Questions:
🔶 6. File Systems
File organization
Directory structure
📘 Key Points:
Directory Structures:
o Single-level
o Two-level
o Tree
o Acyclic Graph
📝 Example Questions:
🔶 7. I/O Management
Interrupt handling
I/O techniques
📘 Key Concepts:
I/O Techniques:
o Programmed I/O
o Interrupt-Driven I/O
📝 Example Questions:
Access control
Authentication
Encryption basics
📘 Key Concepts:
An Operating System (OS) is a system software that acts as an interface between the user and
the hardware. It manages all computer resources such as CPU, memory, files, and devices.
✅ Key Functions:
✅ (ii) Time-Sharing OS
Example: UNIX.
Types:
✅ (iv) Distributed OS
🔶 3. Process Management
✅ What is a Process?
A process is a program in execution, including program code, data, and system resources.
✅ Process States:
sql
CopyEdit
Process ID
Program counter
CPU registers
Process state
Memory limits
✅ Context Switching:
The process of saving the state of the current process and loading the state of another process.
Necessary for multitasking.
Preemptive.
Time Quantum is crucial (too small = overhead; too large = behaves like FCFS).
✅ 4. Priority Scheduling
🟩 Example (FCFS):
P1 0 4
P2 1 3
P3 2 1
🔶 4. Memory Management
✅ Key Concepts:
➤ Contiguous Allocation:
➤ Paging:
No external fragmentation.
➤ Segmentation:
➤ Virtual Memory:
➤ Thrashing:
✅ 1. FIFO:
Removes page that hasn't been used for the longest time.
✅ 3. Optimal:
Replaces page not needed for the longest future use.
🔶 5. Deadlock
✅ Definition:
Deadlock occurs when multiple processes wait indefinitely for resources held by each other.
2. Hold and Wait – Process holds one resource, waits for another.
✅ Handling Techniques:
🔶 6. File Systems
✅ Access Methods:
✅ Directory Structures:
🔶 7. I/O Management
✅ Techniques:
3. DMA (Direct Memory Access) – Transfers directly between memory and device, CPU not
involved.
✅ Device Drivers:
o (b) FCFS ✅
o (c) Priority
o (d) None
o (a) Batch
o (c) Scheduling
a) First-Come, First-Served
b) Shortest Job First
c) Round Robin
d) Priority Scheduling
✅ Answer: c) Round Robin
Explanation: Round Robin allocates a fixed time slice (quantum) to each process.
a) Mutual Exclusion
b) Preemption
c) Hold and Wait
d) Circular Wait
✅ Answer: b) Preemption
Explanation: Preemption prevents deadlock; "No Preemption" is actually the condition that
leads to it.
🔹 4. Which page replacement algorithm has the lowest page fault rate in ideal conditions?
a) FIFO
b) LRU
c) Optimal
d) Random
✅ Answer: c) Optimal
Explanation: Optimal algorithm replaces the page that won’t be used for the longest time in the
future.
a) Random
b) Indexed
c) Sequential
d) Direct
✅ Answer: c) Sequential
Explanation: Magnetic tapes are sequential access devices; random access is not feasible.
a) Time-sharing
b) Real-Time
c) Batch
d) Network
✅ Answer: b) Real-Time
Explanation: RTOS offers guaranteed response times essential for real-world control systems.
a) Direct
b) Indexed
c) Contiguous
d) Sequential
✅ Answer: c) Contiguous
Explanation: Contiguous is a file allocation method, not an access method.
a) FCFS
b) Round Robin
c) SJF
d) Priority
Answer: b) Round Robin
2. What is a process?
a) A program in execution
b) A program in memory
c) A file on disk
d) CPU register
Answer: a) A program in execution
a) FCFS
b) Round Robin
c) Priority scheduling
d) SJF
Answer: c) Priority scheduling
a) Mutual exclusion
b) Hold and wait
c) Resource preemption
d) Circular wait
Answer: c) Resource preemption
a) Windows
b) UNIX
c) QNX
d) Linux
Answer: c) QNX
a) Internal fragmentation
b) External fragmentation
c) Segmentation
d) Thrashing
Answer: b) External fragmentation
12. The time a process spends waiting in the ready queue is called:
a) Burst time
b) Waiting time
c) Turnaround time
d) Response time
Answer: b) Waiting time
a) Programmed I/O
b) Interrupt-driven I/O
c) Direct Memory Access (DMA)
d) Polling
Answer: c) Direct Memory Access (DMA)
a) Single-level
b) Two-level
c) Tree structure
d) Flat
Answer: c) Tree structure
a) Compile programs
b) Manage hardware and resources
c) Write code
d) Encrypt data
Answer: b) Manage hardware and resources
a) FCFS
b) Round Robin
c) SJF
d) Priority
Answer: c) SJF
20. The primary memory used by the OS to hold the OS code is:
a) RAM
b) ROM
c) Cache
d) Virtual memory
Answer: a) RAM
a) Size of memory
b) Time allocated to each process
c) Total CPU time
d) Time between interrupts
Answer: b) Time allocated to each process
a) Process termination
b) Gradually increasing priority of waiting processes
c) Reducing CPU speed
d) Memory cleanup
Answer: b) Gradually increasing priority of waiting processes
23. Which file access method allows jumping directly to the desired record?
a) Sequential
b) Indexed
c) Direct
d) None of the above
Answer: c) Direct
a) Authentication
b) Encryption
c) Compilation
d) Access control
Answer: c) Compilation
a) Ready
b) Running
c) Waiting/Blocked
d) New
Answer: c) Waiting/Blocked
a) Program execution
b) File system manipulation
c) Code debugging
d) Resource allocation
Answer: c) Code debugging
a) GUI
b) Shell
c) Desktop
d) Kernel
Answer: b) Shell
a) Interrupt
b) Page fault
c) Deadlock
d) CPU overload
Answer: b) Page fault
a) Hardware
b) Software to control hardware
c) Part of CPU
d) File system
Answer: b) Software to control hardware
32. Which process state transition happens when CPU finishes execution?
a) New → Ready
b) Ready → Running
c) Running → Terminated
d) Waiting → Ready
Answer: c) Running → Terminated
a) FIFO
b) LRU
c) SJF
d) Optimal
Answer: c) SJF
a) New
b) Ready
c) Running
d) Waiting
Answer: b) Ready
a) Windows
b) Linux
c) DOS
d) UNIX
Answer: c) DOS
a) Easy to implement
b) Name conflicts between files
c) Users can’t create files
d) Supports multi-users
Answer: b) Name conflicts between files
40. The CPU scheduling algorithm best suited for time-sharing systems is:
a) FCFS
b) SJF
c) Round Robin
d) Priority
Answer: c) Round Robin
a) Memory management
b) Process scheduling
c) Network routing
d) File management
Answer: c) Network routing
a) Manage files
b) Select which process runs next
c) Manage memory
d) Handle input/output devices
Answer: b) Select which process runs next
a) Paging
b) Segmentation
c) Compiling
d) Virtual memory
Answer: c) Compiling
a) RAM
b) CPU Cache
c) Hard Disk
d) Registers
Answer: c) Hard Disk
a) Round Robin
b) Priority
c) SJF (non-preemptive)
d) FCFS
Answer: d) FCFS
a) Batch OS
b) Network OS
c) Programming OS
d) Real-Time OS
Answer: c) Programming OS