Cambridge IGCSE0478

Types of software and interrupts

Computer Science 0478 Chapter Notes

What this chapter covers

Types of software and interruptsTypes of programming language, translators and integrated development environments (IDEs)
ShareWhatsAppPost
Types of software and interrupts notes

Unable to load PDF

The notes viewer could not load. Please refresh the page.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Types of software and interrupts notes as text: skim, search, and jump between subtopics.

~11 min read

1. System vs. Application Software

All computers run on software, which are sets of instructions that tell the hardware what to do. Software is broadly divided into two main types: System Software and Application Software. Think of it like a restaurant: System Software is the kitchen, the chefs, and the waiters – everything needed to make the restaurant run. Application Software is the actual meal you order and eat. You can't get your meal without the kitchen and staff operating correctly.

System Software manages the computer's hardware and provides a platform for other software. Its job is to run and maintain the computer system itself. The most important piece of system software is the Operating System (OS). Other examples include utility programs like anti-virus software and disk defragmenters.

Application Software is designed to perform specific tasks for you, the user. This is the software you interact with directly to get things done. Examples include word processors to write essays, web browsers to surf the internet, or games for entertainment. Application software runs 'on top of' the system software.

Key term

System Software: Software designed to run and maintain a computer's hardware and application programs, providing a platform for them to operate.

Examiner insight

Examiners reward answers that clearly distinguish the *purpose* of each software type, not just list examples. Use phrases like 'manages hardware' for system software and 'performs user tasks' for application software.

Common pitfall

Confusing utility programs with application software. Remember, if the software's main purpose is to help the computer run or maintain itself (like an antivirus scan), it's system software. If it helps the user do a personal task (like edit a photo), it's application software.

Worked example 13 marks

Describe the difference between system software and application software, giving a clear example of each.

  1. 1

    System software is designed to manage the computer's hardware and provide a platform for other software. An example is the Operating System, like Windows or macOS.

  2. 2

    Application software is designed to perform specific tasks for the end-user. An example is a spreadsheet program, like Microsoft Excel.

  3. 3

    The key difference is that system software's purpose is to run the computer system itself, whereas application software's purpose is to complete a user-focused task. Application software relies on system software to function.

Recap

  • Software is a set of instructions that tells the computer hardware what to do.
  • System software manages the computer's hardware and resources, like the Operating System (OS).
  • Application software allows a user to perform a specific task, like writing a document or browsing a website.
  • Application software cannot run without system software being present and running first.

Quick check

  1. Is a video game an example of system or application software?1 mark
  2. Name one example of a utility program.1 mark

2. The Role of the Operating System

The Operating System (OS) is the most important type of system software. It acts as the central coordinator for everything that happens on a computer, managing both hardware and software resources. It's the essential bridge that allows your applications to communicate with the physical hardware. The main functions of an OS are:

  • Memory Management: The OS is in charge of the main memory (RAM). It allocates memory to applications that are running and ensures they don't use memory assigned to another program, which would cause crashes. When you close a program, the OS reclaims the memory so it can be used by something else.
  • Processor Management (Scheduling): In a modern computer, many processes seem to run at once. The OS manages the CPU's time, switching between processes very quickly to give the illusion of multitasking.
  • File Management: The OS is responsible for the file system. It handles the creation, naming, copying, moving, and deletion of files and folders, and keeps track of where they are stored on a hard drive or SSD.
  • Input/Output (I/O) Management: The OS manages all communication with peripheral devices, such as the keyboard, mouse, monitor, and printer. It uses programs called 'device drivers' to translate generic commands (like 'print') into specific instructions for a particular piece of hardware.
  • Providing a User Interface: The OS gives the user a way to interact with the computer, typically through a Graphical User Interface (GUI) with icons and windows, or a Command Line Interface (CLI) where commands are typed.

Key term

Operating System (OS): System software that manages all computer hardware and software resources and provides common services for computer programs.

Fun fact

The world's most popular operating system isn't Windows or macOS, but Linux. The Linux kernel is the foundation for Android, which runs on billions of smartphones worldwide.

