AS Level Computer Science (9618) Study Notes: System Software

Welcome to the world of System Software! If hardware is the body of the computer, system software is the brain and nervous system that makes everything function. These are the crucial programs that manage the machine itself, allowing you (and your application programs) to actually use it.

In this chapter, we will break down the two main types of system software: the Operating System (OS) and the various Language Translators. Don't worry if some of the concepts seem abstract—we’ll use plenty of analogies to make sure they stick!


5.1 Operating Systems (OS)

What is an Operating System and why do we need one?

The Operating System (OS) is the most important piece of system software. It acts as the manager and interpreter between the user/applications and the physical hardware (CPU, memory, printer, disk drives).

Why is the OS essential?

  • It maximises the use of resources (making sure the CPU isn't idle).
  • It provides a User Interface (UI) (like a GUI or CLI) which hides the messy, complicated details of the hardware from the user. You don't need to write binary code to open a file!
  • It manages and controls all the tasks and hardware efficiently.

Key Management Tasks of the Operating System

The OS performs several critical management tasks simultaneously. Think of the OS as the CEO of a company, coordinating all departments.

Memory Aid: To remember the five main tasks, think: People Make Funny Shapes Helping. (Process, Memory, File, Security, Hardware)

1. Process Management (The Traffic Controller)

A process is a program currently running. When you run multiple applications (multi-tasking), the OS must manage them all fairly.

  • Scheduling: Deciding which process gets access to the CPU and for how long.
  • Process States: Processes cycle through states: Running (using the CPU), Ready (waiting for CPU time), and Blocked (waiting for an I/O operation, like a printer response).
Scheduling Routines

The OS uses different scheduling routines to allocate CPU time:

  • Round Robin: Each process gets a fixed time slice. Fair, but might be slow for critical tasks.
  • Shortest Job First (SJF): The shortest waiting job is executed next. Maximises throughput, but requires knowing the job length in advance.
  • First Come First Served (FCFS): Jobs are processed in the order they arrive. Simple, but can lead to a 'bottleneck' if a long job arrives first.
  • Shortest Remaining Time (SRT): A pre-emptive version of SJF. If a new, shorter job arrives while a longer job is running, the longer job is paused.
2. Memory Management (The Seating Plan)

The OS manages the computer's primary memory (RAM), ensuring that each running process has the space it needs and doesn't interfere with others.

  • Allocation: Assigning blocks of memory to programs.
  • Deallocation: Reclaiming memory when a program finishes.
Virtual Memory, Paging, and Segmentation

What happens when RAM runs out? The OS uses Virtual Memory.

  • Virtual Memory: A technique where the OS uses a section of the secondary storage (like the hard disk) as if it were RAM. This allows more programs to run than the physical RAM can hold.
  • Paging: Memory is split into fixed-size blocks called pages. These pages are moved between RAM and secondary storage as needed.
  • Segmentation: Memory is split into logical blocks (segments) of varying sizes, based on how the programmer structured the code (e.g., one segment for the main program, one for data).
  • Disk Thrashing: This is a drawback of using virtual memory. It occurs when pages are constantly being swapped between RAM and disk, causing the system to slow down severely because it spends more time swapping than processing.
3. File Management (The Librarian)

The OS controls how files and folders are stored, named, accessed, and secured on secondary storage (like the HDD or SSD).

  • It maintains the file directory structure.
  • It handles read/write access and permissions.
4. Hardware Management (The Translator)

Also known as Input/Output (I/O) management. The OS coordinates all hardware devices (printers, keyboards, screens).

  • It uses device drivers—special software components that allow the OS to communicate with specific hardware.
  • It manages buffers (temporary storage areas) to handle speed differences between devices (e.g., printing data gradually without blocking the CPU).
5. Security Management (The Guard)

The OS protects system resources and data from unauthorised access.

  • It uses user accounts and passwords.
  • It manages access rights (e.g., read-only, read/write, execute).
Quick Review: OS Management Tasks

The OS manages Processes, Memory, Files, Security, and Hardware/I/O. The goal is maximum efficiency and hiding hardware complexity.

Utility Software

Utility Software consists of system programs designed to help maintain, tune, and protect the computer system.

Common utility software provided with an OS:

  1. Disk Formatter: Prepares a disk (hard drive, USB) for data storage by creating the necessary file structure and addressing system.
  2. Virus Checker (Antivirus): Scans for, detects, and removes malicious software.
  3. Defragmentation Software: Physically rearranges file fragments on a hard disk so that data is stored contiguously (together). This speeds up access time. (Note: Less crucial for SSDs.)
  4. Disk Contents Analysis/Repair: Checks the physical structure of the disk for errors (bad sectors) and attempts to recover lost data.
  5. File Compression: Reduces the file size, saving storage space and reducing transmission time (e.g., ZIP files).
  6. Back-up Software: Creates copies of files or the entire system onto secondary storage for disaster recovery.

Program Libraries (The Reusable Code)

A program library is a collection of pre-written, tested code routines (like functions or procedures) that developers can include in their own programs.

  • Benefit to the Developer: They save time, effort, and debugging, as they don't have to write common functions (like sorting a list or calculating a logarithm) from scratch.
  • Dynamic Link Library (DLL) files: These are common library files (especially in Windows) that contain routines used by many programs. They are loaded into memory only when the program needs them, rather than being permanently compiled into the executable file.

Did you know? Using DLLs saves disk space and RAM, and allows programs to be updated easily just by replacing the DLL file, rather than reinstalling the entire program.


5.2 Language Translators

When humans write code, we use High-Level Languages (HLLs) like Python or Java, which are easy for us to read. However, the CPU can only execute instructions in Machine Code (binary).

Language Translators are system software tools necessary to bridge this gap, converting human-readable code into machine-executable code.

Types of Translators

1. Assembler (For Low-Level Code)
  • Purpose: Translates Assembly Language programs into machine code.
  • Characteristics: Assembly language is very close to machine code (it uses mnemonics like ADD and MOV). The translation process is usually a simple 1-to-1 instruction mapping.
2. Compiler (The Book Translator)
  • Purpose: Translates an entire High-Level Language source code file into a single, stand-alone executable file (machine code) before the program is run.
  • Process Stages:
    1. Lexical Analysis: Breaking the source code into tokens (recognisable units like keywords and identifiers).
    2. Syntax Analysis: Checking if the tokens follow the grammatical rules (syntax) of the language. (If errors are found here, compilation stops).
    3. Code Generation: Producing object code (machine code).
    4. Optimisation: Attempting to make the generated code more efficient (faster or smaller).

Benefits of Compilers:

  • Program executes very quickly once compiled.
  • The original source code is not needed to run the program (protects intellectual property/source code security).
  • Errors are identified upfront before the program runs.

Drawbacks of Compilers:

  • Compilation process can be slow.
  • Debugging is harder, as errors relate to the original source code, not the executable.
3. Interpreter (The Simultaneous Translator)
  • Purpose: Translates and executes a High-Level Language program instruction-by-instruction, line-by-line, while the program is running.
  • Characteristics: No separate executable file is created; the source code must be present every time the program runs.

Benefits of Interpreters:

  • Excellent for debugging, as execution stops immediately when an error is found, and the error line is clearly identified.
  • Code is highly portable—the same source code can run on any platform that has the necessary interpreter.

Drawbacks of Interpreters:

  • Execution is much slower because each line is translated every time it runs (especially inside a loop).
  • Source code must be provided (less secure).

Comparison Justification (Compiler vs. Interpreter)

  • Use a Compiler if: Speed is critical (e.g., operating systems, commercial games) and source code security is important.
  • Use an Interpreter if: The program is for testing, learning, or portability is essential (e.g., web scripting, educational environments).

Partial Translation (Hybrid Approach): Some languages, like Java (console mode), are neither purely compiled nor purely interpreted. They are first compiled into an intermediate form (called bytecode), which is then interpreted by a Virtual Machine (e.g., the Java Virtual Machine) during execution. This offers a balance of portability and speed.

Common Mistake Alert!

Remember the Compiler translates the whole program once, creating a permanent executable file. The Interpreter translates one line at a time, every time the program runs.

Integrated Development Environment (IDE)

An IDE is a single application that provides comprehensive facilities to computer programmers for software development. It bundles essential tools into one interface, acting like a professional workshop.

Key features found in a typical IDE:

1. Coding Features
  • Context-sensitive prompts: Automatically suggests keywords or variable names as the developer types, speeding up coding and reducing typos.
2. Initial Error Detection (Syntax)
  • Dynamic syntax checks: Checks the code's grammatical rules as the developer types, highlighting errors (like missing semicolons or incorrect structure) immediately.
3. Presentation Features
  • Prettyprint: Automatically formats the code (indentation, spacing, colour coding) to make it easier to read.
  • Expand and collapse code blocks: Allows developers to hide sections of code (like a procedure body) to focus on the overall structure.
4. Debugging Features

These tools help developers find and fix errors (bugs):

  • Single stepping: Allows the developer to execute the program one line at a time to carefully watch the flow of logic.
  • Breakpoints: Points set in the code where execution will pause, allowing the developer to examine the program's state at a specific point.
  • Variables and Expressions Report Window: A panel that shows the current values held in variables or the result of expressions at the breakpoint, helping to trace logic errors.

Chapter Summary: System Software

System Software is the foundational layer of any computer. The Operating System manages all resources (P, M, F, S, H) and provides necessary utility software for maintenance. Language Translators (Assembler, Compiler, Interpreter) ensure that the human-written code can be converted into machine code. Finally, the IDE provides developers with a powerful environment to write and debug code efficiently.