Core Notes
CY404 Operating Systems
Structured notes aligned with the major RGPV CY404 course areas.
Unit I
Introduction to Operating Systems & OS Services
The Operating System manages resources, controls program execution and provides an environment in which application software can run.
Functions of an Operating System
Process ManagementCreates, schedules and terminates processes.
Memory ManagementAllocates and tracks main-memory usage.
File ManagementOrganises files, directories and storage.
Device ManagementCoordinates I/O devices.
SecurityControls access to system resources.
User InterfaceProvides CLI, GUI or other interfaces.
Operating System Services
- Program execution
- I/O operations
- File-system manipulation
- Communication
- Error detection
- Resource allocation
Desirable Characteristics
- Reliability and availability
- Efficient resource utilisation
- Security and protection
- Convenient user interaction
- Support for concurrent activities
Exam Tip: Define the OS first, then explain its major functions/services and draw a neat block diagram.
Unit II
Process Management, IPC & CPU Scheduling
A process is a program in execution. Process management deals with process creation, scheduling, synchronisation, communication and termination.
Process States
NewProcess is being created.
ReadyWaiting for CPU.
RunningCurrently executing.
WaitingWaiting for an event or I/O.
TerminatedExecution completed.
Inter-Process Communication
IPC allows processes to exchange data and coordinate activities. Common approaches include shared memory and message passing.
CPU Scheduling Algorithms
FCFSFirst Come First Served.
SJFShortest Job First.
SRTFPreemptive shortest-job scheduling.
PriorityScheduling according to priority.
Round RobinTime-quantum based scheduling.
Multilevel QueueSeparate scheduling queues.
Turnaround Time = Completion Time β Arrival Time
Waiting Time = Turnaround Time β Burst Time
Numerical Approach:
Draw the Gantt chart, calculate completion times, then calculate turnaround and waiting time process-by-process.
Deadlock
Deadlock occurs when processes remain blocked because each is waiting for a resource held by another process.
- Mutual exclusion
- Hold and wait
- No preemption
- Circular wait
Unit III
Memory Management & Virtual Memory
Memory management controls allocation and deallocation of memory and supports efficient execution of multiple processes.
Contiguous Allocation
- Memory is allocated in contiguous regions.
- Common strategies include first fit, best fit and worst fit.
- External fragmentation can occur.
Paging
Paging divides logical memory into fixed-size pages and physical memory into frames. A page table maps pages to frames.
Logical Address = Page Number + Page Offset
Segmentation
Segmentation divides a program into logical variable-sized segments such as code, data and stack.
Virtual Memory
Virtual memory allows processes to execute without requiring their complete address space to be resident in physical memory at once.
Page Replacement Algorithms
FIFOReplaces the oldest loaded page.
OptimalReplaces the page used farthest in the future.
LRUReplaces the least recently used page.
Numerical Tip: Create a frame table and mark each page reference. Count page faults after each reference.
Unit IV
File System, I/O & Device Management
The file system organises persistent data, while device management coordinates communication between software and hardware devices.
File Attributes
NameFile identifier.
TypeKind of file.
SizeStorage occupied.
ProtectionAccess permissions.
LocationStorage information.
TimestampsCreation/modification/access information.
File Allocation Methods
- Contiguous: File blocks are stored consecutively.
- Linked: File blocks are connected through pointers.
- Indexed: An index block stores references to file blocks.
Disk Scheduling
FCFSServices requests in arrival order.
SSTFSelects shortest seek distance.
SCANMoves the disk arm and services requests.
C-SCANCircular one-direction scheduling.
Disk access time is commonly discussed using seek time, rotational latency and transfer time.
Unit V
Linux, System Calls & OS Utilities
RGPV's course outcomes include developing small modules, shell and utility programs using Linux or an educational operating system's system calls.
System Calls
System calls provide a controlled interface through which application programs request services from the operating system kernel.
Process ControlProcess creation and execution operations.
File ManagementOpen, read, write and close operations.
Device ManagementRequests involving I/O devices.
Information MaintenanceSystem and process information.
CommunicationProcess communication mechanisms.
ProtectionAccess control over resources.
Linux Shell
A shell provides a command-line interface through which users interact with the operating system and automate tasks using scripts.
Cyber Security Connection: Processes, permissions, files, users, memory and system calls are fundamental for Linux security analysis.