👋 Welcome to the World of Software and System Control!

Hi there! This chapter is all about understanding the unsung heroes of computing: the programs that run your device, and the clever mechanisms that keep everything running smoothly without crashing. We will break down the types of software you use every day and learn how the CPU handles urgent requests using something called Interrupts.

Understanding this section is vital because it explains the fundamental relationship between the user, the programs, and the computer hardware itself. Let's dive in!


1. Types of Software (System vs. Application)

All software falls into one of two main categories based on its purpose: System Software or Application Software.

1.1 System Software: The Computer's Manager

System Software is the essential software designed to manage, control, and operate the computer hardware and provide a platform for application software to run.

  • It focuses on the running of the computer itself.
  • Without System Software, the computer wouldn't even start up!
Examples of System Software:

1. Operating System (OS): (We cover this in detail next!) E.g., Windows, macOS, Android.
2. Utility Software: Programs that perform maintenance tasks. E.g., antivirus, disk defragmenters, file compression tools.

1.2 Application Software: The User's Tools

Application Software is designed to perform specific tasks or functions for the user.

  • It focuses on helping the user get work done, be entertained, or communicate.
  • Application software needs the Operating System to function.
Examples of Application Software:

1. Productivity: Word processors, spreadsheets, presentation software.
2. Entertainment: Video games, media players.
3. Communication: Web browsers, email clients.
4. Specialist Tools: CAD software (Computer-Aided Design), accounting packages.

💡 Quick Review: How to Tell Them Apart

If the program helps the computer itself manage its resources (like memory or files), it’s System Software.
If the program helps the human user perform a task (like writing a report or playing a song), it’s Application Software.


2. The Role and Functions of an Operating System (OS)

The Operating System (OS) is the most crucial piece of system software. Think of it as the Master Manager, responsible for coordinating every activity within the computer system.

Analogy Time: The Restaurant Manager

Imagine your computer is a busy restaurant. The OS is the manager. It doesn't cook the food (Application Software), but it makes sure the kitchen (CPU), the waiters (Peripherals), and the storage (Memory/Disks) are all working efficiently together.

The syllabus requires you to know the basic functions of an OS. There are nine main roles:

Key Functions of the Operating System:
  1. Managing Files: Organising, storing, retrieving, deleting, and renaming files and folders on the storage devices.
  2. Handling Interrupts: Responding to signals from hardware or software that require immediate attention (more on this later!).
  3. Providing an Interface: Allowing the user to interact with the computer (e.g., Graphical User Interface (GUI) like icons and windows, or Command Line Interface (CLI)).
  4. Managing Peripherals and Drivers: Controlling all connected devices (printers, mice, etc.). Drivers are special programs that allow the OS to communicate with a specific peripheral.
  5. Managing Memory: Allocating (giving) sections of RAM to applications that need to run, and de-allocating (taking back) memory when they finish.
  6. Managing Multitasking: Allowing many programs to appear to run at the same time by quickly switching the CPU between them (time slicing).
  7. Providing a Platform for Applications: Ensuring that application software has all the necessary components and resources it needs to start and run successfully.
  8. Providing System Security: Managing access rights and ensuring system integrity (e.g., password protection and firewalls).
  9. Managing User Accounts: Allowing different users to log in, setting permissions, and keeping their data separate.

Key Takeaway: The Operating System is the essential link between the user, the applications, and the physical hardware, ensuring efficiency and control.


3. The Software Hierarchy: Hardware, Firmware, and OS

To run an application (like your favourite game or spreadsheet), three different layers of software and hardware must work together in a specific sequence.

3.1 Understanding the Layers

  1. The Hardware: The physical components. This is where the power starts.
  2. The Firmware: This is low-level, permanent software stored on a chip (usually ROM or Flash Memory) on the computer's motherboard.
    • Its primary job is to run the Bootloader.
    • The Bootloader (firmware) is the first set of instructions executed when the computer is turned on. Its job is simply to check the basic hardware and then load the Operating System.
  3. The Operating System (OS): Once the firmware has done its job, the OS takes over and loads into RAM. The OS controls the overall environment.
  4. Application Software: Applications are run on the Operating System. They rely entirely on the OS to handle resources like the CPU, memory, and screen.

Did you know? The old BIOS (Basic Input/Output System) found in older computers is a classic example of firmware. Today, many systems use UEFI (Unified Extensible Firmware Interface), which performs the same initial loading job.

Summary Flow:

Power ON -> Hardware activates Firmware (Bootloader) -> Firmware loads OS -> OS starts running applications.


4. The Role and Operation of Interrupts

Imagine the CPU is busy running a complex calculation. Suddenly, the user presses a key on the keyboard, or a critical error occurs. How does the CPU stop what it's doing and deal with the urgent request?

It uses an Interrupt.

4.1 Defining an Interrupt

An Interrupt is a signal sent to the CPU that causes it to stop its current process and switch immediately to deal with the urgent event. It’s essentially a polite but firm request for the CPU’s immediate attention.

The Operating System is responsible for handling these interrupts.

4.2 How an Interrupt is Generated

Interrupts can come from two sources:

A. Hardware Interrupts:
  • These are triggered by peripheral devices.
  • Examples: Pressing a key on the keyboard, moving the mouse, a disk drive completing a data transfer, or a timer running out.
B. Software Interrupts:
  • These are triggered by errors or requests generated by running programs.
  • Examples: A program trying to perform division by zero (which is mathematically impossible), or two processes trying to access the same memory location simultaneously.

4.3 The Interrupt Handling Process (The ISR)

When an interrupt occurs, the CPU follows a specific, step-by-step procedure to manage it. This procedure often uses an Interrupt Service Routine (ISR)—a small program within the Operating System designed to deal with that specific type of interrupt.

Step-by-Step Operation:

  1. Interrupt Signal: A device (e.g., a keyboard) generates an interrupt signal and sends it to the CPU.
  2. Current Process Saved: The CPU finishes its current Fetch-Decode-Execute cycle. Before starting the new task, the CPU saves the exact state of the currently running program (including registers like the Program Counter) so it can return to the exact spot later.
  3. Priority Check: The CPU checks the priority of the incoming interrupt. A power failure signal has a higher priority than a mouse click. If the new interrupt has a higher priority than the task currently being handled, the CPU addresses the new one first.
  4. ISR Location: The CPU uses an interrupt vector table (managed by the OS) to find the starting memory address of the correct Interrupt Service Routine (ISR).
  5. Execution: The CPU executes the ISR (e.g., the ISR for a key press reads the character into memory).
  6. State Restoration: Once the ISR is complete, the CPU retrieves the saved state of the original program.
  7. Continuation: The CPU restores the saved registers and continues executing the original program as if nothing had happened.

Common Mistake to Avoid:

Students sometimes think the CPU stops immediately mid-instruction. No! The CPU always finishes the current FDE cycle before stopping, saving the state, and processing the interrupt.

Key Takeaway: Interrupts are how the OS and CPU ensure that urgent, time-sensitive events (like user input or errors) are dealt with promptly without losing track of the main tasks being performed.