We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6
1.
1 Introduction, Objectives, Functions, Evolution
1. What is an operating system?
➤ An OS is a system software that manages hardware and software resources and provides services for computer programs.
2. Mention two main objectives of an OS.
➤ To make the computer system convenient to use and to use resources efficiently.
3. List any three key functions of an OS.
➤ Process management, memory management, file system management.
4. What are batch systems?
➤ Batch systems execute batches of jobs without user interaction during processing.
5. Difference between multiprogramming and multitasking?
➤ Multiprogramming increases CPU utilization; multitasking allows users to perform multiple tasks simultaneously.
6. How does the OS act as an interface?
➤ It provides a user interface and manages communication between hardware and user applications.
7. What are real-time OS?
➤ RTOS respond to inputs within a guaranteed time; used in critical systems like robotics or medical devices.
8. How has the OS evolved?
➤ Evolved from batch → multiprogramming → multitasking → GUI-based OS → modern distributed & mobile OS.
📘 1.2 OS Structures
9. What is meant by OS structure?
➤ The organization of the OS code into layers/modules for better maintainability and performance.
10. What is a layered OS structure?
➤ It organizes the OS in layers, each built on top of lower ones, like the OSI model.
11. One advantage/disadvantage of layered OS?
➤ Advantage: Modularity; Disadvantage: Slower due to layer-by-layer access.
12. What is a monolithic kernel?
➤ An OS with all services in one large block of code running in kernel mode. 13. What is a microkernel? ➤ An OS with only essential core functions in the kernel; rest runs in user space.
14. Compare monolithic and microkernel.
Feature Monolithic Kernel Microkernel
Size Large Small
Modules All in kernel space Only essentials
15. Performance issues in microkernels?
➤ More context switches and inter-process communication reduce performance.
16. Why is modularity important in OS?
➤ For easier debugging, upgrades, and maintenance.
📘 1.3 Linux Kernel, Shell, System Calls
17. What is the Linux kernel?
➤ It is the core part of the Linux OS managing hardware and system processes.
18. Responsibilities of the Linux kernel?
➤ Process control, memory management, device management, and system calls.
19. What is a shell in Linux?
➤ It is a command-line interface that interprets user commands.
20. Difference between shell and kernel?
➤ Shell is user interface; kernel interacts directly with hardware.
21. Define system call.
➤ It is a programmatic way to request a service from the OS kernel.
22. What happens during a system call?
➤ Control is transferred from user to kernel mode to perform operations.
23. Categories of system calls?
➤ Process control, file manipulation, device management, info maintenance.
24. Tricky: Can a shell access hardware directly?
➤ No, shell interacts with kernel which then accesses hardware.
🟨 UNIT 2: Process and Scheduling
📘 2.1 Process, PCB
25. What is a process?
➤ A process is an instance of a running program.
26. Program vs Process?
➤ Program is passive code; process is the execution of that code.
27. List process states.
➤ New, Ready, Running, Waiting, Terminated.
28. What is a PCB?
➤ It stores process-specific information like PID, registers, state.
29. What info is stored in PCB?
➤ Process ID, state, CPU registers, memory limits, I/O status.
30. What is context switching?
➤ Saving the state of one process and loading the state of another.
31. What causes context switching?
➤ Time slice expiration, I/O request, priority changes.
📘 2.2 Scheduling
32. Define CPU scheduling.
➤ Choosing which process runs on CPU at a given time.
33. Preemptive vs Non-preemptive scheduling?
Type Can Interrupt? Example
Preemptive Yes RR, SRTN
Non-preemptive No FCFS, SJF
34. Explain FCFS.
➤ First come, first served – jobs are scheduled in arrival order.
35. Explain SJF.
➤ Shortest Job First – process with the least execution time runs first.
36. What is SRTN?
➤ Shortest Remaining Time Next – preemptive version of SJF.
37. What is priority scheduling?
➤ Processes are scheduled based on assigned priority values. 38. What is starvation? ➤ When a low-priority process never gets CPU time.
39. What is Round Robin?
➤ Each process gets a fixed time quantum in cyclic order.
40. Advantages of RR?
➤ Fair, good for time-sharing systems.
41. Effect of time quantum in RR?
➤ Small quantum increases context switches; large quantum resembles FCFS.
📘 2.3 Threads and Multithreading
42. What is a thread?
➤ A lightweight process; a unit of CPU execution inside a process.
43. Threads vs Processes?
➤ Threads share memory space; processes are isolated.
➤ Multiple processes running at the same time, possibly interleaved. 49. Why synchronization is needed? ➤ To avoid race conditions and ensure consistency in shared data.
50. What is IPC?
➤ A mechanism to allow processes to communicate and synchronize.
51. IPC methods?
➤ Shared memory and message passing.
52. Shared memory IPC?
➤ Processes access common memory space for communication.
53. Race condition example?
➤ Two processes updating the same counter variable without sync.
54. What are critical sections?
➤ Code segment where shared resources are accessed.
55. How to handle critical sections?
➤ Using synchronization tools like semaphores, mutex, monitors.
📘 3.2 Mutual Exclusion and Semaphores
56. What is mutual exclusion?
➤ Only one process can access a resource at a time.
57. Requirements of mutual exclusion?
➤ Mutual Exclusion, Progress, Bounded Waiting.
58. What is TSL?
➤ Test and Set Lock – hardware instruction for implementing locks.
59. What is a semaphore?
➤ A variable used for signaling, accessed via wait() and signal().
60. Types of semaphore?
➤ Binary and Counting.
61. Binary vs Counting semaphore?
➤ Binary = 0/1; Counting can have any integer value.
62. Producer-consumer using semaphore?
➤ Use empty, full, mutex semaphores to coordinate production and consumption.
63. Tricky: Are semaphores enough for all synchronization?
➤ Yes, but they can be complex and error-prone. 📘 3.3 Deadlocks
64. What is deadlock?
➤ A state where processes are stuck waiting for each other’s resources.
65. Four conditions of deadlock?
➤ Mutual exclusion, Hold and wait, No preemption, Circular wait.
66. What is a Resource Allocation Graph?
➤ A visual way to detect circular waits and possible deadlocks.
67. What is deadlock prevention?
➤ Eliminating one of the four conditions.
68. Two techniques of prevention?
➤ Request all resources at once, use resource ordering.
69. What is deadlock avoidance?
➤ The system checks resource requests before granting, e.g., Banker’s.
70. What is Banker’s Algorithm?
➤ It ensures that resources are allocated only if it keeps the system in a safe state.
71. Safe state meaning?
➤ There exists at least one safe sequence for all processes.
72. What is deadlock detection and recovery?
➤ System detects cycles and recovers by killing or rolling back processes.
73. Dining philosopher problem?
➤ Philosophers need two forks; deadlock occurs if all pick up one and wait.
74. Deadlock solution for dining philosophers?
➤ Use semaphore or resource ordering; allow only (n-1) to sit.