Operating System Course Outcomes
Operating System Course Outcomes
Paging involves dividing memory into fixed-size units called pages, which simplifies memory allocation and management due to uniformity. Segmentation divides memory into variable-sized units based on logical segments such as functions or data structures, providing more logical separation between processes. For example, paging allows easy swapping of pages to and from memory, minimizing fragmentation, while segmentation gives developers better control over memory boundaries and supports easier handling of growing data structures. Paging optimizes hardware memory utilization without monitoring varying sizes, whereas segmentation enhances program structuring and protection .
Virtual memory is an abstraction that gives processes the illusion of a large, continuous memory space, independent of the actual physical memory. It uses disk storage to supplement physical memory, allowing systems to run larger applications than available physical RAM would support. This separation enables efficient memory management techniques like paging and swapping, minimizes fragmentation, and enhances security by isolatin processes. Virtual memory allows more efficient multitasking since processes can be allocated virtual addresses and swapped as needed, improving utilization and system performance .
Multiprogramming operating systems allow multiple programs to be loaded into memory simultaneously, enabling the CPU to switch between tasks and execute them concurrently. This reduces CPU idle time and increases utilization by ensuring that the CPU always has a process to execute, even if one is waiting for I/O operations, which is a significant improvement over batch operating systems that execute one job at a time without overlapping. The principal advantages include improved CPU utilization, shorter execution times for individual programs due to task switching, and efficient resource allocation. System performance is enhanced as tasks don't have to wait for one another to complete entirely before moving on, leading to better throughput and reduced waiting times .
Disk scheduling algorithms determine the order in which disk I/O requests are processed, impacting system efficiency. FCFS handles requests in the order they arrive, which is fair but can lead to inefficiencies with longer seek times. SSTF prioritizes requests closest to the current head position, reducing average seek time but risking starvation of distant requests. SCAN (or elevator algorithm) moves the head in one direction, fulfilling requests along the way, then reverses direction, minimizing seek time variance and offering a balance between fairness and efficiency while reducing the chance of starvation .
RAID levels define different methods of storing data across multiple drives to enhance performance, reliability, and capacity. RAID 0 (striping) improves performance by distributing data with no redundancy, risking data loss if a drive fails. RAID 1 (mirroring) provides redundancy by duplicating data, enhancing fault tolerance but doubling storage needs. RAID 5 (striping with parity) balances performance and redundancy by distributing data and parity, recovering from single drive failures but requiring more complex parity calculations. RAID 6 offers additional parity for tolerance against two drive failures, though it further reduces write performance compared to RAID 5. Each level balances trade-offs between storage efficiency, performance, and data protection .
FCFS schedules processes based on their arrival time, ensuring a simple and fair but potentially inefficient system due to the convoy effect, where shorter processes wait for a longer one. SJN selects processes with the shortest execution time first, improving efficiency by minimizing average waiting time but risking unfairness to longer processes and potential starvation in dynamic environments. Round-Robin allocates a fixed time quantum to each process in a cycle, balancing efficiency and fairness by giving all processes an equal chance but potentially increasing context switch overhead, which may degrade performance with very short time quanta .
The critical section problem requires three key conditions: mutual exclusion, progress, and bounded waiting. Mutual exclusion ensures that only one process can enter the critical section at a time, preventing resource conflicts. Progress guarantees that if no process is in the critical section, a decision on which process can enter next is made without delay. Bounded waiting ensures every requesting process has a bounded time limit to wait before accessing the critical section. Together, these conditions prevent race conditions, deadlock, and indefinite waiting, ensuring efficient and fair management of concurrent processes .
The dining philosopher problem demonstrates how resource allocation can lead to deadlocks when multiple processes compete for limited resources—in this case, philosophers (processes) and forks (resources) at a table. Each philosopher alternates between thinking and eating, needing two forks to eat, but deadlock occurs when each philosopher picks up one fork and waits indefinitely for the other. This illustrates the concurrency issue of resource locking. Solutions like requiring all forks to be picked up at once (mutex) or using resource hierarchy and deadlock prevention techniques (e.g., ensuring at least one philosopher can acquire both forks) effectively mitigate these issues .
A resource allocation graph (RAG) visually represents the allocation of resources to processes, illustrating potential conditions for deadlocks. Nodes represent processes and resources, and directed edges simulate resource distribution. A graph cycle indicates the possibility of a deadlock, where each process in the cycle holds a resource needed by another, illustrating the hold and wait condition of deadlocks. Analyzing the RAG can help in deadlock detection by identifying such cycles; however, removing cycles (e.g., via avoiding resource allocation patterns that lead to them) is essential for deadlock prevention .
File sharing poses challenges like unauthorized access, data integrity breaches, and potential interference from concurrent modifications. File system protection mechanisms address these issues by implementing access control lists (ACLs), which specify user permissions, and locking schemes where files or data are restricted during transactions. Mechanisms also include encryption, ensuring data confidentiality, and version control systems to track changes and prevent conflicts. With these measures, operating systems can provide secure, reliable file sharing without sacrificing performance or user collaboration capabilities .