Process States and Schedulers in Operating Systems
Learn about the different states of a process in an operating system and the responsibilities of the short-term and medium-term schedulers for managing them.
<div style='margin-bottom: 20px;'>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What is the goal of process synchronization, and what are its two main components?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">The goal is to manage access to shared resources by processes, ensuring operations complete without issues, using critical sections and semaphores.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">How does the CPU handle an I/O request from a process according to the provided text?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">The CPU sets an interrupt, the OS fetches the device controller, puts the process on hold, establishes a connection, and upon successful transfer, returns the process to the ready state.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What is the significance of saving a process's context?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">It allows the process to restart correctly at the next CPU entry, preserving the integrity of its execution state.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">Why is message communication between processes slower than shared memory communication?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">Message communication is slower because it requires OS intervention throughout, unlike shared memory where the OS steps back once memory is allocated.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">How is a process's memory organized?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">Into five zones: code, data, heap, stack, and an area for future memory allocation.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What is the primary function of an operating system?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">To serve as an interface between user processes and hardware resources.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">How do you grant write access to a group for a file in Linux?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">By using the command chmod 761 on the file.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What is the primary function of a user thread within a process?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">Its primary function is to execute a specific task called by the host process code and communicate with other threads via shared memory.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What is the purpose of the Process Control Block (PCB) in process management?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">The PCB provides essential information for managing processes, including process ID, state, CPU registers, memory addresses, and more.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What is the scheduler's main responsibility in a computing system?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">Its main responsibility is to determine which process gets CPU access next, based on scheduling logic.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">Define what a Linux distribution encompasses.</h2>
<p style="font-weight: normal; font-size: 1.2rem;">It is a collection of software components centered around the Linux kernel, chosen and validated by a publisher or community.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What are four kernel services of an operating system and their roles?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">Memory manager, interrupt manager, scheduler, and inter-process communication, each facilitating essential OS functions like memory allocation, peripheral access, CPU access management, and process communication.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">Why should one avoid using the 'root' account for daily operations on a Linux workstation?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">Using the root account removes safeguards, risking severe system damage from any command, including those that could destroy the OS.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What distinguishes the Linux kernel from a Linux distribution?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">The kernel is the core foundation, while a distribution provides a user-friendly operating environment.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">What are the three types of memory directly accessible by the CPU?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">RAM, L1, L2, L3 cache memories, and registers.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">Describe the sequence of operations when a CPU processes an 'open' instruction for a file.</h2>
<p style="font-weight: normal; font-size: 1.2rem;">1) CPU executes open, signals OS with interrupt. 2) OS retrieves interrupt, requests resource. 3) OS allocates memory for file. 4) OS opens read channel to disk. 5) HDD controller finds and transfers file to memory. 6) HDD controller signals OS on completion. 7) OS scheduler moves process to ready state.</p>
</div>
<div style="margin-bottom: 10px; background-color: #f2f2f2; border-radius: 1rem; padding: 10px 20px;">
<h2 style="font-weight: bold; margin-bottom: 3px; font-size: 1.5rem;">Who defines the critical section for shared resource access, and what are the implications of its size?</h2>
<p style="font-weight: normal; font-size: 1.2rem;">The application designer, with implications being restricted access if too large, or erratic operation if too small.</p>
</div>
</div>