NOTE: Some answers may not contain all syllabus topics. Please refer to your syllabus for completeness.
(NOTE: EXPLORE AND ELABORATE THESE QUESTIONS ACCORDING TO YOUR NEED)
List of Questions
What is an operating system? What are the operating system services? Explain in brief.
Enlist the components of the operating system and explain them.
Give the difference between Uniprogramming and Multiprogramming. What is the need for a process control block in Multiprogramming? Explain it in detail.
What is a thread? What are the benefits of multithreaded programming? Explain the many-to-many thread model.
Differentiate between a thread and a process. Give two advantages of a thread over multiple processes.
What is meant by a process? Explain the mechanism for process creation and process termination by the operating system.
Describe the actions taken by the kernel to switch content between processes.
Draw and describe the Process State Diagram.
Mention and explain the transitions of states in the process state diagram.
What are the differences between user-level threads and kernel-level threads? Under what circumstances is one better than the other?
Describe the actions taken by the thread library to context switch between user-level threads.
What is Interprocess Communication? Describe the types of Message Passing Systems. What is preemptive and non-preemptive scheduling?
What is TCB or PCB? Explain with a diagram.
How to create a child process from a parent process?
What are the different system calls in an operating system?
Explain the short-term scheduler, long-term scheduler, and medium-term scheduler in brief.
1. What is an operating system? What are the operating system services? Explain in brief.
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. It acts as an intermediary between users and the computer hardware.
Operating system services include:
Process management: Creating, scheduling, and terminating processes.
Memory management: Allocating and deallocating memory.
File system management: Organizing and controlling files and directories.
Device management: Managing device communication via drivers.
User interface: Providing CLI or GUI for user interaction.
Security: Enforcing access controls and protecting resources.
Networking: Managing network communications.
2. Enlist the components of the operating system and explain them.
Kernel: Core part managing hardware and system calls.
File System: Organizes and manages files and directories.
Device Drivers: Interface between OS and hardware devices.
User Interface: CLI or GUI for user interaction.
System Libraries: Precompiled routines for common tasks.
System Utilities: Tools for system maintenance and configuration.
Shell: Command-line interpreter for user commands.
Application Programs: User-level programs running on the OS.
3. Give the difference between Uniprogramming and Multiprogramming. What is the need for a process control block in Multiprogramming? Explain it in detail.
Uniprogramming: Only one program runs at a time; CPU is idle during I/O. Multiprogramming: Multiple programs reside in memory; CPU switches between them to maximize utilization.
Process Control Block (PCB): A PCB stores information about each process (state, program counter, registers, etc.), enabling the OS to manage and switch between processes efficiently.
4. What is a thread? What are the benefits of multithreaded programming? Explain the many-to-many thread model.
Thread: A thread is the smallest unit of CPU execution within a process. Benefits of multithreaded programming:
Improved responsiveness
Resource sharing
Economy of scale
Better system utilization
Many-to-Many Thread Model: Allows many user-level threads to be mapped to many kernel threads, providing flexibility and efficient resource use.
5. Differentiate between a thread and a process. Give two advantages of a thread over multiple processes.
Thread: Lightweight, shares process resources, faster context switch. Process: Heavyweight, has its own memory space, slower context switch. Advantages of threads:
Lower overhead for creation and management
Faster communication due to shared memory space
6. What is meant by a process? Explain the mechanism for process creation and process termination by the operating system.
Process: An instance of a program in execution. Process Creation: Initiated by system calls (e.g., fork()), allocates resources, assigns PID. Process Termination: Occurs when process finishes execution or is killed; OS deallocates resources and removes PCB.
7. Describe the actions taken by the kernel to switch content between processes.
Description: A process moves from Start to Ready, then to Running. If waiting for I/O, it goes to Blocked. After completion, it moves to Terminated.
9. Mention and explain the transitions of states in the process state diagram.
New to Ready: Process admitted to ready queue.
Ready to Running: Scheduler selects process for execution.
Running to Blocked: Process waits for I/O or event.
Blocked to Ready: I/O or event completes.
Running to Ready: Preemption by scheduler.
Running to Terminated: Process finishes execution.
10. What are the differences between user-level threads and kernel-level threads? Under what circumstances is one better than the other?
User-level threads: Managed by user libraries, fast context switch, not visible to OS. Kernel-level threads: Managed by OS, slower context switch, better for multiprocessor systems. When to use: User-level threads are better for applications needing fast switching; kernel-level threads are better for true parallelism.
11. Describe the actions taken by the thread library to context switch between user-level threads.
Save current thread's context (registers, stack pointer)
Update thread control block
Select next thread to run
Restore next thread's context
Resume execution of the new thread
12. What is Interprocess Communication? Describe the types of Message Passing Systems. What is preemptive and non-preemptive scheduling?
Interprocess Communication (IPC): Mechanism for processes to communicate and synchronize. Message Passing Systems:
Direct: Processes communicate directly with each other.
Indirect: Communication via mailboxes or ports.
Preemptive Scheduling: OS can interrupt and switch processes. Non-preemptive Scheduling: Process runs until it voluntarily yields CPU.
13. What is TCB or PCB? Explain with a diagram.
PCB (Process Control Block): Data structure containing process information.
+----------------------+
| Process State |
| Process ID |
| Program Counter |
| CPU Registers |
| Memory Management |
| Accounting Info |
| I/O Status |
+----------------------+
TCB (Thread Control Block): Similar to PCB but for threads, stores thread-specific data.
14. How to create a child process from a parent process?
In UNIX-like systems, use the fork() system call. Example in C:
Social Plugin