Core Operating System Modules Overview
Core Operating System Modules Overview
An operating system (OS) acts as an intermediary between computer hardware and application software, facilitating user interaction with the system hardware. It provides abstraction for these operations, handling tasks such as executing programs, managing memory, and ensuring security and file management. Different types of operating systems cater to specific needs: batch operating systems execute jobs without user interaction, multitasking systems allow multiple processes to run concurrently, real-time operating systems cut latency for time-sensitive tasks, and more .
Disk scheduling algorithms determine the order of disk I/O requests. SSTF (Shortest Seek Time First) optimizes by serving the nearest requests first but can lead to starvation. SCAN moves the disk arm across the disk and back, offering a more uniform wait time, while LOOK improves SCAN by only scanning used areas. These techniques impact efficiency by reducing head movement, improving throughput, and minimizing wear, enhancing reliability of storage solutions .
Deadlocks occur when processes hold resources while waiting indefinitely for others, often due to circular wait, hold and wait, or resource preemption. Prevention strategies involve forcing conditions that prevent these, like ensuring resource allocation is in a predefined order to avoid circular wait. Recovery methods may include process termination or rolling back actions to break the deadlock. Understanding causes allows for the design of systems that minimize their occurrence and impact .
Device drivers act as translators between hardware devices and the OS, converting generic OS requests into device-specific operations. Interrupts are signals that alert the CPU to a high-priority condition requiring interrupt handling that temporarily halts regular execution to address the condition's requirements. DMA (Direct Memory Access) enhances efficiency by allowing devices to transfer data without CPU intervention, freeing up CPU cycles for other tasks. Together, these components ensure efficient I/O management by balancing control and performance .
Critical sections are parts of code where shared resources are accessed, requiring synchronization to prevent data inconsistency. Semaphores are signaling mechanisms that control access by maintaining a counter to signal if a resource is available. Mutexes (mutual exclusions) are more restrictive; they lock the resource for exclusive access by one thread at a time. Both tools are used to enforce synchronization and manage concurrency, preventing race conditions and ensuring data integrity .
File types (such as regular, directory, and special files) determine the methods for accessing and manipulating files. Allocation methods, such as contiguous, linked, or indexed, influence how data is stored and accessed. Contiguous allocation provides fast access but can lead to fragmentation; linked allocation is flexible but slower; indexed allocation strikes a balance by using an index block to track file locations. These choices affect file system performance and efficiency, balancing speed, reliability, and complexity .
Processes are independent executing entities with their own memory space, while threads exist within processes, sharing memory but capable of running concurrently. Processes have higher overhead due to the separate memory, whereas threads use less system resources. Lifecycle stages include creation, execution, and termination, while context switching involves storing the state of a process or thread and restoring it later, which impacts performance as it requires CPU time and memory usage. Design decisions in handling context switches significantly influence system efficiency .
Paging divides memory into fixed-size pages, mapping them to frames in physical memory, which avoids fragmentation and allows non-contiguous memory allocation. Virtual memory extends this by allowing the execution of processes not completely in physical RAM, using disk space as additional 'virtual' RAM, which enables larger applications to run without requiring equivalent physical memory. This abstraction increases efficiency and enables multitasking by managing memory dynamically .
User authentication verifies user identity, crucial for access control which limits system resource usage to authorized users. Encryption protects data by converting it into unreadable formats for unauthorized access. Together, they safeguard against unauthorized access, data breaches, and ensure confidentiality, integrity, and availability of system resources. The combination of these elements fortifies overall system security, creating multi-layered defenses against various threats .
FCFS (First-Come, First-Served) schedules processes in the order they arrive, leading to simplicity but potential long waiting times. SJF (Shortest Job First) selects the shortest processes next, minimizing average waiting time but struggling with long processes. Round Robin (RR) uses time quanta to cycle through processes, balancing CPU time among active processes, which reduces wait times but can lead to low throughput if quanta are too small. Each algorithm affects system performance based on process requirements and system goals .