11.2 Operating Systems & System Software
Key Takeaways
- Operating Systems manage system hardware through core modules: Process Management, Memory Management, File System Management, and Device I/O Management.
- Process state transitions move processes from New to Ready, Running, Waiting (Blocked), and Terminated, managed by CPU scheduling algorithms like Preemptive Shortest Remaining Time First (SRTF) and Round Robin.
- Virtual Memory utilizes Paging to translate logical addresses into physical frame addresses using Page Tables, where excessive page swapping triggers system Thrashing.
- Real-Time Operating Systems (RTOS) guarantee strict deterministic timing constraints, categorized into Hard RTOS (e.g., ATM transaction processing, flight controls) and Soft RTOS (e.g., video streaming).
- System software includes operating systems, device drivers, utilities, and language translators (Compilers translate full source code into object code before execution, whereas Interpreters convert and execute code line-by-line).
Operating Systems & System Software
An Operating System (OS) is system software that acts as an intermediary interface between computer hardware and user application software. In commercial banking environments, robust operating systems (such as Linux enterprise distributions, AIX, Windows Server, and z/OS mainframes) provide resource virtualization, security isolation, concurrent processing, and fault tolerance for mission-critical core banking systems (CBS).
1. Operating System Architecture & Functions
The operating system kernel is the core component that resides permanently in main memory. OS operations are divided into four fundamental management subsystems:
- Process Management: Allocates CPU time to competing threads/processes, handles inter-process communication (IPC), and synchronizes execution.
- Memory Management: Allocates and deallocates physical RAM space to active processes, tracks memory maps, and manages Virtual Memory paging.
- File System Management: Organizes files into hierarchical directory trees, manages access permissions, and controls physical storage block allocation (e.g., NTFS, FAT32, ext4, APFS).
- Device / I/O Management: Provides standardized hardware interfaces via device drivers, buffering, spooling, and interrupt handlers.
Kernel Architecture Models
| Kernel Type | Architecture Description | Advantages | Disadvantages | Examples |
|---|---|---|---|---|
| Monolithic Kernel | All OS services (file system, IPC, device drivers, virtual memory) run inside a single privileged kernel space. | High performance due to direct fast system calls. | A crash in any driver can crash the entire OS. | Linux, MS-DOS, traditional Unix |
| Microkernel | Only minimal essential services (IPC, basic memory, CPU scheduling) run in kernel space; drivers and file systems run in user space. | High stability, modular design, isolated crashes. | Performance overhead due to frequent context switching. | QNX, Minix, L4, macOS (Mach core) |
| Hybrid Kernel | Combines microkernel modularity with monolithic performance inside kernel space. | Balanced trade-off of speed and structure. | Complex internal design. | Windows NT/10/11, macOS |
2. Process Life Cycle & CPU Scheduling Algorithms
A Process is a program in execution containing a program counter, stack, data section, and process control block (PCB).
Process State Transition Model
+-----------------------------------------------------------------+
| PROCESS STATE TRANSITIONS |
| |
| +-----+ Admitted +-------+ Scheduler +---------+ |
| | New |------------->| Ready |------------>| Running | |
| +-----+ +-------+ Dispatch +---------+ |
| ^ | |
| | I/O Completion | I/O or Event |
| | or Time Slice | Wait |
| | Expired v |
| | +---------+ |
| +-----------------| Waiting | |
| +---------+ |
| | |
| Exit| |
| v |
| +------------+ |
| | Terminated | |
| +------------+ |
+-----------------------------------------------------------------+
- New: Process is being created.
- Ready: Process is loaded into RAM waiting for CPU allocation.
- Running: Instructions are actively executing on CPU.
- Waiting (Blocked): Process is waiting for an I/O operation or signal completion.
- Terminated: Execution has completed; resources are reclaimed.
CPU Scheduling Algorithms
CPU schedulers select processes from the ready queue based on specific criteria:
- First-Come, First-Served (FCFS): Non-preemptive. Simple FIFO queue. Subject to the Convoy Effect, where small processes wait behind a massive CPU-bound process.
- Shortest Job First (SJF): Selects the process with the shortest next CPU burst time. Optimal for minimal average waiting time, but causes starvation for long tasks.
- Shortest Remaining Time First (SRTF): Preemptive version of SJF. If a new process arrives with a shorter burst time than the currently running process, the current process is preempted.
- Round Robin (RR): Preemptive scheduler designed for time-sharing systems. Assigns a fixed Time Quantum (e.g., $10 - 50 \text{ ms}$) to each process sequentially in a circular queue.
- Priority Scheduling: Assigns a priority rank to each process. High priority processes run first. Prevents starvation using Aging (gradually increasing the priority of long-waiting processes).
3. Memory Management & Virtual Memory Paging
Modern operating systems use Virtual Memory to allow processes to execute even if their total memory code exceeds physical RAM size.
Paging Architecture & Logical-to-Physical Address Translation
Main memory is divided into fixed-size physical blocks called Frames. Virtual process memory is divided into equal-sized logical blocks called Pages.
A logical address generated by the CPU consists of a Page Number ($p$) and an Offset ($d$):
where $f$ is the Frame Number retrieved from the system Page Table.
+-----------------------------------------------------------------+
| PAGING ADDRESS TRANSLATION |
| |
| CPU Logical Address: [ Page (p) | Offset (d) ] |
| | | |
| v | |
| +---------------+ | |
| | PAGE TABLE | | |
| | Page p -> Frame f | |
| +---------------+ | |
| | | |
| v v |
| RAM Physical Address: [ Frame (f) | Offset (d) ] |
+-----------------------------------------------------------------+
Step-by-Step Worked Paging Calculation
Problem: A virtual memory system uses a page size of $4 \text{ KB} = 4096 \text{ bytes}$. A CPU generates a logical address of $10000_{10}$. Given that Page $2$ maps to Physical Frame $7$, compute the exact Physical Memory Address.
Step A: Determine Page Number ($p$) and Offset ($d$)
- Page Number ($p$) = floor(Logical Address / Page Size) = floor(10000 / 4096) = 2
- Offset ($d$) = Logical Address mod Page Size = 10000 mod 4096 = 10000 - (2 * 4096) = 10000 - 8192 = 1808
Step B: Look up Frame Number ($f$)
From the Page Table entry for Page $2$, Frame Number $f = \mathbf{7}$.
Step C: Compute Physical Address
Page Faults & Thrashing
- Page Fault: Occurs when a process accesses a page not currently loaded into physical RAM. The OS halts the process, fetches the page from disk swap space into an open RAM frame, updates the Page Table, and resumes execution.
- Thrashing: Occurs when the system spends more time handling page faults and swapping pages in and out of disk than executing real work. Resolving thrashing requires increasing RAM capacity or terminating heavy processes.
4. Software Classification & Language Translators
Software is broadly divided into System Software (maintains system infrastructure) and Application Software (performs user domain tasks like banking transactions).
+-----------------------------------------------------------------+
| SOFTWARE CLASSIFICATION |
| |
| /-------------------\ |
| | Computer Software | |
| \-------------------/ |
| | |
| +------------------+------------------+ |
| | | |
| v v |
| +-------------------+ +-------------------+ |
| | System Software | | Application Soft. | |
| +-------------------+ +-------------------+ |
| | - Operating System| | - Banking Systems | |
| | - Device Drivers | | (Finacle/BaNCS) | |
| | - Utility Programs| | - MS Office Suite | |
| | - Translators | | - Web Browsers | |
| +-------------------+ +-------------------+ |
+-----------------------------------------------------------------+
Language Translators: Assembler, Compiler, Interpreter
High-level programming languages (C++, Java, Python) must be translated into binary Machine Code ($0$s and $1$s).
| Feature | Compiler | Interpreter | Assembler |
|---|---|---|---|
| Input Language | High-Level Code (C, C++, Rust) | High-Level Code (Python, Ruby, JavaScript) | Assembly Language (mnemonics like MOV, ADD) |
| Translation Method | Scans and translates the entire source code into object code in one pass. | Translates and executes source code line-by-line dynamically. | Converts Assembly mnemonics directly into binary machine code. |
| Execution Speed | Faster post-compilation (standalone executable created). | Slower (requires interpreter execution at runtime). | Extremely fast low-level translation. |
| Debugging / Errors | Reports all syntax errors together after full compilation pass. | Stops execution immediately at the first encountered error line. | Low-level hardware mnemonic error reporting. |
| Output File | Generates standalone Object/Executable file (.exe, .so). | Does not produce intermediate machine code files. | Generates object code module. |
Exam Strategies & Common Traps
- Preemptive vs. Non-Preemptive Scheduling: FCFS and SJF are non-preemptive by default. Round Robin and SRTF are strictly preemptive. In preemptive scheduling, the OS forcefully removes a process from the CPU when a higher-priority task arrives or time quantum expires.
- Compiler vs. Interpreter Output: A Compiler produces an independent binary executable file (
.exe), whereas an Interpreter executes source code directly on the fly without generating an executable file on disk. - Page Fault Overhead: Remember that page faults involve disk I/O, which is thousands of times slower than RAM operations.
Which operating system kernel architecture runs device drivers and file system management modules inside unprivileged user space to maximize system stability?
In a virtual memory system using 4 KB page sizes, a process generates logical address 10000. If Page 2 maps to Frame 7, what is the physical RAM address?
What system condition occurs when an operating system spends virtually all its processing overhead continuously swapping memory pages back and forth from secondary disk storage?
Which statement accurately describes a core operational difference between a Compiler and an Interpreter?