Worked example 13 marks

An operating system performs memory management. Describe this function.

  1. 1

    Memory management is the process where the Operating System controls and organises the computer's main memory (RAM).

  2. 2

    It allocates specific blocks of memory to programs and data when they are needed for processing.

  3. 3

    Crucially, it ensures that separate processes cannot interfere with each other's allocated memory space, preventing data corruption and system crashes. It also deallocates memory when a program is closed.

Worked example 22 marks

Give two functions of an operating system, other than memory management.

  1. 1

    Function 1: File management. The OS organises files and directories on secondary storage, handling tasks like creating, deleting, and finding files.

  2. 2

    Function 2: Providing a user interface. The OS gives the user a way to interact with the computer, for example, through a GUI (Graphical User Interface).

Recap

  • The OS is the core software that manages all hardware and software.
  • Key OS functions include memory, processor, file, and I/O management.
  • The OS provides a user interface (GUI or CLI) for user interaction.
  • It uses device drivers to communicate with peripheral hardware.
  • The OS handles security by managing user accounts and access rights.

Quick check

  1. Which OS function is responsible for organising your documents in folders?1 mark
  2. What is the name of the software that allows the OS to communicate with a specific printer model?1 mark

3. Introduction to Interrupts

An interrupt is a signal sent to the processor that indicates an event needs its immediate attention. This signal causes the processor to pause the task it is currently performing so it can deal with the new, more urgent request. Interrupts are essential for a computer to operate efficiently, as they allow the CPU to perform other tasks instead of waiting for slow events (like a user typing). There are two main categories of interrupts:

  • Hardware Interrupts: These are signals generated by a physical hardware device connected to the computer. They are asynchronous, meaning they can happen at any time. Examples include:
  • Pressing a key on the keyboard or clicking the mouse.
  • A printer signalling it is out of paper or has finished a job.
  • A network card indicating a data packet has arrived.
  • A hard drive signalling that it has finished reading a requested block of data.
  • Software Interrupts: These are generated by a piece of software. They can be caused by an error in a program or when a program needs to request a service from the operating system. Examples include:
  • A division by zero error occurring in a calculation.
  • An attempt to execute an illegal instruction.
  • A program requesting to read data from a file (this is a request to the OS).
  • A timer signalling that a certain amount of time has elapsed, used for multitasking.

Key term

Interrupt: A signal sent from a device or from software to the processor, causing it to temporarily stop its current operations to attend to the signal.

Common pitfall

Thinking that interrupts are only for errors. Many interrupts are routine, normal events, such as a mouse click or a key press, that are essential for the computer to function interactively.

Worked example 12 marks

State what is meant by an interrupt.

  1. 1

    An interrupt is a signal sent to the processor from either a hardware device or a software program.

  2. 2

    This signal requests the processor's attention, causing it to pause its current task to service the interrupt.

Worked example 22 marks

Give one example of a hardware interrupt and one example of a software interrupt.

  1. 1

    Hardware Interrupt Example: A user clicks the mouse, sending a signal to the CPU.

  2. 2

    Software Interrupt Example: A program attempts to access a memory location that is not allocated to it, causing a protection fault.

Recap

  • An interrupt is a signal to the CPU that an event requires immediate attention.
  • Interrupts cause the CPU to pause its current process to handle the event.
  • Hardware interrupts are generated by physical devices like a keyboard or printer.
  • Software interrupts are generated by programs, often due to an error or a request for an OS service.

Quick check

  1. Is a 'disk read complete' signal a hardware or software interrupt?1 mark

4. How the CPU Handles Interrupts

When the CPU receives an interrupt, it doesn't just stop randomly. It follows a precise sequence of steps called the interrupt handling process to ensure it can deal with the event and then return to its original task without losing its place. Interrupts are checked at the end of each Fetch-Decode-Execute (FDE) cycle.

