Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Technical Question Bank: Operating

Systems
• Explain the concept of Reentrancy?
A reentrant procedure can be interrupted and called by an interrupting program, and
still execute correctly on returning to the procedure.

• Explain Belady's Anomaly?


The number of frames allocated to each process directly relates to page faults. The
number of page faults decreases significantly by increasing the number of frames.
Occasionally, an exception, i.e., increased frames, leads to more page faults. Belady's
anomaly refers to this exception. This issue is caused by the page replacement algorithm
that governs demand paging.
Here are a few page replacement algorithms in which Belady's Anomaly most
frequently occurs:
• First In First Out (FIFO)
• Second Chance Algorithm
• Random Page Replacement Algorithm

• What is a binary semaphore? Explain its use.


A binary semaphore is a synchronization mechanism with two states, 0 and 1, used in
concurrent programming. It helps control access to shared resources. Threads or
processes can either acquire the semaphore (if it's 1) and proceed, or they are blocked
until the semaphore becomes available. The semaphore is typically used to coordinate
access to critical sections of code or shared resources, ensuring that only one entity can
access them at a time.

• What is thrashing?
Thrashing occurs in computer systems when there's excessive and inefficient swapping of
data between RAM and the disk, resulting in high page fault rates, low CPU utilization for
useful tasks, and poor system responsiveness. It is typically caused by insufficient physical
memory to accommodate the demands of running processes. Mitigation strategies include
adding more RAM, optimizing page replacement algorithms, and managing the number
of concurrent processes.
• Mention the Coffman's conditions that lead to a deadlock.
Coffman's conditions for deadlock are:
1. Mutual Exclusion: Resources cannot be shared; only one process can use a resource at a
time.
2. Hold and Wait: Processes hold resources while waiting for others, creating potential
circular waiting.
3. No Preemption: Resources cannot be forcibly taken from a process; they must be
explicitly released.
4. Circular Wait: A circular chain of processes exists, with each waiting for a resource
held by another in the chain.

• What is short, long, and medium-term scheduling?


- Short-term Scheduling (CPU Scheduling): Determines which process in the ready queue
gets the CPU next, focusing on CPU utilization and response time.

- Medium-term Scheduling: Involves swapping processes in and out of memory to manage


overall system multiprogramming, with a focus on efficient memory utilization.

- Long-term Scheduling (Job Scheduling): Selects processes from the job pool and brings
them into the system, aiming for overall system efficiency and a balanced mix of
processes.

• What are turnaround time and response time?


- Turnaround Time: Total time from process submission to completion, including waiting,
execution, and I/O time.
- Response Time: Time from initiating a process to receiving the first output or response,
including waiting time in the ready queue.
• What are the typical elements of a process image?
The typical elements of a process image include:
1. Program Code (Text Section)
2. Program Counter (PC)
3. Stack Pointer
4. Data Section (Global Variables)
5. Heap
6. File Descriptors
7. Registers
8. Process ID (PID)
9. Parent Process ID (PPID)
10. User and Group ID
11. Environment Variables
12. Status Information
13. Priority and Scheduling Information
14. Signals and Signal Handlers
15. I/O Information
16. Code and Data Segment Information

• What is the Translation Lookaside Buffer (TLB)?


The Translation Lookaside Buffer (TLB) is a hardware cache that stores recently used
virtual-to-physical address translations. It helps improve the speed of memory access in a
computer system by avoiding repeated translation table lookups during the process of
converting virtual addresses used by a program into corresponding physical addresses in
the computer's memory.

• What is the resident set and working set of a process?


- Resident Set: Portion of a process's memory currently in physical RAM.
- Working Set: Subset of the resident set actively used by the process at a given time.

• When is a system in safe state?


A system is in a safe state when it is possible to allocate resources to processes in a way
that avoids deadlock. In a safe state, it is guaranteed that processes can complete their
execution without getting stuck due to resource conflicts or circular waiting.
• What is cycle stealing?
Cycle stealing is a method of DMA (Direct Memory Access) transfer where the DMA
controller temporarily pauses the CPU during its operation to transfer a small, fixed-sized
chunk of data, allowing the CPU to regain control and continue its processing. This
approach is used to minimize the impact on the CPU's performance while still allowing
efficient data transfers between devices and memory.

• What is meant by arm-stickiness?


"Arm-stickiness" typically refers to a situation in load balancing where a processor or
core tends to hold onto tasks or threads for an extended period, making it less likely to
release them to other processors. This behavior can lead to imbalances in the workload
distribution among processors, potentially affecting system performance.

• What are the stipulations of C2 level security?


C2 level security, part of the Trusted Computer System Evaluation Criteria (TCSEC), is a
set of requirements for secure computer systems. Some stipulations include:

1. Identification and Authentication:


- Users must be identified and authenticated.
- Passwords should be used for user authentication.

2. Discretionary Access Control:


- Access controls based on user identity and privileges.
- Object owners can set access permissions.

3. System Accountability:
- System must be able to audit security-relevant events.
- Logs should be protected against tampering.

4. Resource Isolation:
- Processes and data should be protected from unauthorized access.

5. Trusted Recovery:
- The system should be able to recover to a known secure state after a security breach.
6. Security Testing:
- System design and implementation must undergo security testing.

These stipulations ensure a baseline level of security and accountability in computer


systems evaluated at the C2 level.

• What is busy waiting?


Busy waiting, also known as spin-waiting, is a technique where a process repeatedly
checks for a condition to be true without relinquishing control of the CPU. Instead of
waiting passively, the process actively checks the condition in a loop. This can be an
inefficient use of CPU resources, but it is sometimes used in situations where the expected
wait time is short, and the overhead of a more sophisticated waiting mechanism is deemed
excessive.

• Explain the popular multiprocessor thread-scheduling strategies.


1. Load Balancing: Distributes workload evenly among processors.
2. Partitioning: Divides processors into groups, assigns tasks to partitions.
3. Work Stealing: Idle processors take tasks from busy ones for balance.
4. Dynamic Scheduling: Adjusts thread assignments based on runtime conditions.
5. Task Queues: Each processor has its task queue for independent execution.
6. Global Scheduling: Considers the entire system for thread scheduling.
7. Thread Affinity: Binds threads to specific processors for cache benefits.

• When does the condition 'rendezvous' arise?


The condition 'rendezvous' arises in concurrent programming when two or more
processes or threads need to synchronize and meet at a specific point in their execution
before proceeding. It ensures that certain actions are coordinated or executed in a specific
order between concurrent entities.
• What is a trap and trapdoor?
- Trap: A trap, in computing, refers to a mechanism for switching from user mode to
kernel mode, typically triggered by a software interrupt. It allows user programs to
request services from the operating system.

- Trapdoor: A trapdoor is a hidden entry point into a software system that allows
unauthorized access. In security contexts, it refers to a deliberate vulnerability or
backdoor that can be exploited for unauthorized entry.

• What are local and global page replacements?


- Local Page Replacement: Involves selecting a page for replacement from the page table
of the specific process experiencing a page fault. Replacement decisions are based on the
local page usage of that process.

- Global Page Replacement: Involves selecting a page for replacement from the entire pool
of pages in the system, regardless of the process to which it belongs. Replacement
decisions consider the overall system's page usage and may impact multiple processes.

• Define latency, transfer, and seek time with respect to disk I/O
- Latency Time: Time for disk rotation and head positioning.
- Transfer Time: Time to read or write data once positioned.
- Seek Time: Time for the read/write head to move to the desired track.

• Describe the Buddy system of memory allocation.


The Buddy System is a memory allocation technique that divides memory into blocks of
fixed sizes and allocates memory in powers of two. When a request for memory comes in,
the system searches for the smallest available "buddy" block that fits the requested size or
splits a larger block into two smaller buddies. Merged buddies can be combined back into
larger blocks when freed. This method minimizes fragmentation and efficiently manages
memory.
• What is timestamping?
Timestamping, in a general sense, involves assigning a time value to an event or data
record. In computing and databases, timestamping refers to the practice of associating a
unique identifier or a specific time value with each transaction, event, or data entry. It is
commonly used for tracking the order of operations, ensuring data consistency, and
managing concurrency in distributed systems.

• How do the wait/signal operations for monitor differ from those for semaphores?
Monitors:
- Wait Operation: Releases lock and waits for a condition.
- Signal Operation: Signals one waiting thread to continue.
Semaphores:
- Wait Operation (P): Decrements count, may block.
- Signal Operation (V): Increments count, wakes up a blocked process if needed.

• In the context of memory management, what are placement and replacement algorithms?
Placement Algorithms:
- Objective: Optimize initial allocation.
- Examples: First Fit, Best Fit.
Replacement Algorithms:
- Objective: Minimize impact during removal.
- Examples: LRU, FIFO.

• In loading programs into memory, what is the difference between load-time dynamic linking
and runtime dynamic linking?
Load-Time Dynamic Linking:
- Occurs during program loading.
- Linking in advance.
- Faster startup.

Runtime Dynamic Linking:


- Occurs during program execution.
- On-demand linking.
- Greater flexibility, potential slight performance overhead.
• What is demand-paging and pre-paging?
Demand-Paging:
- Pages loaded into memory on demand.
- Reduces initial loading time.

Pre-Paging:
- Anticipates future page accesses.
- Proactively loads pages ahead of time to reduce potential page faults.

• Paging a memory management function while multiprogramming a processor management


function: are the two interdependent?
Paging (memory management) and multiprogramming (processor management) are
interdependent in a computer system. Paging supports efficient memory use, enabling
multiple programs to coexist. Multiprogramming benefits from paging by maximizing
CPU utilization and overall system throughput. Together, they enhance system
performance.

• What is page cannibalizing?


Page cannibalizing, in the context of memory management, refers to a situation where a
page is taken away from one process and given to another. This typically occurs when the
operating system needs to satisfy a page fault for a new process but doesn't have enough
free frames in memory. As a result, it takes a page from another process, potentially
leading to increased page faults for the victim process. Page cannibalizing helps in
fulfilling the immediate memory requirements of one process at the expense of another.

• What has triggered the need for multitasking in PCs?


The need for multitasking in PCs arose due to user expectations, advanced applications,
internet usage, increased hardware capability, and the desire for improved productivity.
The evolution of operating systems to support multitasking further contributed to the
demand.
• What are the four layers that Windows NT has to achieve independence?
Windows NT achieves independence through the following layers:

1. Hardware Abstraction Layer (HAL): Ensures hardware independence.


2. Kernel Mode: Manages core OS functions in a secure environment.
3. Executive Services: Implements higher-level OS functions beyond the kernel.
4. Win32 API: Provides a consistent interface for application development.

• What is SMP?
SMP stands for Symmetric Multiprocessing. It is a computer architecture design that
involves multiple processors or cores, each having equal access to the system's memory
and I/O resources. In an SMP system, all processors share a common, single operating
system and memory space, allowing them to execute tasks concurrently and work on
different parts of a program or multiple programs simultaneously. SMP systems are
known for their scalability and the ability to efficiently handle multitasking and parallel
processing workloads.

• What are the key object-oriented concepts used by Windows NT?


Windows NT incorporates key object-oriented concepts:

1. Objects: Represent system resources.


2. Encapsulation: Bundles data and methods within objects.
3. Inheritance: Allows classes to inherit properties.
4. Polymorphism: Objects respond to the same message differently.
5. Message Passing: Objects communicate through messages.
6. Abstraction: Focuses on essential features, ignoring unnecessary details.

These concepts enhance modularity, flexibility, and maintainability in the operating


system design.
• Is Windows NT a full-blown object-oriented operating system? Give reasons.
No, Windows NT is not a full-blown object-oriented operating system. It incorporates
object-oriented concepts alongside procedural elements, maintains legacy compatibility,
has a kernel implemented with procedural elements, is primarily coded in C, and
integrates various non-object-oriented technologies. It is considered a hybrid system
rather than purely object-oriented.

• What is a drawback of MVT?


One drawback of MVT (Multiprogramming with a Variable number of Tasks) is the
potential for inefficient memory utilization, leading to external fragmentation and the
need for compaction, which can be time-consuming and disrupt normal processes.

• What is process spawning?


Process spawning is the creation of a new process by an existing process. It involves
initiating the execution of a new program or code segment, resulting in the creation of a
distinct and independent process with its own memory space and resources. Process
spawning is a fundamental concept in multitasking and concurrent programming,
allowing the execution of multiple processes concurrently in a computer system.

• How many jobs can be run concurrently on MVT?


The number of jobs that can run concurrently on MVT depends on the available memory
and the sizes of the individual jobs. It is dynamic and limited by the total system memory.

• List out some reasons for process termination.


Common reasons for process termination include normal exit, error exit, fatal errors, user
or parent requests, resource exhaustion, security violations, time limit exceeded, system
shutdown, IPC failure, and task completion.

• What are the reasons for process suspension?


Processes may be suspended for reasons such as waiting for I/O operations, resource
availability, event synchronization, page faults, IPC, signal handling, timer expiration,
parental request, debugger attachment, manual suspension, and background priority.
These reasons reflect the diverse conditions under which a process may temporarily halt
its execution.
• What is process migration?
Process migration refers to the transfer or movement of a process from one machine or
node in a distributed computing environment to another. In short, it involves relocating a
running process along with its execution state and data from one system to another within
a network. This can be done for various reasons, such as load balancing, resource
optimization, fault tolerance, or to improve system performance and responsiveness.

• What is mutant?
In computing, a "mutant" is a modified version of an individual or solution in genetic
algorithms, introduced to explore new possibilities and enhance the evolutionary search
process.

• What is an idle thread?


An idle thread, in the context of computing, refers to a thread or process that is active but
not performing any significant computational tasks. Instead, it often waits or remains in a
dormant state, consuming minimal resources while ready to respond when needed. Idle
threads are commonly used for background tasks, system maintenance, or to ensure
responsiveness while the CPU is not fully utilized.

• What is FtDisk?
"FtDisk" refers to the Fault Tolerant Disk Driver in Windows operating systems. It
manages fault-tolerant disk configurations like RAID 1 and RAID 5, ensuring data
integrity and availability in the event of disk failures.

• List the possible threads a thread can have.


Possible thread states include:
1. New
2. Runnable (Ready)
3. Blocked (Waiting)
4. Timed Waiting
5. Terminated

These states represent the lifecycle of a thread in a multithreading environment.


• List rings in Windows NT
In Windows NT, the operating system uses a protection mechanism called "rings" to define
different levels of privilege and access control. The rings are numbered from 0 to 3, with 0
being the most privileged and 3 being the least privileged. In short:

1. Ring 0 (Kernel Mode):


- Highest privilege level.
- Kernel mode, where the operating system's core functions execute.
- Direct access to hardware and critical system resources.

2. Ring 1:
- Not used in Windows NT.
- Originally intended for separate execution environments but not implemented in Windows
NT.

3. Ring 2:
- Not used in Windows NT.
- Reserved for future use but remains unused in the Windows NT architecture.

4. Ring 3 (User Mode):


- Least privileged level.
- User mode, where applications and user processes execute.
- Limited access to system resources, with the operating system managing and controlling
access.
Windows NT primarily utilizes Ring 0 and Ring 3, with Ring 0 for kernel mode and critical
system functions, and Ring 3 for user mode, where applications run with restricted access to
system resources. Rings 1 and 2 are not used in Windows NT.

• What is Executive in Windows NT?


In Windows NT, the Executive is a kernel-mode component that provides core operating
system services, manages system resources, includes the Object Manager for handling
system objects, incorporates the Security Reference Monitor for security, and handles
synchronization, interrupt handling, and inter-process communication. It is a crucial part
of the operating system's architecture.
• What are the sub-components of I/O manager in Windows NT?
Sub-components of the I/O Manager in Windows NT include:
1. Device and Driver Interface
2. File Systems
3. Device Drivers
4. I/O Request Packets (IRPs)
5. Plug and Play (PnP) Manager
6. Power Manager
7. Error Handling
8. Asynchronous I/O
9. Buffering and Caching
10. I/O Completion Routines

Together, they manage I/O operations, provide interfaces to devices and drivers, handle
errors, support Plug and Play, and optimize power usage.

• What are DDks? Name an operating system that includes this feature.
DDK stands for Device Driver Kit. It is a set of tools and resources provided by operating
system vendors to assist developers in creating device drivers. An example is the Windows
Driver Kit (WDK) for Windows operating systems.

• What level of security does Windows NT meet?


Windows NT was designed to meet the C2-level security requirements defined by the
Trusted Computer System Evaluation Criteria (TCSEC). It includes features such as
robust user authentication, access control, audit trails, secure file systems, and system
integrity measures to achieve this security level.

• Why is paging used?


Paging is used in computer operating systems to enable virtual memory, provide memory
isolation between processes, allow flexible and non-contiguous memory allocation,
simplify memory management, facilitate efficient process loading, optimize physical
memory usage through demand paging, and enhance system stability by preventing
monopolization of memory by a single process.
• What is fragmentation? What are the different types of fragmentations?
Fragmentation in computer systems involves the inefficient division of memory into non-
contiguous blocks. The main types are:

1. Internal Fragmentation:
- Wasted space within allocated memory blocks.

2. External Fragmentation:
- Free memory scattered in small fragments, hindering allocation of contiguous memory.

3. Disk Fragmentation:
- Non-contiguous storage of file data on disks, affecting access times.

4. Address Space Fragmentation (in virtual memory):


- Scattered free and allocated regions in the virtual address space.

Mitigation involves memory management techniques like compaction, dynamic allocation


algorithms, and defragmentation tools.

• Differentiate between XP and Windows 2000


Windows XP vs. Windows 2000:

1. User Interface:
- XP: Visually appealing, redesigned interface.
- 2000: Business-oriented, less visually polished.

2. Editions:
- XP: Home and Professional editions.
- 2000: Professional, Server, and Advanced Server editions.

3. System Requirements:
- XP: Higher system specs, suitable for newer hardware.
- 2000: Broad hardware compatibility, including older systems.
4. Stability and Performance:
- XP: Stable with improved performance.
- 2000: Known for stability, especially in server environments.

5. Compatibility:
- XP: Enhanced hardware and software compatibility.
- 2000: Broad compatibility, but may have limitations compared to XP.

6. Release Dates:
- XP: Released in 2001.
- 2000: Released in 2000.

• Differentiate between hard and soft real time systems.


Hard Real-Time Systems:
- Strict, non-negotiable deadlines.
- Predictable and guaranteed response times.
- Consequences of failure are severe.
- Examples: Aircraft control, medical equipment.

Soft Real-Time Systems:


- Deadlines exist but missing them is tolerable.
- Desirable but not strictly guaranteed response times.
- Consequences of failure are less severe.
- Examples: Streaming multimedia, online gaming.

• What is arm-stickiness?
In the context of computer systems, "arm-stickiness" does not refer to a well-known or
standardized term. It's possible that the term may be used in a specific context or within a
particular domain. Without additional context or information, it's challenging to provide
a precise definition for "arm-stickiness."

If the term is used in a specific field, industry, or technology, please provide more details
or clarify the context so that I can offer a more accurate explanation.
• In the context of memory management, what are replacement and placement algorithms?
Replacement Algorithms:
- Decide which page to replace when bringing in new data.
- Examples: LRU, FIFO, Optimal.

Placement Algorithms:
- Determine where to allocate new data or processes in memory.
- Examples: First Fit, Best Fit, Worst Fit.

• When does Blue Screen Error occur in a computer?


A Blue Screen Error (BSOD) occurs in a computer when the operating system encounters
a critical error that it cannot recover from. Common causes include hardware issues,
driver problems, software conflicts, operating system errors, overheating, malware
infections, power supply issues, and system resource exhaustion. The system displays a
blue screen with diagnostic information to prevent potential data loss or damage.
Resolving a BSOD involves identifying and addressing the specific cause, which may
require hardware diagnostics, driver updates, software repairs, or other corrective
measures.

• What is throughput, turnaround time, waiting time and response time?


Throughput:
- Number of processes completed in a given time.
Turnaround Time:
- Total time from process submission to completion.
Waiting Time:
- Time spent waiting in the ready queue.
Response Time:
- Time between initiating a process and receiving the first output or response.
• What are the requirements for virtual memory architecture?

Requirements for Virtual Memory Architecture:

1. Address Space Division:

- User space vs. kernel space.

2. Page Tables:

- Mechanism for virtual-to-physical address mapping.

3. Page Size:

- Optimal size balancing page table overhead and internal fragmentation.

4. Page Replacement Policy:

- Algorithm for swapping pages (e.g., LRU, FIFO).

5. Backing Store or Swap Space:

- Secondary storage for temporarily storing pages.

6. Protection Mechanisms:

- Ensures memory region protection from unauthorized access.

7. Dirty Bit:

- Tracks modification status of pages.

8. Demand Paging:

- Brings pages into memory only when needed.

9. Swap In and Swap Out Mechanism:

- Efficient transfer of pages between main memory and backing store.

10. Memory-Mapped Files:

- Supports accessing files as if they were in memory.

You might also like