1. Explain the Paging hardware architecture with a diagram.
Paging Hardware Architecture – Simple Explanation
Paging is a memory-management technique where physical memory is divided into
fixed-size blocks called frames, and logical memory is divided into pages.
Components:
1. Logical Address (Generated by CPU)
○ Consists of:
■ Page Number (p) – index into the page table
■ Offset (d) – location within the page
2. Page Table
○ Maps each page number to its corresponding frame number in physical
memory.
3. MMU (Memory Management Unit)
○ Hardware device that converts logical address → physical address using the
page table.
4. Physical Memory
○ Contains frames where actual data is stored.
How Address Translation Works:
1. CPU generates a logical address = (p, d)
2. MMU looks up page table[p] to get the frame number (f)
3. Physical address = (frame number f + offset d)
Advantages:
● Eliminates external fragmentation
● Easy swapping
● Efficient memory utilization
Disadvantages:
● Page table lookup increases overhead
● Uses more hardware (MMU, page table)
2. Discuss the Optimal and LRU Page Replacement Algorithms with a reference string example.
Reference String (Example):
701203042303
Assume 3 frames.
A) Optimal Page Replacement Algorithm (OPT)
Replaces the page that will not be used for the longest time in the future.
Steps:
● Look ahead into the future
● Choose the page that will appear later than others
Why is it optimal?
Because it gives minimum page faults.
With our reference string → Page Faults = 7 (for example)
B) LRU (Least Recently Used) Page Replacement Algorithm
Replaces the page that was least recently used in the past.
Steps:
● Track recent usage
● Replace the oldest used page
Reasoning:
LRU approximates OPT but uses past information instead of future.
Page Faults for same reference string → around 9
3. Explain the various File Allocation Methods (Contiguous, Linked, Indexed).
1. Contiguous Allocation
How it works:
● Each file occupies continuous blocks in memory.
Advantages:
● Fast access
● Easy to read sequentially
Disadvantages:
● Causes external fragmentation
● Difficult to grow a file
2. Linked Allocation
How it works:
● Each file is a linked list of blocks scattered anywhere on the disk.
● Each block contains:
○ Data
○ Pointer to next block
Advantages:
● No external fragmentation
● File size can grow dynamically
Disadvantages:
● Pointer overhead
● Slow random access
● Risk of pointer corruption
3. Indexed Allocation
How it works:
● OS creates an index block containing all block numbers of the file.
● No pointers inside data blocks.
Advantages:
● Fast random access
● No external fragmentation
Disadvantages:
● Size of index block limits file size (unless multilevel indexing is used)
4. Discuss the different Disk Scheduling Algorithms (FCFS, SSTF, SCAN, C-SCAN)
with examples.
Assume the disk head starts at 50, and requests are:
82, 170, 43, 140, 24, 16, 190
1. FCFS (First Come First Serve)
Working:
● Serve requests in the order they arrive.
Advantages:
● Fair
● Simple
Disadvantages:
● Long seek time
2. SSTF (Shortest Seek Time First)
Working:
● Choose the request closest to the current head.
Advantages:
● Reduces seek time
Disadvantages:
● May cause starvation
3. SCAN (Elevator Algorithm)
Working:
● Head moves in one direction, servicing requests, then reverses direction.
Advantages:
● Less starvation
● Better performance than FCFS
4. C-SCAN (Circular SCAN)
Working:
● Head moves in one direction only.
● After reaching the end, jumps back to start without servicing.
Advantages:
● More uniform waiting time
5. Explain the various Program Threats (Trojan Horse, Trap Door, Logic Bomb).
1. Trojan Horse
Meaning:
A malicious program disguised as a legitimate one.
Features:
● User thinks it is safe
● Hidden malicious actions run in background
Example:
A game that secretly steals passwords.
2. Trap Door (Backdoor)
Meaning:
A hidden entry point into a program that bypasses authentication.
Features:
● Inserted by developers or attackers
● Allows unauthorized access
Example:
A developer adds a secret login in software.
3. Logic Bomb
Meaning:
Malicious code triggered by a specific event, date, or condition.
Examples:
● Deletes files on a particular date
● Activates when an employee is fired
Danger:
Very hard to detect until triggered.
6. Describe the concept of Cryptography as a security tool (Symmetric vs Asymmetric).
What is Cryptography?
Cryptography is the technique of protecting information by converting it into an unreadable
form (encryption), and later converting it back (decryption).
It ensures:
● Confidentiality – data is secret
● Integrity – data is not changed
● Authentication – verifies identity
● Non-repudiation – sender cannot deny sending the message
Types of Cryptography
A) Symmetric Key Cryptography
Meaning
● Uses one single key for both encryption and decryption.
● Also called Secret Key Cryptography.
Examples
● AES
● DES
● RC5
Advantages
● Very fast
● Suitable for large amounts of data
Disadvantages
● Key sharing is difficult
● If key is leaked → entire system is compromised
B) Asymmetric Key Cryptography
Meaning
● Uses two keys:
○ Public Key → for encryption
○ Private Key → for decryption
Examples
● RSA
● ECC
● Diffie-Hellman
Advantages
● Secure key exchange
● Supports digital signatures
Disadvantages
● Slow
● Not suitable for encrypting large files
Difference between Symmetric and Asymmetric Cryptography
Feature Symmetric Asymmetric
Number of keys 1 shared key 2 keys (public + private)
Speed Very fast Slower
Usage Data encryption Key exchange, authentication
Security Key must be shared secretly More secure due to key pairs
7. Explain the concept of Virtual Memory and how it is implemented.
What is Virtual Memory?
Virtual Memory is a technique that allows the system to use secondary storage (hard disk)
as an extension of RAM.
This gives the illusion that the system has more memory than physically available.
Why do we need Virtual Memory?
● To run large programs
● To allow multiple processes to run simultaneously
● To avoid memory shortage
How is Virtual Memory Implemented?
1. Paging
● Logical memory is divided into pages.
● Physical memory is divided into frames.
● When RAM is full, pages are moved to disk (swap space).
2. Page Table
● Keeps track of which page is stored in which frame.
3. Page Fault
Occurs when the required page is not in RAM.
Steps:
1. OS pauses the process
2. Loads required page from disk to RAM
3. Updates page table
4. Process continues
Advantages
● Can run programs larger than RAM
● Efficient multitasking
● Avoids memory overflow
Disadvantages
● More page faults → system slows down
● Disk access is much slower than RAM
8. Describe the structure of a Page Table (Hierarchical, Hashed, and Inverted).
A Page Table stores mappings of page numbers → frame numbers.
A) Hierarchical Page Table (Multilevel Page Table)
Meaning
Instead of one big page table, it is divided into levels:
● Level 1 page table
● Level 2 page table
● … etc.
Why?
To save memory.
Advantages
● Reduces size of page table
● Good for large address spaces
Disadvantages
● Address translation becomes slower
B) Hashed Page Table
Meaning
A hash function is used to map virtual page numbers to physical frames.
Structure
● Each hash bucket contains a linked list of entries with:
○ Virtual page number
○ Frame number
○ Pointer to next entry
Advantages
● Efficient for very large address spaces
● Fast lookup
Disadvantages
● Collisions may occur
● Linked-list traversal increases time
C) Inverted Page Table
Meaning
Instead of having one entry per virtual page, it has one entry per physical frame.
Structure
Each entry stores:
● Process ID
● Virtual page number
● Frame number
Advantages
● Very small page table size
● Good for large physical memory
Disadvantages
● Searching is slow
● Requires hashing to speed up lookup
9. Describe the RAID structure and detailed levels (RAID 0, 1, 5).
RAID = Redundant Array of Independent Disks
Used for performance, backup, and fault tolerance.
RAID 0 – Striping
How it works
Data is split across multiple disks.
Advantages
● Very fast performance
● Good for high-speed operations
Disadvantages
● No fault tolerance
● If one disk fails → all data is lost
RAID 1 – Mirroring
How it works
Data is duplicated on two or more disks.
Advantages
● High fault tolerance
● If one disk fails, data is safe
Disadvantages
● Storage cost doubles
● Slower write performance
RAID 5 – Striping with Parity
How it works
● Data is striped across disks
● Parity block stored on one disk for error recovery
● Requires minimum 3 disks
Advantages
● Good balance of speed + fault tolerance
● Efficient storage
Disadvantages
● Rebuilding a failed disk takes time
● Slower write operations
10. Explain the free-space management techniques (Bit Vector, Linked List, Grouping).
The OS needs to track which disk blocks are free and which are allocated.
1. Bit Vector (Bitmap)
How it works
Each block has a bit:
● 0 → free
● 1 → allocated
Advantages
● Very efficient
● Easy to find free blocks
Disadvantages
● Bitmap itself might be large
2. Linked List
How it works
All free blocks are linked together in a linked list.
Advantages
● Easy to manage
● No need for large memory
Disadvantages
● Slow to traverse
● Random access is difficult
3. Grouping
How it works
First free block contains the addresses of next n free blocks.
Advantages
● Reduces traversal time
● More efficient than simple linked list
Disadvantages
● Still slower than bitmaps
11. Discuss the Protection Rings and Domain of Protection.
A) Protection Rings
Protection Rings are layers of privilege in an operating system.
They prevent users/programs from accessing critical system areas.
Rings:
1. Ring 0 (Kernel Mode)
○ Highest privilege
○ Can execute any instruction
○ OS kernel, device drivers
2. Ring 1 (System Services)
○ Handles OS-level services like file systems
3. Ring 2 (OS Utilities / Device Drivers)
4. Ring 3 (User Mode)
○ Lowest privilege
○ User applications run here
Why do we use Rings?
● Prevent accidental or malicious system damage
● Provide controlled access to hardware
● Maintain OS security
B) Domain of Protection
A domain is a set of resources (files, devices, memory) and access rights granted to a
process.
Key points:
● Each process has a domain
● OS ensures a process only accesses what it is allowed
● Domains can switch during execution (e.g., system call → user mode to kernel mode)
Access rights include:
● Read
● Write
● Execute
● Create / Delete
Goal of Domain Protection:
● Prevent unauthorized access
● Ensure program safety
● Maintain system reliability
12. Discuss the implementation of the Access Matrix and Revocation of Access Rights.
A) Access Matrix
The Access Matrix is a security model used to specify which subjects (users/processes) can
perform which operations on which objects (files/devices).
Structure:
File File B Printer
A
User R,W R —
1
User 2 R R,W X
Where:
● Rows = Subjects (users)
● Columns = Objects (files, printers)
● Cells = Access rights (R, W, X, Delete)
Implementation techniques:
1. Access Control List (ACL)
○ Attached to each object
○ Lists which users can access it
2. Capability List
○ Attached to each user/process
○ Lists objects and access rights
B) Revocation of Access Rights
Revocation means removing previously granted permissions.
Types of Revocation:
1. Immediate Revocation
○ Rights removed instantly
○ Most common type
2. Delayed Revocation
○ Rights removed after a certain time or event
3. Selective Revocation
○ Remove rights from specific users only
4. Total Revocation
○ Remove rights from all users
5. Temporary Revocation
○ Rights removed temporarily and restored later
Purpose:
● Maintain security
● Prevent misuse
● Handle departing employees or inactive users
13. Discuss Contiguous Memory Allocation methods (First-fit, Best-fit, Worst-fit).
Contiguous allocation means each process gets one continuous block of memory.
1. First-Fit Allocation
Working:
● Allocates the first available block that is large enough.
Advantages:
● Fastest
● Simple implementation
Disadvantages:
● Creates many small leftover holes
2. Best-Fit Allocation
Working:
● Chooses the smallest free block that fits the process.
Advantages:
● Minimizes wasted space inside a block
Disadvantages:
● Creates many tiny unusable fragments
● Slower than First-fit (search required)
3. Worst-Fit Allocation
Working:
● Allocates the largest free block available.
Advantages:
● Reduces fragmentation by leaving bigger chunks free
Disadvantages:
● May waste large memory blocks
● Generally not preferred
14. Explain the concept of Segmentation with Paging.
Segmentation and paging are combined to get the benefits of both.
Segmentation: Divides program into logical units:
● Code
● Data
● Stack
Each with different sizes.
Problem
Segmentation suffers from external fragmentation.
Paging : Divides memory into fixed-size pages and frames.
Solution
Paging removes fragmentation but does not support logical division.
Segmentation + Paging (Hybrid Model)
How it works:
1. Program is divided into segments
2. Each segment is further divided into pages
3. OS maintains:
○ Segment Table → points to page tables
○ Page Table → maps pages to frames
Advantages:
● Logical division of segmentation
● No external fragmentation (due to paging)
● Efficient memory utilization
Disadvantages:
● More complex
● Requires two table lookups
15. Explain directory implementation methods (Linear List, Hash Table).
1. Linear List Directory
Structure:
Directory entries are stored in a simple list.
Advantages:
● Easy to implement
● Good for small directories
Disadvantages:
● Searching is slow (O(n))
● Insertion and deletion take time
2. Hash Table Directory
Structure:
Uses a hash function to convert file names to hash values.
Advantages:
● Very fast search (O(1))
● Efficient for large directories
Disadvantages:
● Collisions may occur
● Hash table needs resizing
● More complex than linear list
16. Discuss File System Architecture and file system operations.
File System Architecture Layers
1. Application Layer
○ Programs request file operations (open, read, write)
2. Logical File System
○ Handles file names, directories, protection
○ Manages metadata
3. File Organization Module
○ Maps logical blocks to physical blocks
4. Basic File System
○ Communicates with disk drivers
○ Issues block read/write commands
5. I/O Control Layer
○ Device drivers + interrupt handlers
6. Hardware Layer (Disk)
○ Actual storage devices
Common File System Operations
1. File Creation
OS allocates space and updates directory.
2. File Opening
Loads metadata into memory.
3. File Reading
Transfers data from disk → memory.
4. File Writing
Transfers data from memory → disk.
5. File Deletion
Frees blocks + removes directory entry.
6. File Truncation
Contents removed but file exists.
17. Explain User Authentication Methods (Passwords, Biometrics, Smart Cards).
1. Password Authentication
How it works:
User enters a secret password.
Advantages:
● Simple
● Cheap
Disadvantages:
● Can be guessed, stolen, or cracked
● Vulnerable to phishing and brute force attacks
2. Biometrics
Examples:
● Fingerprint
● Face recognition
● Iris scan
● Voice matching
Advantages:
● Very secure
● Hard to fake
Disadvantages:
● Expensive
● Privacy concerns
● Cannot be changed if compromised
3. Smart Cards
How it works:
Plastic cards with a microchip that stores user credentials.
Advantages:
● Highly secure
● Portable
● Supports multi-factor authentication
Disadvantages:
● Can be lost or stolen
● Requires special hardware
18. Analyze the security features and case study of Windows 10.
Windows 10 includes multiple built-in security features.
A) Key Security Features in Windows 10
1. Windows Defender Antivirus
● Real-time protection
● Malware detection
● Cloud-based threat analysis
2. Windows Firewall
● Controls incoming & outgoing traffic
● Prevents unauthorized network access
3. Secure Boot
● Prevents malware from loading during startup
● Ensures only trusted OS components run
4. BitLocker Drive Encryption
● Encrypts entire disk
● Protects data even if device is stolen
5. Windows Hello
● Password-free login using:
○ Fingerprint
○ Face recognition
6. User Account Control (UAC)
● Prevents unauthorized changes
● Requests permission for admin-level actions
7. Device Guard / Credential Guard
● Uses virtualization to protect passwords & system files
B) Case Study: How Windows 10 Prevents Attacks
Scenario: Ransomware Attack
Windows 10 uses:
1. Controlled Folder Access
○ Blocks unauthorized programs from modifying files
2. Defender Cloud Detection
○ Detects new ransomware variants using AI
3. BitLocker Encryption
○ Protects files even if ransomware steals data
4. Automatic Updates
○ Patches new vulnerabilities quickly
Result:
Windows 10 significantly limits ransomware damage and improves overall system security.