0% found this document useful (0 votes)
92 views

Chapter 1: Introduction: (Computer System Structure and Interrupts)

The document introduces computer system structure and interrupts. It discusses that when a system is powered on, the kernel loads into memory and waits for events called interrupts to occur. Interrupts can be hardware interrupts, generated by devices to request attention, or software interrupts from system calls. The occurrence of interrupts is handled by interrupt service routines that determine the cause and respond accordingly. Interrupts allow an OS to function in an interrupt-driven manner.

Uploaded by

Ayush Duseja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

Chapter 1: Introduction: (Computer System Structure and Interrupts)

The document introduces computer system structure and interrupts. It discusses that when a system is powered on, the kernel loads into memory and waits for events called interrupts to occur. Interrupts can be hardware interrupts, generated by devices to request attention, or software interrupts from system calls. The occurrence of interrupts is handled by interrupt service routines that determine the cause and respond accordingly. Interrupts allow an OS to function in an interrupt-driven manner.

Uploaded by

Ayush Duseja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 20

Chapter 1: Introduction

(Computer System Structure and Interrupts)


Computer System

System
Bus
Controller
 When system is powered on, kernel is first
loaded into the memory.
 Kernel execute a init program, and waits for
some event (response) to occur, This event is
known as Interrupt.
 OS initializes all the aspects of system, from
CPU Registers  Deice Controller 
Memory.
 The occurrence of any event is signaled by
interrupt.
Type of Interrupts
 Interrupts can be :

 Generated by Hardware (Hardware Interrupt)

 Generated by Software (Software Interrupt)


Hardware Interrupt
1. Hardware interrupts are used by devices to communicate
that they require attention from the operating system.
2. Hardware interrupts by sending signal to CPU via system
bus.
3. Hardware interrupts are referenced by an interrupt
number.
4. These numbers are mapped with hardware that created
the interrupt. This enables the system to monitor which
device created the interrupt and when it occurred.

Exp: hard disk signal that it has read some data


Software Interrupt/ Trap
 Interrupt generated by executing a
instruction.
 Software interrupts by a special operation
called a System Call or Monitor Call.
Exp: 1. cout in C++ is a kind of interrupt
because it would make a system to print
something.
2. division by zero
 OS is interrupt driven, it is idle when no
inputs are there to process.
 When CPU is interrupted it stops doing
everything and transfers the control to a
fixed location.
 Fixed Location contains the address
where service for interrupt is located.
 CPU resumes after executing interrupt.
General Mechanism
 When interrupt occurs:

Interrupt transfers control to Interrupt Service


Routine

Routine examines the interrupt info. And calls


interrupt handler.
General Mechanism
 If no. of interrupts are predefined:

Table of pointers is maintained that point to


interrupt routine.

Interrupt vector is a pointer having unique id


and interrupt request for interrupted
devices.
Basic steps when interrupt
occurs:
1. Interrupt Occurred?
2. H/w Transfers control to OS
3. OS preserves current state of CPU by using
Registers and Program counter
4. Determine which kind of interrupt has occurred and
Provides resources
5. When interrupt is executed, address is loaded to
program counter and interrupted services are
resumed.
(Lost Interrupt)
Polling

 Process where the controlling


device waits for an external
device to check for its
readiness or state.

 Queuing all the I/O devices to


see which I/O requested the
service?
I/O Interrupt
 Once the I/O is started, 2 kind of interrupts
may arise:
 Synchronous interrupt (I/O): The control is
transferred to the user process when I/O
completes.
 Asynchronous interrupt (I/O): Returns
control to user process without waiting for I/O
to complete.
Waiting of I/O may be accomplished in 2
ways:

 Wait: it let the CPU wait till the next


interrupt.

 Loop: Loop continues until interrupt is


active.
Device Status Table
 To keep the track of how many I/O requests
are pending
 Device Status Table is maintained.
 Device type
 Address

 State (idle,busy)
Storage Structure and Hierarchy
Magnetic Tape

Optical Tape
Main Memory (RAM)
Any
Query ???

You might also like