Operating Systems Core Concepts
Welcome to this comprehensive module on essential operating system concepts. This course is designed for computer‑science students and professionals who want to deepen their understanding of…

In a system using three‑level cache (L1, L2, L3), which cache level typically has the largest capacity but also the highest latency?
A page fault occurs when:
Which scheduling algorithm guarantees the minimum average waiting time for a set of jobs with known burst times?
In the Linux file permission string "-rwxr-xr--", which of the following statements is correct?
When a hard disk rotates at 10 000 rpm, what is the average rotational latency?
Which of the following best describes the purpose of the Translation Look‑aside Buffer (TLB) in a virtual memory system?
In a Unix‑like system, what is the effect of the command "chmod 644 file.txt"?
Which of the following statements about the "nice" command is true on Linux?
During a context switch, which of the following components must be saved in the Process Control Block (PCB)?
In a system employing simple paging with 4 KB pages, how many pages are needed to store a 72 KB process (ignore internal fragmentation)?
Which of the following best explains why a process may be blocked (as opposed to waiting) in a multitasking system?
When a Linux system boots, which of the following components is the first user‑space process started by the kernel?
Which of the following statements about virtual memory is FALSE?
In a Unix file system, what is the purpose of the inode?
Which of the following best describes the effect of the "nice" value -20 on a user‑space process?
When using the "ps" command, which column indicates the percentage of CPU time a process is currently using?
Which of the following statements about the "FIFO" page replacement algorithm is correct?
In a Linux system, what does the command "chmod u+x script.sh" accomplish?
Which of the following best explains the purpose of the "swap" partition in Linux?
When a process performs a "write" system call, which of the following components is primarily responsible for buffering the data before it reaches the physical disk?
Which of the following statements about the "nice" and "renice" commands is FALSE?
In a Unix-like system, which of the following is true about symbolic links?
Operating Systems Core Concepts
Welcome to this comprehensive module on essential operating system concepts. This course is designed for computer‑science students and professionals who want to deepen their understanding of process management, memory hierarchy, scheduling, file permissions, and more. Each section expands on a quiz question, providing clear explanations, memorable mnemonics, and practical examples to help you retain the material.
1. Process Creation and Copy‑On‑Write (COW)
When a process calls fork(), the operating system creates a child process that appears to have an identical address space. However, duplicating every memory page would be wasteful. Modern kernels use the copy‑on‑write technique.
- Initial Sharing: Both parent and child share the same physical pages. These pages are marked read‑only.
- Write Trigger: If either process attempts to modify a shared page, the kernel allocates a private copy for that process.
- Result: Each process perceives a full copy of memory, but physical memory is only duplicated when necessary.
Mnemonic: COW = Copy‑On‑Write, Both Share Until Write. Imagine two twins wearing the same outfit (shared pages) – they only get their own clothes when one spills something (writes).
2. Cache Hierarchy: L1, L2, and L3
Modern CPUs employ a multi‑level cache to bridge the speed gap between the processor and main memory. Understanding the role of each level is crucial for performance tuning.
- L1 Cache: Smallest (typically 32‑64 KB), fastest, located directly on the core.
- L2 Cache: Medium size (256 KB‑2 MB), slightly higher latency, shared per core or per a small group of cores.
- L3 Cache: Largest (several MB up to tens of MB), highest latency, shared across all cores on the chip.
Mnemonic: “Big & Slow = L3”. Think of a library: the reference desk (L1) is tiny but you get answers instantly; the back‑room stacks (L3) hold the most books but you have to walk farther.
3. Page Faults
A page fault occurs when a process accesses a virtual page that is not currently resident in physical memory. The CPU raises a fault, and the operating system loads the required page from secondary storage (usually a disk) into RAM.
- Types of Page Faults:
- Minor (soft) fault – page is in memory but not mapped.
- Major (hard) fault – page must be read from disk.
- Handling Steps:
- OS locates a free frame or evicts a victim page.
- Page is read from disk (if needed) and placed into the frame.
- Page table is updated, and the process resumes.
Remember that a page fault is **not** caused by privileged instructions, hardware errors, or simultaneous writes – it is strictly about missing pages in RAM.
4. Scheduling: Shortest Job First (SJF)
When burst times are known in advance, the Shortest Job First algorithm yields the minimum average waiting time. It selects the process with the smallest CPU burst next.
- Non‑preemptive SJF: Once a job starts, it runs to completion.
- Preemptive variant (SRTF): The scheduler may interrupt a running job if a shorter one arrives.
- Why it’s optimal: By serving the shortest jobs first, the total time that all jobs wait is reduced.
Mnemonic: “Shortest First, Waits Least.” Visualize a line where the quickest customers are served first – the line clears faster, reducing overall wait.
5. Linux File Permission String
The symbolic permission string -rwxr-xr-- encodes the access rights for three classes: owner, group, and others.
- First character:
-indicates a regular file (not a directory). - Owner permissions (rwx): read, write, and execute.
- Group permissions (r-x): read and execute, no write.
- Others permissions (r--): read only.
Thus, the correct statement is: The owner can read, write, and execute; the group can read and execute; others can only read.
6. Rotational Latency of a 10 000 rpm Disk
Rotational latency is the time required for the desired sector to rotate under the read/write head. On average, the disk must rotate half a revolution.
Calculation:
- Revolution time = 60 seconds / 10 000 rpm = 0.006 seconds = 6 ms.
- Average latency = ½ × 6 ms = 3 ms.
7. Translation Look‑aside Buffer (TLB)
The TLB is a specialized cache that stores recent virtual‑to‑physical address translations.
- Purpose: Reduce the number of memory accesses required for address translation.
- Operation: When a virtual address is referenced, the CPU first checks the TLB. A hit provides the physical frame instantly; a miss forces a page‑table walk.
- Benefit: Improves overall system performance, especially for workloads with high locality.
Remember: the TLB does not hold an entire page table, nor does it act as a backup RAM or disk‑block cache.
8. chmod 644 Explained
The command chmod 644 file.txt sets permissions using three octal digits:
- First digit (6) = 4 (read) + 2 (write) → owner gets read & write.
- Second digit (4) = read only → group gets read.
- Third digit (4) = read only → others get read.
No execute bits are set, so nobody can execute the file.
Mnemonic: “6‑4‑4 = 4‑2‑0, 4‑0‑0, 4‑0‑0” – owner gets read + write, group and others get read only.
9. Summary of Key Takeaways
- Fork uses copy‑on‑write to share pages until a write occurs.
- L3 cache is the largest and slowest level in a three‑level hierarchy.
- A page fault signals that a needed page is absent from RAM.
- SJF provides the lowest average waiting time when burst lengths are known.
- File permission strings combine type, owner, group, and others bits.
- Average rotational latency for a 10 000 rpm disk is 3 ms.
- The TLB caches recent address translations to speed up virtual memory.
- chmod 644 grants read/write to the owner and read‑only to everyone else.
10. Practice Questions
Test your knowledge with these additional problems. Write down your answers before checking the explanations.
- What happens to the page tables of a process after a successful copy‑on‑write operation?
- Which cache level would you expect to have the lowest miss rate?
- Describe the difference between a minor and a major page fault.
- If two processes have burst times of 2 ms, 4 ms, and 6 ms, what is the average waiting time under SJF?
- Convert the permission string
drwxr-x---to its octal representation.
Answers:
- Page tables are updated to point to the new private copy; the shared‑read‑only entry is replaced.
- L3, because it holds the most data and thus experiences fewer misses.
- Minor faults involve pages already in memory but not mapped; major faults require loading from disk.
- Order: 2 ms, 4 ms, 6 ms → waiting times: 0, 2, 6 → average = (0+2+6)/3 = 2.67 ms.
- Directory (d) + rwx (7) for owner, r-x (5) for group, --- (0) for others →
750.
By mastering these concepts, you’ll be well‑prepared for exams, interviews, and real‑world system design challenges.
