Study Guide Instructor view
Firmware, Booting and Interrupts
Teaching notes for Lesson 3.9, with controls for presenting it.
Keep this page on your own screen. Share only the lesson window. The lesson window holds no teaching notes, so sharing it cannot show them.
Presenting
- Open the lesson in its own window and share that window, not this one.
- Use Next and Previous here, or the lesson’s own, to move through the lesson. Next reveals one thing at a time: the next idea, or the answer to the question on screen, then the next step. Previous takes the last reveal back. The line below says what is on screen and what Next will show.
- Reveal hints and answers when the class is ready, and reset a demonstration before using it again.
The controls need JavaScript and a browser that supports BroadcastChannel. Without them, open the lesson in presentation mode and use its own controls.
The two windows talk to each other only inside this browser, on this device. Nothing is sent to a server, and no account is needed. A second device (a phone or another tablet) cannot follow the lesson window yet.
Now on the lesson window
- On screen
- Next teaching point
Guidance for this point
Lesson plan
- Level
- Intermediate
- Time
- About 75 minutes; the steps below add up to 75
Pupils work out for themselves what must run first when the power button is pressed and RAM is empty, then put start-up in order, and use a teacher interrupted by a fire alarm to discover how the CPU can be interrupted, keep its place and carry on. They meet hardware and software interrupts and the end-of-cycle check by reasoning before the terms are given. The lesson ends with pupils explaining a key press in order and ordering the layers, so you can see whether they understand sequence and cause, not just vocabulary.
Objectives
- Explain why a computer needs hardware, firmware and an operating system to run an application, and the order in which they start
- Describe what a bootloader does when a computer is switched on
- Explain what an interrupt is, and how one is generated and handled by an interrupt service routine
- Describe what happens as a result of an interrupt, including how the CPU returns to its program
- Give examples of hardware interrupts and software interrupts, and classify a given event
Before the lesson
- Draw a vertical stack on the board with the layers empty: hardware at the bottom, then a gap for firmware, a gap for the operating system and the application at the top; fill it in during the lesson.
- Mini whiteboards for predictions and show-me answers.
- Prepare a marking story prop: a few sheets of paper and a pen, so a pupil can act the teacher who is interrupted and must keep her place with a finger.
- Have the made-up fire alarm sentence ready to read aloud at the right moment in the-fire-alarm step.
Steps
Introduction Opening
On the lesson window now
On screen: the lesson’s title, module and number; Next adds its objectives and key terms, as the lesson page lists them; Next again begins the first step.
Objectives on screen
- Explain why a computer needs hardware, firmware and an operating system to run an application, and the order in which they start
- Describe what a bootloader does when a computer is switched on
- Explain what an interrupt is, and how one is generated and handled by an interrupt service routine
- Describe what happens as a result of an interrupt, including how the CPU returns to its program
- Give examples of hardware interrupts and software interrupts, and classify a given event
Purpose: Pupils work out for themselves what must run first when the power button is pressed and RAM is empty, then put start-up in order, and use a teacher interrupted by a fire alarm to discover how the CPU can be interrupted, keep its place and carry on. They meet hardware and software interrupts and the end-of-cycle check by reasoning before the terms are given. The lesson ends with pupils explaining a key press in order and ordering the layers, so you can see whether they understand sequence and cause, not just vocabulary.
1. From the power button to the game Think 12 min
On the lesson window now
Purpose: Pupils reason that the first program must be small, fixed and already in place because RAM is empty, so that firmware and the bootloader are conclusions and not definitions.
Ask
- Something has to run first, before the operating system. What kind of program could it be, where could it be kept, and what job must it do?
- What does the bootloader do?
- What runs on what in the finished stack?
Responses to expect
- A small program in memory that keeps its contents without power, such as ROM
- It finds the operating system on the drive, copies it into RAM and lets it take over
- The application on the operating system, the operating system on the firmware, all on the hardware
Misconceptions to challenge
- A learner may believe: “The operating system could be the first program, because it is the most important one.” Respond: It lives on the drive and RAM is empty at switch-on, so something already in place must load it.
- A learner may believe: “Firmware is the operating system stored in a chip.” Respond: The operating system is loaded from the drive into RAM; the firmware holds the small bootloader that does the loading.
- A learner may believe: “The game can run directly on the firmware without an operating system.” Respond: Applications run on the operating system. Ask what the firmware loads.
On the board or with the pen
- Fill the empty stack as pupils decide: bootloader in firmware, operating system loaded into RAM, application on top.
What learners should notice
- Firmware holds a program that must be there at switch-on.
- The order is hardware, bootloader, operating system, application.
Checking understanding: Pupils write the kind of program, where it is kept and its job on whiteboards before the StepThrough.
Depending on the answers
- If pupils say the first program is on the hard drive: ask whether the CPU can read the drive directly and what the CPU has when first switched on.
- If answers are secure: ask what could go wrong if the firmware were damaged.
English as an additional language
- Check boot, firmware and switch-on; ‘boot’ as ‘start up’.
Discussion pause: Thirty seconds of silent thinking, then pairs share a guess for where the first program is kept.
In the lesson window
- Think it through: Something has to run first, before the operating system, and it must already be in place at the moment of switch-on. What kind of program could this be, where could it be kept, and what job must it do?
2. Putting the start-up in order Explain 12 min
On the lesson window now
Purpose: Pupils number the start-up events and then answer three questions that test why the operating system is on the drive, whether firmware is hardware, and what a game relies on.
Ask
- Which event comes first, and which comes after the operating system is found?
- Why is the bootloader kept in firmware but the operating system on the drive?
- Is firmware hardware, because it is in a chip?
- What does a game rely on to run?
Responses to expect
- Bootloader runs, finds the OS, copies it into RAM, OS takes over, user opens the application
- The OS is large and updated often; only the small bootloader needs to be in permanent memory
- No: it is a program, kept in non-volatile hardware
- The operating system, loaded by the bootloader in the firmware, which runs on the hardware
Misconceptions to challenge
- A learner may believe: “The operating system is too fast to be kept in firmware.” Respond: Speed is not the reason. Ask how big an operating system is and how often it changes.
- A learner may believe: “Firmware loses its contents when the power is off.” Respond: It is kept in non-volatile memory; ask why only a small program is kept there.
- A learner may believe: “Firmware is a kind of application because the user can open it.” Respond: The bootloader runs before the operating system exists; ask which group of software it belongs to.
- A learner may believe: “A game relies only on the hardware, because the CPU carries out its instructions.” Respond: The game also needs services such as saving files and drawing windows. Ask which layer provides them.
On the board or with the pen
- Write the six events as a numbered list on the right of the stack and draw arrows between the two.
What learners should notice
- Each layer needs the one beneath it.
- ‘Software stored in hardware’ is the key phrase for firmware.
Checking understanding: The boot-order table, then the three questions; ask pupils which wrong option describes the wrong layer.
Depending on the answers
- If most pupils misplace the copy into RAM: ask what must be done before something can be copied: finding it.
- If answers are secure: ask why a computer cannot start with no firmware at all.
Support
- Provide the six events on cards to put in order.
English as an additional language
- Check bootloader, load and layer; use the stack picture.
Discussion pause: Ask pupils to number the six events on paper before comparing.
In the lesson window
- Check your understanding: The bootloader is kept in firmware, but the operating system is kept on the drive. What is the best reason?
- Apply it: Dev says: “Firmware is hardware, because it is stored in a chip inside the computer.” What is the best correction?
- Apply it: A pupil installs a game on a laptop. Which of these correctly states what the game relies on to run?
3. The fire alarm Think 12 min
On the lesson window now
Purpose: Pupils work out what a teacher must do when an alarm interrupts her marking, so that an interrupt, saving the place and resuming are met as natural steps.
Ask
- What should the teacher do about the marking, and in what order?
- What does she need to remember to carry on without starting again?
- Why does the CPU save its registers, including the program counter, before running the interrupt routine?
Responses to expect
- Stop at once, note where she was, deal with the alarm, go back
- The place: the page and line
- So it can return to the interrupted program and carry on from where it stopped
Misconceptions to challenge
- A learner may believe: “The registers are saved so the interrupt routine can use them to find the key press.” Respond: The routine has its own work to do. Ask what the CPU would not know afterwards if the program counter had not been saved.
- A learner may believe: “The program is restarted from its first instruction afterwards.” Respond: The aim is the opposite: carry on from where it was, not start again.
- A learner may believe: “The teacher should finish marking the whole essay before dealing with the alarm.” Respond: The alarm cannot wait, which is why it interrupts.
On the board or with the pen
- Draw the teacher’s marking as a line with a finger marker, a detour for the alarm and a return to the marker.
What learners should notice
- Saving the place is what makes resuming possible.
- The program counter is the finger on the line.
Checking understanding: The why-save-pc check; ask pupils to explain each wrong option in terms of the teacher.
Depending on the answers
- If pupils choose ‘restart’: ask what the teacher would lose if she began page one again.
- If answers are secure: ask which register would be saved to remember the next instruction.
English as an additional language
- Check alarm, interrupt and resume; act the story.
Discussion pause: Pairs write the order of actions before the StepThrough.
In the lesson window
- Think it through: What should the teacher do about the marking, and in what order? What does she need to remember, to carry on afterwards without starting again?
- Check your understanding: Why does the CPU save its registers, including the program counter, before it runs an interrupt service routine?
4. Why not just keep checking? Predict 12 min
On the lesson window now
Purpose: Pupils weigh checking every device again and again against being interrupted, then sort events into hardware and software interrupts.
Ask
- What is the drawback of checking the keyboard, mouse and every device over and over?
- What does an interrupt let the CPU do instead?
- Which event would generate a software interrupt?
Responses to expect
- Most checks would find nothing, wasting time
- Carry on with its work until a device actually needs attention
- A program trying to use a memory location another process is using
Misconceptions to challenge
- A learner may believe: “Moving the mouse or pressing a key produces a software interrupt.” Respond: A mouse and a keyboard are hardware devices, so their signals are hardware interrupts.
- A learner may believe: “The CPU only reads interrupts when first switched on, or never.” Respond: Interrupts happen while programs run; ask how often the CPU checks.
- A learner may believe: “A software interrupt comes from the operating system alone.” Respond: It is generated by a program, for instance by an error.
On the board or with the pen
- Draw two columns, hardware and software, with examples placed as pupils sort.
What learners should notice
- Hardware interrupts come from devices; software interrupts from programs.
- Interrupts save the CPU from asking questions that mostly get no answer.
Checking understanding: The interrupt-sort table and the interrupt-source check; ask pupils to say what generated each.
Depending on the answers
- If pupils misclassify a program error: ask what produced the signal: a device or a program.
- If the table is quick: ask pupils to name one more hardware and one more software interrupt.
English as an additional language
- Check hardware, software, device and signal; use a mouse and a program picture.
In the lesson window
- Think it through: What would be the drawback of the CPU checking the keyboard, the mouse and every other device again and again? What does an interrupt let the CPU do instead?
- Check your understanding: Which event would generate a software interrupt?
5. Following an interrupt through Apply 15 min
On the lesson window now
Purpose: Pupils follow a mouse movement during a calculation through the CPU, then apply interrupts to three new cases, including when an interrupt is handled.
Ask
- What does the CPU do, in order, when the mouse moves during a recalculation?
- What is wrong with Mia’s claim that the program restarts?
- Which statement describes the division by zero?
- When does the CPU deal with an interrupt that arrives mid-instruction?
Responses to expect
- Notice the hardware interrupt, finish the instruction, save registers, run the routine, restore and resume
- The CPU resumes from the saved program counter and does not restart
- A software interrupt was generated by the division by zero and its routine stopped only that program
- At the end of the current fetch-decode-execute cycle
Misconceptions to challenge
- A learner may believe: “The CPU stops an instruction half way when an interrupt arrives.” Respond: That could leave the data in a mess; ask when the CPU is in a safe position to look.
- A learner may believe: “The CPU deals with the interrupt only when the program ends.” Respond: That could leave a key press waiting a long time.
- A learner may believe: “The error was a hardware interrupt from the keyboard or a power failure.” Respond: Nothing in the story suggests a key press or power fault; ask what the program itself did wrong.
- A learner may believe: “The interrupt routine finishes the program for it.” Respond: The routine only deals with the interrupt. Whose job is it to carry on with the program?
On the board or with the pen
- Write the worked example’s steps as a numbered list: notice, finish, save, run routine, restore, resume.
What learners should notice
- The interrupt check happens at the end of each cycle.
- An error in one program stops only that program.
Checking understanding: Show-me answers for restart-mistake, div-by-zero and interrupt-or-cycle; ask pupils to defend one wrong option as its author.
Depending on the answers
- If pupils choose stopping at once: link back to the cycle: ask what a half-finished instruction would leave.
- If answers are secure: use the Deeper box to ask what should happen if two interrupts arrive together.
Stretch
- Which should be dealt with first: a power failure or a key press? What rule could the CPU use?
English as an additional language
- Offer the frame: First ___, then ___, finally ___.
Discussion pause: Pupils write the order for the mouse example before the callout is read.
In the lesson window
- Apply it: Mia says: “After the interrupt service routine finishes, the CPU has to start the interrupted program again from its first instruction.” What is wrong with this?
- Apply it: A program run by the pupil divides a total by a number that has become 0. The computer shows an error message and closes that program, while the music player carries on. Which statement describes what happened?
- Apply it: The CPU is in the middle of executing an instruction when an interrupt signal arrives. According to this lesson, when does it deal with the interrupt?
6. Show what you know Consolidate 12 min
On the lesson window now
Purpose: Pupils explain the chain from a key press to the game carrying on in order, and order the layers at start-up, which tests sequence understanding in both halves of the lesson.
Ask
- Explain what happens, in order, from a key press during a game until the game carries on, using the words interrupt, interrupt service routine and program counter.
- Which order is correct from switch-on to an opened game?
Responses to expect
- Hardware interrupt, finish the instruction, check at the end of the cycle, save the program counter and registers, run the routine, restore and carry on
- Hardware, bootloader (firmware), operating system, application
Misconceptions to challenge
- A learner may believe: “The operating system runs before the bootloader.” Respond: The operating system cannot load itself; the bootloader loads it.
- A learner may believe: “The application runs before the operating system, or hardware comes last.” Respond: Applications run on the operating system, which needs hardware and firmware beneath it.
On the board or with the pen
- Write the pupils’ key-press chain as a numbered list and underline the three words.
Checking understanding: Collect the explanations; check the order, the saving of the program counter and the resuming.
Depending on the answers
- If explanations skip saving the place: ask what the CPU would do after the routine if it had not saved it.
- If answers are strong: ask pupils to extend the chain to include the start-up that happened before the game opened.
Support
- Provide the steps of the chain as cards to put in order, then write them out.
English as an additional language
- Allow a numbered diagram with short labels.
Discussion pause: Two minutes of silent writing before pairs compare.
In the lesson window
- Think it through: Explain what happens, in order, from the moment a pupil presses a key while a game is running, until the game carries on. Use the words interrupt, interrupt service routine and program counter.
- Check your understanding: Which of these is the correct order, from the first thing that runs to the last, when a computer is switched on and a game is opened?
Lesson recap Closing
On the lesson window now
On screen: the lesson’s objectives again; Next adds the closing question, which asks the class to explain each one in their own words without looking back. It says nothing about what anyone has learnt: use the answers to decide what to revisit.
Points to listen for
- Ask pupils to draw the start-up stack and the interrupt chain on one page from memory.
- Take one wrong option (the operating system is in firmware) and ask pupils to explain why it is plausible and what is true.
- Look ahead: the next lesson is about programming languages and translators, so ask what a CPU can understand when the program is written in words.
- Ask pupils to give one real event that triggers a hardware interrupt and one that triggers a software interrupt.
Consolidation
- Ask pupils to draw the start-up stack and the interrupt chain on one page from memory.
- Take one wrong option (the operating system is in firmware) and ask pupils to explain why it is plausible and what is true.
- Look ahead: the next lesson is about programming languages and translators, so ask what a CPU can understand when the program is written in words.
- Ask pupils to give one real event that triggers a hardware interrupt and one that triggers a software interrupt.