The process is as follows:

  1. Complete Current Cycle: The processor finishes the current FDE cycle it is executing. It will not stop in the middle of an instruction.
  2. Check for Interrupts: The processor checks a special pin or internal flag to see if any interrupt requests are pending.
  3. Prioritise: If there is an interrupt, the processor checks its priority. Some interrupts (like a power failure warning) are more urgent than others (like a key press). If the interrupt has a high enough priority, the process continues.
  4. Suspend Current Process: The CPU suspends the currently running program.
  5. Save Context: The current state of the program is saved. This means the contents of all the CPU's registers (like the Program Counter (PC) and Accumulator (ACC)) are copied to a special location in memory called the stack.
  6. Load ISR: The processor identifies the cause of the interrupt and loads the starting address of the appropriate Interrupt Service Routine (ISR) into the Program Counter. An ISR is a small, dedicated program written to handle one specific type of interrupt.
  7. Execute ISR: The CPU executes the ISR, which deals with the event (e.g., reads the key press from the keyboard buffer, sends an error message to the screen).
  8. Restore Context: Once the ISR is complete, the saved state of the original program is retrieved (popped) from the stack and loaded back into the registers.
  9. Resume Original Process: The original program continues its execution from the exact point it was interrupted, as if nothing had happened.

Key term

Interrupt Service Routine (ISR): A specific block of code that the processor executes in response to a corresponding interrupt to handle the event that occurred.

Examiner insight

To earn full marks on describing the interrupt process, you must mention both saving the state of the current process to the stack and restoring it afterwards. This save/restore mechanism is the key to seamless multitasking and is a crucial detail examiners look for.

Fun fact

The concept of an interrupt was first introduced in the UNIVAC 1103 computer in 1953. Before this, CPUs would waste huge amounts of time in 'polling loops', constantly checking if a device needed attention, which was incredibly inefficient.

Worked example 15 marks

A printer sends an interrupt to the computer to say that it is out of paper. Describe the stages involved in the processor handling the interrupt.

  1. 1

    The CPU completes its current Fetch-Decode-Execute cycle.

  2. 2

    It checks for interrupts and detects the high-priority signal from the printer. It then suspends execution of the current program.

  3. 3

    The contents of its internal registers (e.g., Program Counter, Accumulator) are pushed onto the stack in memory to save the current state.

  4. 4

    The starting address of the Interrupt Service Routine (ISR) for the 'printer out of paper' event is loaded into the Program Counter. The CPU then executes this ISR, which will likely cause an error message to be displayed to the user.

  5. 5

    After the ISR has finished, the saved register contents are popped from the stack and restored. The original program then resumes execution from where it left off.

Recap

  • The CPU checks for interrupts at the end of each FDE cycle.
  • If an interrupt occurs, the current process's state (register contents) is saved to the stack.
  • A specific Interrupt Service Routine (ISR) is loaded and executed to handle the event.
  • After the ISR is complete, the original process's state is restored from the stack.
  • The original process then continues execution seamlessly.

Quick check

  1. What is the purpose of saving the contents of the registers to the stack during an interrupt?2 marks

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. State what is meant by an interrupt.2 marks
  2. Give two examples of application software and state their generic name (e.g., Word Processor).2 marks
  3. Describe the difference between system software and application software.3 marks
  4. An operating system provides a user interface. Name two types of user interface and describe the key features of one of them.3 marks
  5. A user clicks the mouse, which generates a hardware interrupt. Explain why interrupts are a more efficient method for handling this than the CPU constantly checking the mouse status.4 marks
  6. Describe two tasks performed by the file management function of an Operating System.4 marks
  7. Explain the role of the stack in the process of handling a processor interrupt.4 marks
  8. A program attempts to divide a number by zero, generating a software interrupt. Describe, in detail, the steps the processor takes to handle this event.5 marks
  9. Compare a hardware interrupt with a software interrupt, giving a clear example of each to support your answer.4 marks
  10. Explain how memory management by the operating system allows multiple applications, like a web browser and a word processor, to run at the same time without interfering with each other.6 marks

Go deeper

Practise and revise with member-only material for this chapter.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters