Components of OS Flashcards
What is a Kernel?
The kernel is the core component of an operating system. It acts as a bridge between hardware and software, managing resources like CPU, memory, and devices.
What are the primary functions of a Kernel?
1) Process Management, 2) Memory Management, 3) Device Management, 4) File System Management, 5) System Calls, 6) Security and Access Control.
What are the types of Kernels?
1) Monolithic Kernel, 2) Microkernel, 3) Hybrid Kernel, 4) Exokernel, 5) Nanokernel.
What is a Monolithic Kernel?
A monolithic kernel runs all OS services (e.g., device drivers, file systems) in kernel space. Examples: Linux, Unix.
What is a Microkernel?
A microkernel runs minimal services (e.g., IPC, scheduling) in kernel space, with other services in user space. Examples: MINIX, QNX.
What is a Hybrid Kernel?
A hybrid kernel combines features of monolithic and microkernels. Examples: Windows NT, macOS XNU.
What is the difference between User Mode and Kernel Mode?
User Mode restricts direct hardware access for applications, while Kernel Mode allows privileged access to hardware and critical operations.
What is a System Call?
A system call is a request by a user program to the kernel for services like file I/O or process creation. Example: open()
, read()
, fork()
.
What is Process Management in the Kernel?
The kernel handles process creation, termination, scheduling, and context switching to manage CPU time and resources.
What is Memory Management in the Kernel?
The kernel allocates/deallocates memory, implements virtual memory (paging/swapping), and ensures memory protection between processes.
What is Virtual Memory?
Virtual memory allows the system to use disk space as an extension of RAM, enabling multitasking and preventing out-of-memory errors.
What is a Device Driver?
A device driver is kernel code that enables communication between the OS and hardware (e.g., printers, disks).
What is the role of the File System in the Kernel?
The kernel manages file creation, deletion, access permissions, and storage on disks (e.g., NTFS, ext4).
What is Inter-Process Communication (IPC)?
IPC allows processes to communicate using methods like pipes, shared memory, or message queues. Managed by the kernel.
What is a Context Switch?
A context switch is the process of saving the state of a running process and loading the state of another process. Managed by the kernel scheduler.
What are the components of an Operating System?
1) Kernel, 2) Process Manager, 3) Memory Manager, 4) File System, 5) Device Manager, 6) Security Module, 7) User Interface, 8) Networking.
What is the role of the Process Manager?
The Process Manager handles process creation, scheduling, termination, and synchronization (e.g., using semaphores or mutexes).
What is the role of the Memory Manager?
The Memory Manager allocates memory to processes, handles virtual memory, and prevents memory leaks or fragmentation.
What is the role of the Device Manager?
The Device Manager controls hardware devices via drivers, handles I/O requests, and ensures fair resource allocation.
What is the role of the Security Module?
The Security Module enforces user authentication, file permissions, encryption, and protection against malware.
What is the role of the User Interface (UI)?
The UI allows users to interact with the OS, either through a Graphical User Interface (GUI) or Command-Line Interface (CLI).
What is Thrashing in Memory Management?
Thrashing occurs when the system spends more time swapping pages between RAM and disk than executing processes, leading to performance degradation.
What is a Deadlock?
A deadlock occurs when two or more processes are blocked, waiting for resources held by each other. The four conditions are Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait.
What is the Banker’s Algorithm?
The Banker’s Algorithm is a deadlock avoidance algorithm that ensures safe resource allocation by simulating resource requests.
What is the difference between Preemptive and Non-Preemptive Scheduling?
Preemptive scheduling allows the OS to interrupt tasks (e.g., Round Robin), while Non-Preemptive tasks run to completion (e.g., FCFS).
What is a Zombie Process?
A zombie process is a terminated process that remains in the process table until its parent reads its exit status.
What is an Orphan Process?
An orphan process is a child process whose parent has terminated, and it is adopted by the init
process (PID 1).
Why is Linux considered a monolithic kernel?
Linux runs all OS services (device drivers, file systems) in kernel space for performance, but supports loadable modules for flexibility.
What is the role of the init
process?
The init
process (PID 1) is the first process started by the kernel and manages all other processes (e.g., starting/shutting down services).
What is a Daemon Process?
A daemon is a background process that provides services (e.g., httpd
for web servers). It has no controlling terminal.
What is the difference between a Process and a Thread?
A process has its own memory space, while a thread shares memory with other threads in the same process. Threads are managed by the kernel or user-space libraries.
What is the Global Interpreter Lock (GIL) in Python?
The GIL is a mutex that allows only one thread to execute Python bytecode at a time, limiting multithreading performance in CPU-bound tasks.
What is a Real-Time Operating System (RTOS)?
An RTOS guarantees timely task completion. Examples include VxWorks (used in aerospace) and FreeRTOS (embedded systems).
What is the role of the Bootloader?
The bootloader (e.g., GRUB) loads the kernel into memory during system startup and initializes hardware.
What is the /proc file system?
The /proc file system is a virtual file system in Linux that provides runtime system information (e.g., processes, hardware) in a hierarchical format.
What is Swap Space?
Swap space is a disk area used by the kernel to extend virtual memory when RAM is full. It stores inactive pages temporarily.