Operating System
OS Part-1
OS Part-2
- File Concepts and Access methods
- Free Space Management and Allocation methods
- Directory Systems and Protection
- File Organization, Sharing and Implementation issues
- Disk and Drum Scheduling
- I/O Devices Organisation & I/O Buffering
- I/O Hardware, Kernel I/O subsystem and Transforming I/O Requests to Hardware Operations
- Device Drivers and Path Management
- Device Driver Sub Modules and Procedure
- Device Scheduler and Handler
- Interrupt Service Routine (ISR)
- File System in Linux and Windows
OS Part-3
- Process and Process Control Block(PCB)
- Process Scheduling( Preemptive and Non Preemptive)
- Scheduling Algorithms
- Algorithm Evaluation
- Multiple Processor Scheduling
- Real Time Scheduling
- Operations on Processes
- Threads
- Inter-Process Communication
- Precedence Graphs
- Critical Section Problem
- Semaphores
- Classical Problems of Synchronization
- DeadLock
- Deadlock Prevention and Avoidance
- Deadlock Detection and Recovery
- Process Management in Linux
OS Part-4
- Memory Hierarchy in OS
- Concepts of Memory Management
- MFT and MVT
- Logical and Physical Address Space
- Swapping
- Contiguous and Non Contiguous Memory Allocation
- Paging
- Segmentation
- Paging Combined with Segmentation
- Structure and Implementation of Page Table
- Virtual Memory in OS
- Cache Memory Organization
- Demand Paging
- Page Replacement Algorithms
- Allocation of Frames and Thrashing
- Demand Segmentation
OS Part-5
- Distributed Operating System: Introduction and Types
- Distributed OS: Design Issues
- Distributed OS: File System
- Distributed OS: Remote File Access
- Remote Procedure Call(RPC)
- Remote Method Invocation(RMI)
- Distributed Shared Memory
- Parallel Processing and Concurrent Programming
- Security and Threats Protection in Distributed OS
- Security Design Principles and Authentication in Distributed OS
- Sensor Network and Parallel OS
Interrupt Service Routine (ISR) in Operating System
1. Interrupt Kya Hota Hai?
Interrupt ek signal hota hai jo hardware ya software CPU ko bhejta hai taaki uska dhyaan kisi important task par turant khicha ja sake. Jab interrupt aata hai, toh CPU apna current task temporarily pause karke ek special routine execute karta hai jise Interrupt Service Routine (ISR) kehte hain.
Example: Jab aap keyboard par koi key press karte ho, toh ek interrupt generate hota hai jo OS ko batata hai ki koi input aaya hai.
Jab printer ek page print kar leta hai, toh ek interrupt bhejta hai jo batata hai ki print complete ho gaya hai.
2. Interrupt Service Routine (ISR) Kya Hai?
Interrupt Service Routine (ISR) ek function hota hai jo interrupt aane par execute hota hai. Ye ensure karta hai ki jo bhi task zaroori hai, wo properly execute ho jaye aur phir CPU apna previous task resume kar sake.
Interrupt Handling Steps:
Interrupt Generate Hota Hai – Ek hardware/software device interrupt signal bhejta hai.
CPU Apna Current Task Pause Karta Hai – Jo kaam chal raha hai, usko temporarily roka jata hai.
Interrupt Ka Source Identify Kiya Jata Hai – OS check karta hai ki kaunsa device ya software interrupt bhej raha hai.
Interrupt Service Routine (ISR) Execute Hota Hai – Jo bhi zaroori operation hai, wo complete hota hai.
CPU Apne Pehle Wale Task Par Wapas Jata Hai – ISR complete hone ke baad normal execution resume hota hai.
Diagram: Interrupt Handling Process
[User Task] → [Interrupt Occurs] → [Save Current State] → [Execute ISR] → [Resume Task]
3. Types of Interrupts (Interrupt Ke Prakar)
Operating System me do tareeke ke interrupts hote hain:
Hardware Interrupts
Ye hardware devices dwara generate kiye jate hain.
Example:
Jab aap keyboard par key press karte ho, ek interrupt CPU ko batata hai ki input aaya hai.
Jab mouse move hota hai, ek interrupt OS ko notify karta hai.
Jab printer ek page print kar leta hai, ek interrupt OS ko notify karta hai ki next page bhejo.
Software Interrupts
Ye software ya programs dwara generate kiye jate hain.
Example:
Agar ek program zero se divide karta hai (Divide-by-Zero Error), toh ek interrupt generate hota hai.
Jab software OS se koi service request karta hai, toh ek interrupt generate hota hai.
4. Device Driver aur ISR Kaise Kaam Karte Hain?
-
Device Drivers OS aur hardware ke beech communication enable karte hain.
-
Jab koi device attention maangta hai, toh wo ek interrupt CPU ko bhejta hai.
-
Interrupt Service Routine (ISR) jo device driver ke andar hoti hai, wo us interrupt ko handle karti hai aur zaroori kaam complete karti hai.
Example: Keyboard Interrupt Handling
Aap keyboard par ek key press karte ho.
Ek hardware interrupt CPU ko bhej diya jata hai.
CPU temporarily apna kaam stop karta hai aur Keyboard ISR ko call karta hai.
ISR keyboard buffer se data read karta hai.
ISR ye data OS ko send karta hai, aur CPU apna previous task resume karta hai.
Diagram: Keyboard Interrupt Handling
[Key Pressed] → [Interrupt Signal Sent] → [ISR Reads Key] → [OS Receives Input] → [Task Resumes]
5. Interrupt Priority Aur Handling Techniques
Interrupt Priority Levels (Kaunsa Interrupt Pehle Process Hoga?)
Har interrupt ka priority level alag hota hai.
-
High Priority – Power failure, system crash.
-
Medium Priority – Hard disk request, network request.
-
Low Priority – Keyboard input, mouse movement.
Interrupt Handling Techniques
-
Vectored Interrupts – Har interrupt ka apna alags ISR hota hai, jo CPU us interrupt ke liye direct execute karta hai.
-
Polled Interrupts – CPU ek ek device check karta hai aur identify karta hai ki kaunsa device interrupt generate kar raha hai.
6. Conclusion
Interrupts CPU ko batate hain ki koi important event hua hai jo handle karna zaroori hai.
Interrupt Service Routine (ISR) ensure karta hai ki interrupt sahi se process ho.
ISRs device drivers ke andar hoti hain aur hardware interrupts ko manage karti hain.
Interrupts ka priority level hota hai, taaki important interrupts pehle process ho sakein.