MODULE 1
1. Define Operating System and List Four Components of a
Computer System
An Operating System (OS) is system software that manages hardware
resources, provides services for application programs, and acts as an
intermediary between users and the computer hardware.
Four Components of a Computer System:
1. Hardware – Physical components such as CPU, memory, I/O
devices.
2. Operating System – Software that manages hardware and
software resources.
3. Application Software – Programs designed for users, e.g., web
browsers, games.
4. Users – People who interact with the computer system.
2. Operating System Functions with Examples
The OS performs the following functions:
1. Process Management – Manages CPU scheduling and multitasking
(e.g., Windows Task Manager).
2. Memory Management – Allocates and deallocates memory (e.g.,
Virtual Memory in Windows).
3. File System Management – Manages files and directories (e.g.,
NTFS, FAT32).
4. Device Management – Controls peripheral devices (e.g., printer
drivers).
5. Security & Protection – Manages user authentication (e.g., User
login in Linux).
6. Networking – Manages network connections (e.g., TCP/IP stack in
Windows).
7. User Interface – Provides GUI and CLI (e.g., Windows Desktop,
Linux Terminal).
3. Operating System Services with Examples
Operating system services provide useful functionalities such as:
1. Program Execution – Runs user programs (e.g., executing
Notepad.exe).
2. I/O Operations – Manages input/output (e.g., reading from a
keyboard).
3. File System Manipulation – Accesses and organizes files (e.g., file
renaming in Windows).
4. Error Detection & Handling – Identifies and corrects system
errors (e.g., Blue Screen in Windows).
5. Resource Allocation – Assigns CPU, memory, and storage (e.g.,
Task Scheduler).
6. Security & Protection – Controls access (e.g., File permissions in
Linux).
4. What is a System Call and Its Types
A System Call is an interface between a user application and the
operating system that allows access to OS services.
Types of System Calls:
1. Process Control – Create, terminate a process (e.g., fork(), exec()).
2. File Management – Read, write, close files (e.g., open(), close()).
3. Device Management – Request or release a device (e.g., ioctl()).
4. Information Maintenance – Get/set system time (e.g., getpid()).
5. Communication – Interprocess communication (e.g., socket()).
5. System Services with Examples
1. File Services – File operations (e.g., Windows Explorer).
2. Communication Services – Network management (e.g., Internet
Protocol stack).
3. Process Management Services – Handles processes (e.g., Task
Manager).
4. Memory Services – Manages RAM allocation (e.g., Paging in Linux).
5. Security Services – User authentication (e.g., Windows Login).
6. Define Linker and Loader with Diagram
Linker: Combines object files into a single executable.
Loader: Loads executable files into memory for execution.
Diagram:
Source Code → Compiler → Object Code → Linker → Executable File →
Loader → Memory Execution
7. Monolithic Architecture Diagram
A Monolithic Kernel is a single large program that includes all OS
functions.
Diagram:
-----------------------
| User Applications |
-----------------------
| System Calls |
-----------------------
| Monolithic Kernel (Includes Memory Mgmt, Process Mgmt, File Mgmt, I/O
Mgmt) |
-----------------------
| Hardware |
-----------------------
8. Layered Approach Architecture with Diagram
A Layered OS organizes OS into layers where each layer provides
services to the layer above.
Diagram:
-----------------------
| User Interface | (Layer 5)
-----------------------
| Application Layer | (Layer 4)
-----------------------
| Operating System | (Layer 3)
-----------------------
| Hardware Control | (Layer 2)
-----------------------
| Hardware | (Layer 1)
-----------------------
9. Microkernel Architecture with Diagram
A Microkernel OS minimizes kernel functions by handling essential
operations like IPC, memory, and process management.
Diagram:
-----------------------
| User Applications |
-----------------------
| Servers (File, I/O, Network) |
-----------------------
| Microkernel (IPC, Memory Mgmt, Process Mgmt) |
-----------------------
| Hardware |
-----------------------
10. Modular Operating System (MOS) Architecture
A Modular OS is divided into independent modules that can be
dynamically loaded.
Advantages:
Better maintainability
Higher flexibility
Disadvantages:
Overhead in module communication
Potential performance degradation
11. Compare Monolithic and Microkernel Architectures
Monolithic
Feature Microkernel
Kernel
Size Large Small
Performanc Slower due to IPC
Fast
e overhead
Stability Less stable More stable
Security Less secure More secure
Extensibilit
Difficult Easier to extend
y
12. Advantages and Disadvantages of Microkernel Architecture
Advantages:
Improved security
Easier to extend
Better fault isolation
Disadvantages:
Slower performance due to IPC overhead
Complex to implement
13. Concept of Microkernel Architecture
A Microkernel only includes essential OS services (e.g., memory
management, IPC). Other services run in user space.
Example OS: Minix, QNX.
14. Concept of File Management System
A File Management System (FMS) organizes, stores, and retrieves
files.
Functions of FMS:
File creation, modification, deletion
Directory management
File access control
Backup and recovery
MODULE 2
15. Process Control Block (PCB) and Its Key Fields
A Process Control Block (PCB) is a data structure maintained by the
operating system for every process, containing information needed to
manage the process.
Key Fields in PCB:
1. Process ID (PID) – Unique identifier for the process.
2. Process State – Current state (New, Ready, Running, Waiting,
Terminated).
3. Program Counter (PC) – Address of the next instruction to
execute.
4. CPU Registers – Stores values of registers.
5. Memory Management Information – Details about allocated
memory.
6. I/O Status Information – List of I/O devices allocated.
7. CPU Scheduling Information – Priority and scheduling queue
details.
16. Mechanisms for Inter-Process Communication (IPC)
IPC allows processes to communicate and synchronize their actions.
Types of IPC Mechanisms:
1. Shared Memory – Processes communicate via a common memory
space.
2. Message Passing – Processes exchange messages via
send/receive operations.
3. Pipes – Unidirectional or bidirectional data flow between processes.
4. Sockets – Communication over a network.
5. Signals – Asynchronous notifications sent to processes.
17. Characteristics of a Process
1. Unique Identifier – Each process has a PID.
2. Execution State – New, Ready, Running, Waiting, Terminated.
3. Scheduling Information – Priority, time slice.
4. Resource Allocation – Uses memory, CPU, and I/O resources.
5. Concurrency – Can be executed in parallel with other processes.
18. Process States with Diagram
A process undergoes different states during execution.
Process State Diagram:
sql
CopyEdit
New → Ready → Running → (Waiting or Terminated)
Waiting → Ready
New – Process is created.
Ready – Waiting for CPU.
Running – Currently executing.
Waiting – Waiting for I/O.
Terminated – Process is finished.
19. Concept of IPC
Inter-Process Communication (IPC) enables communication between
processes to share data and synchronize execution.
Methods:
Shared Memory (efficient, requires synchronization)
Message Passing (more secure, but slower)
20. Shared Memory vs. Message Passing
Shared Message
Feature
Memory Passing
Speed Faster Slower
Synchronizati
Required Built-in
on
Complexity High Low
Security Less secure More secure
21. Long-Term vs. Short-Term Scheduler
Feature Long-Term Scheduler Short-Term Scheduler
Selects which processes to Selects which process runs
Function
admit next
Frequenc
Infrequent Very frequent
y
Speed Slow Fast
Controls degree of
Scope Controls CPU execution
multiprogramming
22. Semaphores and Their Role in Process Synchronization
A Semaphore is a synchronization mechanism to control process access
to shared resources.
Types:
1. Binary Semaphore (Mutex) – Takes values 0 or 1.
2. Counting Semaphore – Allows multiple accesses.
Role: Prevents race conditions, ensures mutual exclusion.
23. Critical Section Problem
A critical section is a part of a program where shared resources are
accessed.
Conditions for a solution:
1. Mutual Exclusion – Only one process in the critical section.
2. Progress – No unnecessary waiting.
3. Bounded Waiting – A process gets a turn eventually.
24. Concept of Monitors for Process Synchronization
A Monitor is a high-level synchronization construct that encapsulates
shared resources, allowing only one process to access them at a time.
Components:
Data variables
Entry procedures (to access resources)
Condition variables (to handle waiting processes)
25. The calculated results for Priority Scheduling are:
Average Waiting Time (AWT): 10.2 units
Average Turnaround Time (TAT): 16.0 units
26. FCFS (First-Come, First-Served) Scheduling
Average Waiting Time (AWT): 4.75 units
Average Turnaround Time (TAT): 8.0 units
27. Round Robin (Time Quantum = 2) Scheduling
Average Waiting Time (AWT): 19.2 units
Average Turnaround Time (TAT): 25.2 units
28. SJF (Shortest Job First) Scheduling
Average Waiting Time (AWT): 3.0 units
Average Turnaround Time (TAT): 8.5 units
29. FCFS vs. SJF Comparison
Feature FCFS SJF
Basis First process arrives first Shortest job first
Type Non-preemptive Can be preemptive or non-preemptive
Waiting Time Can be high (convoy effect) Lower on average
Starvation No Yes (long processes may starve)
MODULE 3
30. Page Frames and Page Tables
Page Frame: A fixed-size block of physical memory in which a
process's pages are loaded.
Page Table: A data structure that maps logical addresses to
physical addresses, translating a program's virtual pages to physical
frames.
31. Fixed and Variable Partitioning
Fixed Partitioning: Memory is divided into fixed-size partitions,
leading to internal fragmentation.
Variable Partitioning: Partitions are created dynamically based on
process size, reducing fragmentation but leading to external
fragmentation.
32. Address Space and Memory Space
Address Space: The range of addresses a process can use (logical
addresses).
Memory Space: The actual physical memory available in the
system.
33. Page Faults
A page fault occurs when a process tries to access a page that is not in
memory, causing the OS to load it from disk.
34. Logical Address vs. Physical Address
Feature Logical Address Physical Address
Definition Address generated by the Actual address in RAM
Feature Logical Address Physical Address
CPU
Accessibilit Managed by hardware
Used by programs
y (MMU)
Translation Requires page table Directly used in memory
35. Multiple Partition Allocation
Allocates memory dynamically to processes.
Can use strategies like Best Fit, Worst Fit, and First Fit for
partitioning.
36. Contiguous Memory Allocation
Allocates a single block of memory to each process.
Can suffer from external fragmentation.
37. Demand Paging
Pages are loaded into memory only when required.
Reduces memory usage but can cause page faults.
38. FIFO (First-In-First-Out) Page Replacement Algorithm
Replaces the oldest page when a new one needs space.
Simple but may lead to Belady’s Anomaly (higher frames, more
faults).
39. Thrashing and Its Impact
Thrashing occurs when excessive page swapping reduces CPU
performance.
Causes: Insufficient memory, too many processes, poor page
replacement policy.
Impact: High disk usage, low CPU efficiency.
40. Memory Protection via Segmentation and Paging
Segmentation: Divides memory into variable-size segments
with access control.
Paging: Ensures processes can only access their allocated
pages, preventing unauthorized access.
41. FIFO (First-In-First-Out) Page Replacement
Given:
Page Reference String: 1, 3, 0, 3, 5, 6, 3
Number of Page Frames: 3
FIFO Rule: The oldest page in the frame gets replaced when a new page
needs space.
Step-by-Step Table
Ste Referen Page
Frame 1 Frame 2 Frame 3
p ce Fault?
1 1 1 - - Yes
2 3 1 3 - Yes
3 0 1 3 0 Yes
4 3 1 3 0 No
5 (1
5 5 3 0 Yes
removed)
6 (3
6 6 5 0 Yes
removed)
3 (0
7 3 5 6 Yes
removed)
Total Page Faults: 6
42. Optimal Page Replacement Algorithm
Given:
Page Reference String: 6, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3
Number of Page Frames: 4
Optimal Rule: Replace the page that will not be used for the longest
time in the future.
Step-by-Step Table
Ste Referen Frame Frame Frame Page
Frame 1
p ce 2 3 4 Fault?
1 6 6 - - - Yes
2 0 6 0 - - Yes
3 1 6 0 1 - Yes
4 2 6 0 1 2 Yes
5 0 6 0 1 2 No
3 (6
6 3 0 1 2 Yes
removed)
7 0 3 0 1 2 No
4 (1
8 4 0 3 2 Yes
removed)
9 2 4 0 3 2 No
10 3 4 0 3 2 No
11 0 4 0 3 2 No
12 3 4 0 3 2 No
13 2 4 0 3 2 No
14 3 4 0 3 2 No
Total Page Faults: 6
43. LRU (Least Recently Used) Page Replacement Algorithm
Given:
Page Reference String: 6, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 3
Number of Page Frames: 4
LRU Rule: Replace the page that has not been used for the longest
time.
Step-by-Step Table
Ste Referen Frame Frame Frame Page
Frame 1
p ce 2 3 4 Fault?
1 6 6 - - - Yes
2 0 6 0 - - Yes
3 1 6 0 1 - Yes
4 2 6 0 1 2 Yes
5 0 6 0 1 2 No
3 (6
6 3 0 1 2 Yes
removed)
7 0 3 0 1 2 No
4 (1
8 4 0 3 2 Yes
removed)
9 2 4 0 3 2 No
10 3 4 0 3 2 No
11 0 4 0 3 2 No
12 3 4 0 3 2 No
13 2 4 0 3 2 No
14 3 4 0 3 2 No
Total Page Faults: 6
44. LRU (Least Recently Used) Page Replacement Algorithm
Keeps track of when each page was last used.
When a new page is needed, the least recently used page is
replaced.
Advantage: More efficient than FIFO.
Disadvantage: Requires extra tracking overhead (timestamps
or stack method).
Final Summary
Algorith Page
m Faults
FIFO 6
Optimal 6
LRU 6
MODULE 4
45. Types of File Organizations
File organization refers to how files are arranged on storage media. The
main types are:
1. Sequential File Organization
o Records are stored one after another in order.
o Example: Log files, tape storage.
o Advantage: Simple and efficient for sequential access.
o Disadvantage: Slow for random access.
2. Direct (or Hashed) File Organization
o Uses a hash function to store records in specific locations.
o Example: Databases using hashing for quick lookups.
o Advantage: Fast retrieval.
o Disadvantage: Collisions may require overflow handling.
3. Indexed File Organization
o Uses an index table to locate records.
o Example: Library catalogs.
o Advantage: Fast access.
o Disadvantage: Requires extra space for the index.
4. Clustered File Organization
o Similar records are stored together.
o Example: B+ trees in databases.
o Advantage: Improves access speed for related data.
o Disadvantage: More complex management.
46. Difference Between Single-Level Directory and Hierarchical
Directory
Single-Level
Feature Hierarchical Directory
Directory
Flat, all files in one
Structure Tree-like, with subdirectories
directory
Organizatio Simple, easy to Complex, allows better file
n implement management
All files must have Files in different directories can have
Naming
unique names the same name
Access Can have different access permissions
Limited
Control for different directories
47. Indexed Allocation
Each file has an index block that stores pointers to data blocks.
Example: File Allocation Table (FAT).
Advantages
Fast random access.
No external fragmentation.
Disadvantages
Extra space needed for index blocks.
Overhead in managing index blocks.
48. Basic Operations on Files
1. Create – Making a new file.
2. Open – Accessing an existing file.
3. Read – Retrieving data from a file.
4. Write – Modifying or adding data.
5. Close – Releasing file resources.
6. Delete – Removing a file.
7. Seek – Moving to a specific position in a file.
49. Difference Between Opening and Closing a File
Action Description
Opening a Loads file metadata into memory, prepares file for read/write
File operations.
Closing a
Saves changes, updates metadata, releases resources.
File
50. Access Control Mechanisms
1. User-based Access Control (Owner, Group, Others) – Used in
UNIX/Linux.
2. Role-based Access Control (RBAC) – Permissions are assigned
based on roles.
3. Access Control Lists (ACLs) – Specifies individual user
permissions.
51. Advantages and Disadvantages of Contiguous Allocation
Advantages:
Fast sequential and direct access.
Simple implementation.
Disadvantages:
External fragmentation.
Difficult to resize files.
52. I-Node in File System
Stores file metadata (size, owner, permissions, pointers to data
blocks).
Advantage: Efficient management of files.
Example: UNIX/Linux file systems.
53. Steps for File Creation & Deletion
Creating a File:
1. Allocate disk space.
2. Create an entry in the directory.
3. Initialize metadata.
Deleting a File:
1. Remove the directory entry.
2. Free the disk space.
3. Update metadata.
54. SCAN Scheduling Calculation
Given Requests: 12, 34, 52, 14, 25, 68, 39
Initial Position: 53
Tracks: 90
Process:
SCAN moves in one direction first (e.g., toward 0), then reverses.
Movement Order: 52 → 39 → 34 → 25 → 14 → 12 → (Direction
Change) → 68
Total Head Movement: 103 tracks
55. FCFS (First Come First Serve) Scheduling Calculation
Given Requests: 12, 34, 52, 14, 25, 68, 39
Initial Position: 53
Process:
Process requests in the given order: 12 → 34 → 52 → 14 → 25 → 68
→ 39
Total Head Movement: 185 tracks
56. C-SCAN Scheduling Calculation
Given Requests: 12, 34, 52, 14, 25, 68, 39
Initial Position: 53
Process:
Moves in one direction, reaches end (90), jumps back to start (0),
then continues.
Movement Order: 52 → 68 → (Jump to 0) → 12 → 14 → 25 → 34 →
39
Total Head Movement: 129 tracks
57. Difference Between SCAN and C-SCAN
Feature SCAN C-SCAN
Moves in one direction, then
Movement Moves in both directions
jumps to start
Better than FCFS but still
Efficiency More uniform waiting times
inefficient
Response
Varies for different requests More consistent
Time
58. File Attributes
Metadata about a file.
Examples: Name, Size, Creation Date, Permissions, Last Modified.
59. File Locking
Ensures data consistency in multi-user systems.
Types:
1. Shared Lock: Allows multiple reads.
2. Exclusive Lock: Only one process can modify the file.
MODULE 5
60. Main Threats to Operating System Security
1. Malware (Viruses, Worms, Trojans) – Harmful software that can
steal or destroy data.
2. Phishing Attacks – Tricks users into revealing sensitive
information.
3. Unauthorized Access – Hackers or malicious users gaining control
of the system.
4. Denial of Service (DoS) Attacks – Overloading system resources
to cause failure.
5. Privilege Escalation – Exploiting vulnerabilities to gain higher
access rights.
6. Rootkits – Malicious software that hides its presence and control.
7. Data Breaches – Unauthorized access leading to data theft.
8. Social Engineering – Manipulating users to bypass security.
9. Zero-Day Vulnerabilities – Security flaws exploited before a fix is
available.
61. Importance of User Authentication in OS Security
Ensures only authorized users can access the system.
Protects sensitive data and resources.
Prevents identity theft and unauthorized modifications.
Common methods: Passwords, Multi-Factor Authentication (MFA),
Biometrics.
62. Difference Between Discretionary Access Control (DAC) and
Mandatory Access Control (MAC)
Discretionary Access Mandatory Access Control
Feature
Control (DAC) (MAC)
Control User or owner decides access System enforces strict rules
Flexibility More flexible Highly restrictive
Security
Lower security Higher security
Level
Military and government
Example Windows NTFS permissions
systems
63. Main Advantage of Using an Open-Source OS
Transparency & Security: Users can inspect and modify the code
to fix vulnerabilities.
Cost-Effective: Usually free to use.
Customization: Users can tailor the OS to their needs.
Community Support: Large communities provide updates and
support.
64. How Encryption Helps to Protect Data in an OS
Converts readable data into unreadable form.
Prevents unauthorized access even if data is stolen.
Types of Encryption:
1. Symmetric Encryption (AES, DES) – Same key for
encryption and decryption.
2. Asymmetric Encryption (RSA, ECC) – Uses a public and
private key.
3. Disk Encryption (BitLocker, LUKS) – Secures entire storage
drives.
65. How Firewalls Protect a Computer System
Monitors and filters incoming and outgoing traffic.
Prevents unauthorized access by blocking suspicious activity.
Types of Protection:
o Blocks malicious IP addresses.
o Restricts access to certain applications.
o Stops malware from spreading.
66. Comparison of Different Types of Firewalls
Firewall Type Description Example
Packet Filtering Filters packets based on rules iptables (Linux)
Firewall Type Description Example
Stateful Windows Defender
Tracks connection state
Inspection Firewall
Intermediary between user and
Proxy Firewall Squid Proxy
network
Next-Gen Includes Deep Packet Inspection,
Palo Alto Networks
Firewall (NGFW) Intrusion Prevention
67. Concept of Security Policies and Their Importance
Security policies are rules defining how a system is protected.
Importance:
o Prevents security breaches.
o Ensures compliance with regulations (e.g., GDPR, HIPAA).
o Defines user roles and access permissions.
68. Concept of Security Hardening
Security hardening means strengthening a system to reduce
vulnerabilities.
Examples:
o Disabling unused services.
o Applying security patches.
o Implementing strong authentication.
o Using secure boot mechanisms.
69. Concept of a Linux Distribution
A Linux distribution (distro) is a packaged OS version that
includes:
o Linux kernel.
o System utilities.
o Software applications.
o Package manager.
Examples: Ubuntu, Fedora, Debian, Arch Linux.
70. Comparison of Windows and Linux File System Structures
Windows (NTFS,
Feature Linux (EXT4, XFS, Btrfs)
FAT32)
File Structure Drive letters (C:, D:) Single root ("/")
Case
Not case-sensitive Case-sensitive
Sensitivity
File Basic user Advanced permissions (chmod,
Permissions permissions chown)
NTFS supports Most Linux file systems support
Journaling
journaling journaling
71. Role of the Kernel in Windows and Linux
The kernel is the core of the OS, managing hardware and system
resources.
Feature Windows Kernel Linux Kernel
Type Hybrid kernel Monolithic kernel
Flexibility Proprietary, closed-source Open-source, customizable
Integrated with Windows More control over security
Security
security features mechanisms
Performanc Optimized for Windows Highly customizable for
e software different workloads