0% found this document useful (0 votes)
22 views17 pages

T3 Interrupts

The document discusses interrupts, including hardware interrupts generated by devices and software interrupts generated by programs. It explains that when an interrupt occurs, the current process pauses while an interrupt service routine handles the interrupt, then processing resumes. Interrupts allow devices to get the CPU's attention to perform tasks like handling key presses.

Uploaded by

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

T3 Interrupts

The document discusses interrupts, including hardware interrupts generated by devices and software interrupts generated by programs. It explains that when an interrupt occurs, the current process pauses while an interrupt service routine handles the interrupt, then processing resumes. Interrupts allow devices to get the CPU's attention to perform tasks like handling key presses.

Uploaded by

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

Objectives

• Understand how hardware, firmware and an operating


system are required to run applications
• Understand the role of the bootloader

• Describe the role and operation of interrupts including:


• How an interrupt is generated
• How it is handled using an interrupt service routine
• What happens as a result of the interrupts

• Be able to describe examples of software and


hardware interrupts
Interrupts
Unit 6 Software

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)

• Firmware (both hard and soft) contains programs


that are stored permanently in hardware
• The BIOS stored on a computer
is stored on a flash ROM
• It can only be updated by flashing
the ROM
• Other peripherals may have their own firmware
Interrupts
Unit 6 Software

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

• The operating system itself runs on


top of the firmware Firmware
• The bootloader and other firmware runs
on the physical hardware itself

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

• What happens to the current process


that is running on the processor?
Interrupts
Unit 6 Software

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

Interrupt Service Routine (ISR)


• Once the CPU has been interrupted, it needs to
process the interrupt
• It runs the interrupts program code known as an Interrupt
Service Routine (ISR)
• This is also known as an interrupt handler
• The ISR needs to execute as quickly as possible as it has
interrupted the CPU from the task it was working on
• For instance, if a key is pressed, the ISR may save the key
that was pressed. Later, a word-processor task can process it
further
Interrupt service
Interrupt routine (ISR) Processor returns to
generated previous task
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

• When a fault occurs


an interrupt service
routine is called
which handles
the error
Interrupts
Unit 6 Software

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

Bootloader Firmware Interrupt

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

© 2021 PG Online Limited

The contents of this unit are protected by 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.

You might also like