T3 Interrupts
T3 Interrupts
Starter
• ROM on a computer stores programs that cannot be
changed as they are stored on Read Only Memory
• Are these programs software or hardware?
• Discuss your thoughts with a partner
Interrupts
Unit 6 Software
Firmware
• Hardware is a physical object
• The term is used for all physical components of a computer or
peripherals
• Software isn’t a physical object, so it is given the opposite
name (soft rather than hard)
Bootloader
• When you first turn on a computer it starts running
firmware stored in the ROM
• These instructions then load the
first instructions from the hard disk
telling the computer what tasks
to do
• The part of the hard disk that stores
these instructions is the boot sector
• Turning on a computer is
known as ‘booting’ after
“pulling yourself up by
your bootstraps”
Interrupts
Unit 6 Software
Running applications
• Applications run on the computer’s Applications
operating system
• If they need to access hardware, they do
this via ‘calls’ to the operating system or
Operating system
device drivers
Hardware
Interrupts
Unit 6 Software
Worksheet 3
• Complete Task 1 on Worksheet 3
Interrupts
Unit 6 Software
Interrupts
• When you need to get the
attention of someone who is busy
you need to interrupt them
• In the same way, peripheral devices
also need to get the attention of the CPU
• They do this by sending an interrupt
which leads to the relevant
interrupt service routine (ISR) being run
Interrupts
• The current process will need to pause, but it will
need to be restarted later
• The value stored in the program counter (PC) is saved
in a location in RAM
• No more instructions of the following task are performed (they
will be later)
Interrupts
Unit 6 Software
Hardware interrupts
• Hardware devices send interrupt signals to the CPU
• The interrupts are sent via Interrupt Request Lines (IRQ)
• For instance, if a key on a keyboard is pressed, an interrupt
will be sent (actually an interrupt is sent when the key is
pressed and another is sent when it is released)
• When a mouse is moved, constant
interrupts are sent to the
computer so that it
is able to update
the location of
the pointer
Interrupts
Unit 6 Software
Software interrupts
• Software interrupts are generated by programs that
are running
• For instance, if a program tries to divide by zero, a ‘division by
zero’ interrupt will need
to be handled
• In this case, an
exception is
handled by the OS
Interrupts
Unit 6 Software
Software interrupts
• Software interrupts deal with faults such as:
• Page faults – this is when the data isn’t in RAM, but in
virtual memory and needs to be loaded back into RAM
• Segmentation faults – this is when the one program tries to
make an illegal memory location, such as the memory used
by another program
Worksheet 2
• Complete Task 2 on Worksheet 3
Interrupts
Unit 6 Software
Plenary
• Take turns to explain to a partner each of the
following terms
Interrupt service
Software interrupt Hardware interrupt
routine (ISR)
Interrupts
Unit 6 Software
Plenary
• Bootloader – the first instructions a computer runs that tell it
where to find the boot sector on the hard drive. The bootloader
is stored in the ROM’s firmware
• Firmware – programs stored in ROM
• Interrupt – A signal sent to a processor causing it to pause the
current task and handle the interrupt
• Hardware interrupt – interrupts generated by hardware, such
as a key press or mouse movement
• Software interrupt – interrupts generated by software, such as
an attempted division by zero or an attempt to access a
memory location currently being used by another program
• Interrupt service routine – a short set of instructions that is
executed when an interrupt occurs – also known as an
interrupt handler
Interrupts
Unit 6 Software
Copyright
This unit and all the worksheets, PowerPoint presentations, teaching guides and other associated files distributed
with it are supplied to you by PG Online Limited under licence and may be used and copied by you only in
accordance with the terms of the licence. Except as expressly permitted by the licence, no part of the materials
distributed with this unit may be used, reproduced, stored in a retrieval system, or transmitted, in any form or by
any means, electronic or otherwise, without the prior written permission of PG Online Limited.
Licence agreement
This is a legal agreement between you, the end user, and PG Online Limited. This unit and all the worksheets,
PowerPoint presentations, teaching guides and other associated files distributed with it is licensed, not sold, to
you by PG Online Limited for use under the terms of the licence.
The materials distributed with this unit may be freely copied and used by members of a single institution on a
single site only. You are not permitted to share in any way any of the materials or part of the materials with any
third party, including users on another site or individuals who are members of a separate institution. You
acknowledge that the materials must remain with you, the licencing institution, and no part of the materials may
be transferred to another institution. You also agree not to procure, authorise, encourage, facilitate or enable any
third party to reproduce these materials in whole or in part without the prior permission of PG Online Limited.