CST206 Operating Systems Important Topics
CST206 Operating Systems Important Topics
IMPORTANT TOPICS
Based on analysis of CST206 July 2021 & June 2022 Question
Papers
MODULE 1: INTRODUCTION TO
OPERATING SYSTEMS
1. Functions of Operating Systems
• Process Management: Creates, schedules, and
terminates processes
• Memory Management: Allocates and deallocates
memory space
• File Management: Creates, deletes, and provides
access to files
• I/O Management: Manages device communication and
drivers
• Secondary Storage Management: Provides free space
management, storage allocation
• Protection and Security: Protects system resources
and user data
5. Bootstrap Loader
• Small code in boot ROM that locates and loads the OS
kernel
• Performs hardware initialization and memory checks
• Loads OS from disk to memory and transfers control to it
3. Process Scheduling
• Long-term Scheduler: Controls degree of
multiprogramming
• Short-term Scheduler: Selects process from ready
queue for execution
• Mid-term Scheduler: Handles swapping of processes
4. Scheduling Algorithms
• First-Come, First-Served (FCFS): Non-preemptive,
simple but may cause convoy effect
• Shortest Job First (SJF): Minimizes average waiting
time, can be preemptive/non-preemptive
• Priority Scheduling: Assigns priority to each process,
can lead to starvation
• Round Robin (RR): Time quantum-based preemptive
scheduling
5. Context Switching
• Saving the state of current process and loading the state
of next process
• Considered overhead as no useful work is done during
this time
• Operations include: saving CPU registers, updating PCB,
loading new process state
6. Inter-Process Communication (IPC)
• Message Passing: Processes communicate by
exchanging messages
• Synchronous: Sender waits until message is received
• Asynchronous: Sender continues execution after
sending
• Shared Memory: Processes share a common memory
area
• Pipes: Allows communication between related processes
MODULE 3: PROCESS
SYNCHRONIZATION & DEADLOCKS
1. Critical Section Problem
• Section of code where shared resources are accessed
• Solution must satisfy:
• Mutual Exclusion: Only one process in critical section at
a time
• Progress: Selection of process to enter critical section
can't be postponed indefinitely
• Bounded Waiting: Limit on number of times other
processes enter critical section
2. Synchronization Tools
• Semaphores: Synchronization variable with wait() and
signal() operations
• Binary Semaphore: Value 0 or 1, used for mutual
exclusion
• Counting Semaphore: Can have arbitrary value, used
for resource counting
• Mutex: Simplified binary semaphore for mutual
exclusion
4. Deadlock Concept
• Situation where processes are blocked forever waiting for
each other
• Necessary Conditions:
• Mutual Exclusion: At least one resource must be non-
sharable
• Hold and Wait: Process holding resources can request
more
• No Preemption: Resources can't be forcibly taken away
• Circular Wait: Circular chain of processes waiting for
resources
7. Banker's Algorithm
• Safety algorithm to determine if system is in safe state
• Resource-request algorithm to handle new requests
• Prevents deadlocks by granting resources only if system
remains in safe state
3. Paging
• Physical memory divided into fixed-sized frames
• Logical memory divided into same-sized pages
• Page table maps logical pages to physical frames
• Eliminates external fragmentation but can have internal
fragmentation
4. Translation Lookaside Buffer (TLB)
• Cache for page table entries
• Speeds up page access by storing recently used page
translations
• Address translation process: 1. Check TLB for page
number 2. If present (TLB hit), get frame number 3. If not
present (TLB miss), consult page table and update TLB
5. Segmentation
• Memory divided according to logical segments (functions,
data, stack)
• Each segment has name and length
• Logical address consists of
• No internal fragmentation but can have external
fragmentation
6. Virtual Memory
• Allows execution of processes larger than physical
memory
• Separates logical memory from physical memory
• Implemented using demand paging
7. Demand Paging
• Pages loaded into memory only when needed
• Uses page fault handling mechanism: 1. Trap to OS 2.
Save user registers 3. Determine if address is valid 4. Get
free frame 5. Read page from disk 6. Reset page table
and other tables 7. Restart instruction
9. Thrashing
• Process spending more time paging than executing
• Occurs when a process doesn't have enough frames for
its working set
2. Access Methods
• Sequential Access: Records processed in order
• Direct Access: Random access without traversing
previous records
• Indexed Access: Index provides pointers to various
blocks
3. Directory Structure
• Single-Level: All files in same directory, naming issues
• Two-Level: Separate directory for each user
• Tree-Structured: Hierarchical system with directories
and subdirectories
5. File Protection
• Access control based on user identities and permissions
• Common scheme: owner/group/public with read/write/
execute permissions
8. Disk Formatting
• Low-level Formatting: Dividing disk into sectors for
controller
• Partitioning: Dividing disk into one or more groups of
cylinders
• Logical Formatting: Creating file system structures