Computer Operating System Complete Notes for DSSSB TGT Computer Science
Complete Operating System study material with detailed explanations, real-life examples, numerical problems, CPU scheduling, process management, synchronization, deadlocks, memory management, paging, virtual memory, file management, disk scheduling and Linux basics.
OPERATING SYSTEM
Complete Detailed Notes + Examples + Exam Preparation
The DSSSB TGT Computer Science Operating Systems syllabus includes Introduction, Operating System Organization, Device Management, Process Management, Scheduling, Synchronization Principles, Deadlocks, Memory Management and File Management.
This article explains these areas using definitions, examples, tables, formulas and exam-oriented points.
💻 1. Introduction to Operating System
An Operating System (OS) is system software that acts as an intermediary between computer hardware and the users or application programs.
It manages computer resources such as the CPU, main memory, storage devices, input/output devices and files.
Imagine a school computer laboratory containing 50 computers. Students want to run browsers, word processors and programming software while the computer also needs to manage memory, keyboard, mouse, printer and storage.
The user does not directly control every transistor or hardware register. The operating system provides a controlled environment through which these resources are used.
Examples of operating systems include Windows, Linux, macOS, Android and other specialized operating systems.
⚙️ Resource Manager
The OS allocates CPU time, memory, storage and I/O resources.
🖥️ Interface
The OS provides interfaces through which users and programs interact with the computer.
🛡️ Control
The OS controls access to hardware and system resources.
⚙️ 2. Functions of Operating System
An operating system performs several important functions. The most important functions for examination preparation are:
- Process management
- Memory management
- File management
- Device management
- Storage management
- Security and protection
- Networking
- Error detection
- Resource allocation
🧠 Memory Management
Tracks memory usage and allocates/deallocates memory to processes.
🔄 Process Management
Creates, schedules and terminates processes.
📂 File Management
Manages files, directories, permissions and storage organization.
🔌 Device Management
Coordinates communication between programs and I/O devices.
🔐 Security
Protects resources from unauthorized access.
🌐 Networking
Supports communication between systems and network resources.
🎯 Exam Point
Process management, memory management and security are all functions performed by an operating system.
🛠️ 3. Operating System Services
Operating systems provide services that make program execution and user interaction easier.
| Service | Explanation | Example |
|---|---|---|
| Program Execution | Loads and executes programs. | Running a browser. |
| I/O Operations | Provides controlled access to I/O devices. | Reading keyboard input. |
| File Manipulation | Creates, reads, writes and deletes files. | Saving a document. |
| Communication | Allows processes to exchange information. | Inter-process communication. |
| Error Detection | Detects hardware/software errors. | Memory or disk error detection. |
| Resource Allocation | Allocates resources to programs. | CPU scheduling. |
| Protection | Controls access to resources. | File permissions. |
🏗️ 4. Operating System Organization
Operating-system organization describes how different OS components are arranged and how they communicate with hardware, the kernel and applications.
Process Manager
Handles processes, scheduling and synchronization.
Memory Manager
Manages allocation, paging and virtual memory.
File Manager
Manages files, directories and storage structures.
I/O Manager
Controls input/output operations.
Security Manager
Controls protection and access.
Network Manager
Supports networking and communication.
🖥️ 5. Types of Operating Systems
| Type | Meaning | Example/Use |
|---|---|---|
| Batch OS | Jobs are collected and processed in batches. | Large offline processing jobs. |
| Multiprogramming OS | Several programs are kept in memory so CPU utilization can improve. | Multi-program environments. |
| Multitasking OS | Multiple tasks share processor time. | Desktop operating systems. |
| Time-Sharing OS | CPU time is divided among users/processes for interactive use. | Interactive multi-user systems. |
| Multiprocessing OS | Uses multiple processors/cores. | Modern multicore computers. |
| Real-Time OS | Designed to respond within specified timing constraints. | Control systems. |
| Distributed OS | Coordinates resources across multiple connected computers. | Distributed environments. |
Suppose an industrial control system must respond to a sensor within a specified time limit. Missing that timing requirement could cause the system to fail.
A real-time operating system is designed for such timing-sensitive applications.
🧩 6. Kernel
The kernel is the central component of an operating system. It manages important system resources and provides controlled interaction between applications and hardware.
CPU
Kernel controls process scheduling and CPU allocation.
Memory
Kernel manages memory allocation and virtual memory.
I/O
Kernel coordinates input/output operations.
Exam Tip: Remember the kernel as the core or central part of the operating system responsible for low-level resource management.
📞 7. System Calls
A system call is a mechanism through which a user-level program requests a service from the operating system.
Suppose a program wants to read data from a file. The program cannot simply bypass the operating system and directly manipulate the storage device.
It makes an appropriate system call requesting the OS to perform the operation.
| Category | Examples of Operations |
|---|---|
| Process Control | Create, terminate, execute processes |
| File Management | Open, read, write, close files |
| Device Management | Request/release devices |
| Information Maintenance | Get/set system information |
| Communication | Send/receive information |
🔌 8. Device Management
Device management is responsible for controlling and coordinating input/output devices such as keyboards, printers, disks, displays and network devices.
Important Responsibilities
- Keeping track of devices.
- Allocating devices to processes.
- Releasing devices after use.
- Managing I/O operations.
- Using device drivers.
- Handling interrupts.
Suppose five programs want to print documents at the same time. The operating system coordinates their requests and can maintain a print queue.
This prevents all programs from attempting uncontrolled access to the printer simultaneously.
🔄 9. Process Management
A program stored on disk is passive. When that program begins executing, it becomes a process.
Suppose calculator.exe is stored on your computer. The file itself is a program.
When you open the calculator, the operating system loads the required information into memory and starts execution. The executing instance is a process.
🔄 Process States
NEW
The process is being created.
READY
The process is ready and waiting for CPU allocation.
RUNNING
Instructions of the process are currently executing.
WAITING
The process is waiting for an event or I/O operation.
TERMINATED
The process has finished execution.
🎯 Important
A process may move from Ready → Running when the scheduler selects it.
A running process may move to Waiting when it needs to wait for an I/O event.
📋 10. Process Control Block – PCB
The PCB is a data structure maintained by the operating system for each process. It contains information required to manage and resume the process.
| PCB Information | Purpose |
|---|---|
| Process ID | Uniquely identifies a process. |
| Process State | Stores current process state. |
| Program Counter | Contains address of next instruction to execute. |
| CPU Registers | Stores processor state associated with the process. |
| Scheduling Information | Contains priority and scheduling-related information. |
| Memory Information | Contains information related to memory allocated to process. |
| I/O Information | Stores I/O-related information. |
🧵 11. Threads
A thread is a lightweight unit of execution within a process. Multiple threads belonging to the same process generally share the process's address space and resources.
A browser can perform multiple activities such as rendering a page, handling user input and performing background work.
Using multiple threads can allow different activities to execute concurrently within the same process.
| Process | Thread |
|---|---|
| Generally heavier. | Generally lighter. |
| Own process address space. | Threads within a process share its address space. |
| Process creation can be expensive. | Thread creation is generally less expensive. |
🔄 12. Context Switching
A context switch occurs when the CPU changes from executing one process/thread to another.
The operating system must preserve the state of the currently running process and restore the state of the next process.
⏱️ 13. CPU Scheduling
CPU scheduling is the process of selecting a process from the ready queue and allocating the CPU to it.
Important Scheduling Algorithms
FCFS
First Come First Served.
SJF
Shortest Job First.
SRTF
Shortest Remaining Time First.
Priority
Selects according to priority.
Round Robin
Uses a fixed time quantum.
📐 Important Formulas
🚶 14. FCFS Scheduling – Solved Example
The process that arrives first is normally served first. FCFS is a non-preemptive scheduling algorithm.
Consider:
| Process | Arrival Time | Burst Time |
|---|---|---|
| P1 | 0 | 5 |
| P2 | 1 | 3 |
| P3 | 2 | 2 |
Since FCFS follows arrival order:
Gantt chart:
Completion times:
- P1 = 5
- P2 = 8
- P3 = 10
Turnaround time:
Waiting time:
⚠️ Exam Trap
FCFS can suffer from the convoy effect, where short processes wait behind a long process.
⚡ 15. SJF Scheduling – Solved Example
SJF selects the process having the smallest CPU burst time among the eligible processes.
The basic non-preemptive version does not interrupt a running process.
Suppose all processes arrive at time 0:
| Process | Burst Time |
|---|---|
| P1 | 6 |
| P2 | 2 |
| P3 | 4 |
Shortest burst is P2, followed by P3 and then P1.
Completion times:
- P2 = 2
- P3 = 6
- P1 = 12
Waiting times:
Average waiting time:
⚡ 16. SRTF Scheduling – Solved Example
SRTF is a preemptive scheduling algorithm. The process with the smallest remaining CPU burst time is selected.
Suppose P1 starts executing. If a new process P2 arrives whose remaining burst time is less than P1's remaining time, P1 may be preempted and P2 can execute.
This is the main distinction between SJF and SRTF:
🏆 17. Priority Scheduling
In priority scheduling, each process is assigned a priority and the scheduler selects according to that priority.
The exact meaning of a smaller or larger numerical value depends on the convention specified in the question.
| Process | Priority | Burst |
|---|---|---|
| P1 | 3 | 5 |
| P2 | 1 | 2 |
| P3 | 2 | 4 |
If 1 means highest priority, the order is:
⚠️ Starvation
Low-priority processes may wait for a long time if higher-priority processes continually enter the ready queue.
Aging can gradually increase the priority of waiting processes and help reduce starvation.
🔄 18. Round Robin Scheduling
Round Robin gives each ready process a fixed amount of CPU time called the time quantum.
Suppose three processes have burst times:
The CPU may execute:
A process that does not finish after its quantum goes to the back of the ready queue.
Exam Tip: Round Robin is strongly associated with interactive and time-sharing environments.
🔐 19. Process Synchronization
Process synchronization coordinates processes or threads when they access shared data or shared resources.
🚨 Race Condition
A race condition can occur when multiple processes/threads access shared data concurrently and the final result depends on the timing/order of execution.
🚧 Critical Section
A critical section is the part of a program in which shared data or a shared resource is accessed.
Mutual Exclusion
Only the allowed process/thread should enter the critical section at a time.
Progress
Processes should not be unnecessarily prevented from entering their critical section.
Bounded Waiting
A process should not wait indefinitely.
🚦 20. Semaphore
A semaphore is used to coordinate access to shared resources and to synchronize processes or threads.
Binary Semaphore
Commonly represents two states and can be used for mutual exclusion.
Counting Semaphore
Can represent multiple available instances of a resource.
Suppose a parking area has 5 available spaces. A counting semaphore could conceptually represent the number of available spaces.
When a vehicle occupies a space, the available count decreases. When a vehicle leaves, the available count increases.
☠️ 21. Deadlock
Deadlock is a situation in which a set of processes becomes permanently blocked because each process is waiting for a resource held by another process in the set.
🔥 Four Necessary Conditions
1. Mutual Exclusion
At least one resource is non-shareable.
2. Hold and Wait
A process holds resources while waiting for additional resources.
3. No Preemption
Resources cannot simply be forcibly removed from a process.
4. Circular Wait
A circular chain of processes waits for resources.
Imagine:
- Car A has resource R1 and waits for R2.
- Car B has resource R2 and waits for R1.
Neither can proceed because each is waiting for the other. This illustrates the basic idea of circular waiting.
🏦 22. Banker's Algorithm
Banker's Algorithm is a deadlock-avoidance algorithm. It checks whether allocating resources will leave the system in a safe state.
Suppose a system has a limited number of printers, tape drives and memory resources. Before granting a request, the system can conceptually check whether the resulting state allows all processes to eventually finish.
If a safe sequence exists, the state can be considered safe under the algorithm's assumptions.
🎯 Important Terms
- Available: Currently available resources.
- Maximum: Maximum resource requirement.
- Allocation: Resources currently allocated.
- Need: Remaining resource requirement.
🧠 23. Memory Management
Memory management is the operating-system activity concerned with tracking, allocating, protecting and releasing memory used by processes.
Allocation
Assign memory to processes.
Deallocation
Release memory after it is no longer required.
Protection
Prevent unauthorized memory access.
Think of RAM as a large building containing rooms. Different processes need rooms of different sizes. The memory manager decides where processes can be placed and which areas are free.
🧩 24. Fragmentation
Internal Fragmentation
Unused memory exists inside an allocated block because the block is larger than the requested allocation.
External Fragmentation
Free memory exists, but it is divided into separated holes.
Suppose memory allocation gives a process a 100 KB block but the process needs only 92 KB. The unused 8 KB inside the allocated block represents internal fragmentation.
📄 25. Paging
Paging divides logical memory into fixed-size blocks called pages. Physical memory is divided into fixed-size blocks called frames.
📄 Page
Fixed-size block of logical/virtual memory.
🧱 Frame
Fixed-size block of physical memory.
📋 Page Table
Maps page numbers to frame numbers.
Suppose:
- Page size = 1 KB = 1024 bytes
- Logical address = 2500
Page number:
Therefore:
Suppose the page table says:
Physical address:
Answer: Physical address = 7620
🎯 Exam Shortcut
For a page size of 2n bytes, the lower n bits of a logical address represent the offset.
🔢 26. Logical to Physical Address Translation
A logical address generated by the CPU can be divided into:
The page number is used to locate the corresponding frame using the page table.
Page size = 1024 bytes. Logical address = 4097.
Therefore:
If Page 4 maps to Frame 9:
📚 27. Segmentation
Segmentation divides a program into logical segments such as code, data, stack and other logical units. Unlike paging, segments can have different sizes.
A program may conceptually contain:
- Code segment
- Data segment
- Stack segment
- Heap segment
The segmentation mechanism can represent these logical units separately.
☁️ 28. Virtual Memory
Virtual memory allows a process to execute even when its complete address space is not simultaneously loaded into physical memory.
Suppose a process logically requires 8 GB of address space but only part of it is actively needed at a particular moment. Virtual-memory techniques can allow only the required portions to be brought into physical memory as needed.
🚨 Page Fault
A page fault occurs when a process references a page that is not currently present in physical memory.
The operating system must handle the fault and bring the required page into memory if possible.
🔄 29. Page Replacement Algorithms
FIFO
Replace the page that entered memory first.
LRU
Replace the page that has not been used for the longest time.
Optimal
Replace the page whose next use is farthest in the future.
Consider a simplified reference sequence:
With three frames, FIFO initially loads:
When page 4 needs to be loaded and the frames are full, FIFO removes the page that entered earliest, namely page 1.
⚠️ Belady's Anomaly
Belady's anomaly is classically associated with FIFO page replacement. Increasing the number of page frames can, for certain reference strings, increase the number of page faults.
📂 30. File Management
File management involves organizing files and directories, maintaining file attributes and controlling operations such as creation, reading, writing and deletion.
| File Attribute | Meaning |
|---|---|
| Name | Human-readable file name. |
| Identifier | Unique internal identifier. |
| Type | Indicates the kind/type of file. |
| Location | Information about where the file is stored. |
| Size | File size. |
| Protection | Access-control information. |
| Date and Time | Creation/modification/access information where supported. |
📌 Common File Operations
📦 31. File Allocation Methods
Contiguous Allocation
File blocks are stored in consecutive disk locations.
Linked Allocation
File blocks can be located at different positions and connected through pointers.
Indexed Allocation
An index block stores pointers to the file's data blocks.
Suppose a file requires five blocks.
Contiguous allocation might store:
The blocks are consecutive.
Linked allocation could instead use blocks at different locations, with each block pointing to the next block.
💿 32. Disk Scheduling
Disk scheduling determines the order in which pending disk requests are serviced.
FCFS
Services requests in arrival order.
SSTF
Chooses the request with the shortest seek distance from current head position.
SCAN
Moves in one direction servicing requests, then reverses direction.
C-SCAN
Services in one direction and returns to the beginning without servicing requests during the return.
Suppose the current disk head is at cylinder 50 and pending requests include:
Distances from 50:
The closest request is 45, so SSTF selects 45 first.
🐧 33. Linux Operating System
Linux is an open-source Unix-like operating-system kernel used as the basis for many Linux distributions.
| Directory | Common Purpose |
|---|---|
| / | Root of the filesystem hierarchy. |
| /home | Home directories of ordinary users. |
| /root | Home directory of the root user. |
| /etc | System-wide configuration files. |
| /dev | Device files. |
| /tmp | Temporary files. |
| /var | Variable data such as logs and spool data. |
| /proc | Virtual filesystem exposing process/kernel information. |
⌨️ 34. Important Linux Commands
| Command | Purpose | Example |
|---|---|---|
| pwd | Shows current working directory. | pwd |
| ls | Lists directory contents. | ls |
| cd | Changes directory. | cd Documents |
| mkdir | Creates directory. | mkdir test |
| rmdir | Removes an empty directory. | rmdir test |
| cp | Copies files/directories. | cp a.txt b.txt |
| mv | Moves or renames files/directories. | mv old.txt new.txt |
| rm | Removes files/directories according to options and permissions. | rm file.txt |
| cat | Displays/concatenates file contents. | cat file.txt |
| grep | Searches text using patterns. | grep word file.txt |
| chmod | Changes file permissions. | chmod 755 file |
| ps | Displays process information. | ps |
🔥 DSSSB TGT High-Priority Operating System Topics
⭐⭐⭐⭐⭐
CPU Scheduling and numerical problems
⭐⭐⭐⭐⭐
Deadlock and Banker's Algorithm
⭐⭐⭐⭐⭐
Paging, virtual memory and page replacement
⭐⭐⭐⭐
Process management and PCB
⭐⭐⭐⭐
Synchronization and semaphore
⭐⭐⭐⭐
File and disk management
⚡ 35. Operating System Quick Revision
Basic Concepts
OS: System software that manages hardware resources and provides services to programs.
Kernel: Core component of the OS.
Process: Program in execution.
PCB: Process Control Block.
CPU Scheduling
FCFS → First Come First Served
SJF → Shortest Job First
SRTF → Shortest Remaining Time First
RR → Round Robin with time quantum
Deadlock
Mutual Exclusion + Hold and Wait + No Preemption + Circular Wait
Memory
Paging → Pages + Frames + Page Table
Virtual Memory → Allows execution without requiring the complete address space in physical memory simultaneously.
Page Replacement
FIFO + LRU + Optimal
File Management
Contiguous + Linked + Indexed allocation
📝 Official Previous-Year Question Note
Do not confuse a newly created practice question with an actual previous-year DSSSB question.
The official DSSSB TGT Computer Science previous-year material contains Operating System questions. For example, an official 2021 TGT Computer Science paper includes a question asking which items among process management, memory management and security are functions of an operating system; the correct combination is all three.
For your blog, always label questions as: Actual PYQ + Year only after verifying them against the official DSSSB paper.
🧠 36. DSSSB TGT Operating System Practice Quiz
The following questions are provided as exam-oriented practice questions. They are not labelled as previous-year questions unless explicitly identified as such.
Which software manages computer hardware resources and provides services to application programs?
The operating system manages hardware resources and provides services to application programs.
A program in execution is called:
A process is an executing instance of a program.
Which data structure contains information required to manage a process?
PCB stands for Process Control Block.
Which CPU scheduling algorithm uses a time quantum?
Which scheduling algorithm is normally associated with the shortest CPU burst?
Which algorithm is the preemptive counterpart of SJF?
Which scheduling problem occurs when low-priority processes may wait indefinitely?
Which technique can help reduce starvation in priority scheduling?
Which of the following is a necessary condition for deadlock?
Which algorithm is associated with deadlock avoidance?
In paging, physical memory is divided into:
Logical memory is divided into:
Which structure maps pages to frames?
A page fault occurs when:
Which page replacement algorithm can exhibit Belady's anomaly?
Which page replacement algorithm uses the page that has not been used for the longest time?
Which algorithm theoretically gives the minimum possible number of page faults for a known future reference string?
Which of the following is a synchronization primitive?
Which of the following is a necessary condition for deadlock?
Which file allocation method stores file blocks in consecutive disk locations?
Which disk scheduling algorithm chooses the request closest to the current head position?
Which disk scheduling algorithm is commonly described as an elevator algorithm?
What is the purpose of a device driver?
Which directory commonly contains system-wide configuration files in Linux?
Which command is commonly used to display the current working directory in Linux?
Which command lists files/directories?
Which command is used to change the current directory?
Which data structure is associated with a process?
Which scheduling algorithm is non-preemptive in its basic form?
Which formula correctly represents waiting time?
✅ Final DSSSB TGT Operating System Checklist
❓ Frequently Asked Questions
What is an Operating System?
What is a process?
What is PCB?
What are the four necessary conditions for deadlock?
What is paging?
What is a page fault?
What is Round Robin scheduling?
What is Banker's Algorithm?
What is the difference between page and frame?
Which Linux command displays the current working directory?
🚀 Master Operating System for DSSSB TGT Computer Science
Read the theory first, understand the worked examples, memorize important one-liners and then solve numerical scheduling, paging, deadlock and disk-scheduling problems.
Concept → Example → Formula → Practice → Revision
📌 Educational Disclaimer
This article is intended for educational and competitive examination preparation. Always verify the latest official DSSSB notification, syllabus and examination instructions before the examination.
Questions created specifically for practice in this article should not be represented as official previous-year questions.
.png)