C-CAT Operating Systems Revision: Key Topics
Operating systems for C-CAT
Operating systems questions mix definitions with short calculations. This guide lists the topics worth revising and the facts that decide the answers.
Topic checklist
| Topic | Be able to |
|---|---|
| OS basics | Functions of an OS, kernel and user mode, system calls |
| Processes | States, PCB, context switch, process vs thread |
| CPU scheduling | FCFS, SJF, SRTF, Round Robin, priority; waiting and turnaround time |
| Synchronisation | Critical section, semaphores, mutex, classic problems |
| Deadlocks | Four conditions, prevention, avoidance, detection |
| Memory management | Paging, segmentation, virtual memory |
| Page replacement | FIFO, LRU, Optimal; page faults and Belady’s anomaly |
| File systems and disks | File allocation, directory structure, disk scheduling |
Processes and threads
- A process moves through the states new, ready, running, waiting, terminated.
- The PCB (process control block) stores a process’s state, program counter, registers and scheduling information.
- A context switch saves one process’s state and loads another’s. It is pure overhead.
- Threads of one process share code, data and files but not their stacks or registers.
- A system call is how a user program asks the kernel for a service.
CPU scheduling
| Algorithm | Preemptive | Key point |
|---|---|---|
| FCFS | No | Simple, but short jobs can wait behind long ones (convoy effect) |
| SJF | No | Gives the minimum average waiting time, but long jobs can starve |
| SRTF | Yes | Preemptive version of SJF |
| Round Robin | Yes | Each process gets a time quantum; good for time sharing |
| Priority | Either | Low-priority processes can starve; aging fixes this |
Formulas to remember:
- Turnaround time = completion time - arrival time
- Waiting time = turnaround time - burst time
Draw the Gantt chart first, then compute. Most scheduling mistakes come from skipping that step.
Synchronisation
- A critical section is code that touches shared data and must not run in more than one process at the same time.
- A solution needs mutual exclusion, progress and bounded waiting.
- A semaphore is an integer used with two atomic operations,
wait(P) andsignal(V). A binary semaphore takes only 0 or 1. - A mutex is a lock owned by the thread that acquired it.
- Classic problems: producer-consumer, readers-writers and dining philosophers.
Deadlocks
A deadlock needs all four of these:
- Mutual exclusion
- Hold and wait
- No preemption
- Circular wait
Handling methods:
- Prevention: make at least one of the four conditions impossible.
- Avoidance: the Banker’s algorithm only grants a request if the system stays in a safe state.
- Detection and recovery: find the cycle, then kill or roll back processes.
- Ignore it: the approach most general-purpose systems take.
A safe state means a safe sequence exists. An unsafe state does not always cause a deadlock, but it can.
Memory management
- Paging splits logical memory into pages and physical memory into frames of the same size. This removes external fragmentation but can cause internal fragmentation in the last page.
- Segmentation splits memory by logical units such as code and stack. It can cause external fragmentation.
- Logical address = page number + offset. The page table maps the page number to a frame.
- A TLB caches recent page table entries to make translation faster.
- Effective access time = hit ratio x (TLB time + memory time) + miss ratio x (TLB time + 2 x memory time) for a single-level page table.
- Virtual memory lets a process run even if only part of it is in RAM, using demand paging.
- Thrashing happens when the system spends more time swapping pages than executing.
Page replacement
| Algorithm | Idea |
|---|---|
| FIFO | Replace the oldest page; can show Belady’s anomaly |
| LRU | Replace the page not used for the longest time |
| Optimal | Replace the page that will not be used for the longest time ahead; the best possible, but not implementable in practice |
Belady’s anomaly: with FIFO, giving a process more frames can sometimes cause more page faults. LRU and Optimal do not have this problem.
To count page faults, write the reference string, track the frames after each reference, and mark each fault. Do it by hand until it is quick.
File systems and disks
- File allocation methods: contiguous (fast, but external fragmentation), linked (no external fragmentation, slow random access) and indexed (supports random access).
- Directory structures: single-level, two-level, tree and acyclic graph.
- Disk scheduling: FCFS, SSTF, SCAN and C-SCAN. SSTF can starve far requests, and SCAN moves like an elevator.
Revise and practise
- Operating Systems Cheat Sheet for one-page revision
- Operating Systems MCQs for practice
- Operating Systems Flashcards to test recall
- C-CAT Section B Preparation Guide for the overall checklist
- C-CAT syllabus for the full topic list
Key takeaways
- Learn the scheduling formulas and draw the Gantt chart first.
- Memorise the four deadlock conditions and what each handling method does.
- Practise page-fault counting for FIFO, LRU and Optimal.
- Know paging, fragmentation and virtual memory definitions precisely.
Frequently Asked Questions
1 Which operating system topics are most important for C-CAT?
Process management and scheduling, synchronisation and deadlocks, memory management with paging and page replacement, and basic file system and disk concepts. These cover most repeated questions.
2 Are C-CAT OS questions numerical?
Some are. Expect small calculations such as average waiting time under a scheduling algorithm, page faults for a reference string, or the effective address size in paging. Practise these on paper.
3 What are the four conditions for deadlock?
Mutual exclusion, hold and wait, no preemption and circular wait. All four must hold at the same time for a deadlock to occur.
4 What is the difference between a process and a thread?
A process is a program in execution with its own address space. Threads are units of execution inside a process and share its code, data and open files, but each has its own stack and registers.
5 How many days do I need for operating systems?
Around 4 to 5 focused days are enough for revision if you already know the concepts, with most time on scheduling, deadlocks and paging problems.