Operation System Design
Operation System Design
3 Marks:
1 B). Interrupt
1. Definition: A signal that prompts the OS to stop its current task and handle
an event (like input/output or errors).
2. Types:
- Hardware Interrupts: Triggered by external devices (e.g., keyboard
or mouse).
- Software Interrupts: Triggered by programs (e.g., system calls).
3. Process: Saves the state of the current task, handles the interrupt, and
then resumes the task.
2 A). Functions of OS
1. Process Management: Creation, scheduling, and termination of
processes.
2. Memory Management: Allocation and deallocation of memory for
processes and managing virtual memory.
3. File System Management: Managing files and directories on storage
devices, handling read/write operations.
4. Device Management: Controlling hardware devices (e.g., printers,
keyboards) and managing device drivers.
5. Security: Managing user authentication, permissions, and protecting the
system from unauthorized access.
6. Error Detection: Continuously monitoring for potential errors and resolving
or reporting them.
3 A). Threads
1. Definition: A lightweight unit of a process that can be scheduled for
execution.
2. Multithreading: Multiple threads can run concurrently, sharing resources
like memory, leading to better CPU utilization.
3. Types:
- User-level Threads: Managed by user libraries.
- Kernel-level Threads: Managed by the OS.
3 B). Semaphore
1. Definition: A synchronization tool used to control access to shared
resources in a concurrent system.
2. Types:
- Binary Semaphore: Can only take values 0 or 1, similar to a mutex.
- Counting Semaphore: Can take non-negative integer values, useful
for managing a limited number of resources.
3. Function: Ensures mutual exclusion and prevents race conditions in critical
sections of code.
4 B). Thrashing
1. Definition: A condition where excessive paging leads to low CPU
performance as the OS spends more time swapping pages between RAM and
disk than executing processes.
2. Causes: Occurs when too many processes are trying to use more memory
than is physically available.
3. Solution: Can be minimized by reducing the degree of multiprogramming
or improving memory allocation strategies.
5 Marks:
1 B). Multiprocessor
1. Definition: A system with two or more processors (CPUs) that share
memory and work in parallel.
2. Types:
- Symmetric Multiprocessing (SMP): Each processor runs
independently, sharing memory.
- Asymmetric Multiprocessing: One processor is the master,
controlling others.
3. Benefits:
- Parallel processing: Increases performance.
- Reliability: If one processor fails, others can take over.
2 A). Evaluation of OS
1. Efficiency: How well the OS utilizes hardware resources.
2. Reliability: Ability to run for long periods without failure.
3. Scalability: Ability to handle growing amounts of work.
4. User Interface: Ease of interaction for users.
5. Security: How well it protects data and resources.
3 B). Deadlock
1. Definition: A situation where two or more processes are blocked, each
waiting for a resource that another process holds.
2. Conditions for Deadlock:
- Mutual Exclusion: At least one resource is non-shareable.
- Hold and Wait: A process holds resources while waiting for more.
- No Preemption: Resources cannot be forcibly taken from a process.
- Circular Wait: A set of processes are waiting in a circular chain.
3. Solutions: Deadlock prevention, avoidance (Banker’s Algorithm),
detection, and recovery.