4.1 Types of Software
| Type | Purpose | Examples |
|---|---|---|
| System software | Runs and manages the computer itself | Operating system, device drivers, utilities (anti-virus, backup, disk defragmenter), compilers and interpreters |
| Application software | Lets the user carry out a task | Word processor, spreadsheet, database, browser, photo editor, games |
4.2 The Operating System
The operating system (OS) is system software that manages the hardware and provides an interface between the user and the computer. Without it, applications could not run.
| Function | What it does |
|---|---|
| User interface | Provides a GUI (windows, icons, menus, pointer) or CLI so the user can interact with the computer |
| Memory management | Decides which programs get RAM, allocates and frees memory, and handles virtual memory |
| Multitasking / process management | Shares CPU time between processes so several programs appear to run at once |
| File management | Organises, names, saves, moves and deletes files and folders; sets access rights |
| Device driver management | Installs and communicates with drivers that let the OS control peripherals |
| Security | Handles user accounts, passwords, permissions and firewall settings |
| Interrupt handling | Deals with signals that need immediate attention |
| Platform for running software | Provides the services applications need, such as printing and saving |
Interrupts
An interrupt is a signal sent to the CPU by hardware or software to request attention. The CPU finishes the current instruction, saves its state, jumps to the interrupt handler, then returns to where it left off. Interrupts are given priorities so that urgent ones (e.g. a power failure or a hardware error) are dealt with first.
- Hardware interrupts: key pressed, mouse clicked, printer out of paper, disk read complete.
- Software interrupts: division by zero, a program requesting a service from the OS.
4.3 Languages and Translators
| Level | Description | Examples |
|---|---|---|
| High-level language | Uses English-like statements; one instruction may do a lot; portable between machines; must be translated | Python, Java, C#, Visual Basic |
| Low-level language | Machine-oriented; each instruction maps closely to one CPU operation; not portable | Assembly language (mnemonics), machine code (binary) |
Advantages of high-level languages: easier to read, write and debug; faster to develop; portable; the programmer does not need to know the hardware. Advantages of low-level languages: they give direct control of hardware, produce very efficient code, and are needed for device drivers and embedded systems.
| Translator | How it works | Notes |
|---|---|---|
| Compiler | Translates the whole program into machine code in one go, producing an executable file | Errors are reported at the end; the executable runs without the compiler; source code is not needed at run time |
| Interpreter | Translates and executes one statement at a time | Stops at the first error; slower to run; useful for testing and learning; source code must be present |
| Assembler | Translates assembly language mnemonics into machine code | Used for low-level programs |
4.4 IDEs
An integrated development environment (IDE) is software that provides all the tools a programmer needs in one place.
- Source code editor with syntax highlighting and auto-indent
- Debugger — breakpoints, single stepping, watch variables
- Translator — built-in compiler or interpreter
- Error diagnostics — line numbers and messages for syntax errors
- Auto-completion / auto-correct and code templates
- Run-time environment to execute and test the program
Exam trap
A compiler does not "find all errors before running" in the sense of fixing them — it reports syntax errors and produces no executable until they are fixed. Logic errors are only found by testing.
Five-minute drill
- State four functions of an operating system.
- Explain why an interrupt is given a priority.
- Give two advantages of a compiler over an interpreter.
- Give two advantages of a high-level language over assembly language.
- Name three features of an IDE that help a programmer.
Explain two ways the operating system manages memory when several programs are open at once.
- It allocates RAM to each program and keeps track of what is in use (1), freeing memory when a program closes (1).
- When RAM is full it uses virtual memory (1), swapping pages of data between RAM and secondary storage (1).
A student writes a program in Python. Describe how an interpreter and a compiler would each handle this program, and give one advantage of each.
- Interpreter: translates and runs the program one statement at a time (1); it stops as soon as an error is found (1). Advantage: easier to debug / good for learning (1).
- Compiler: translates the whole program into machine code and creates an executable (1); errors are listed at the end. Advantage: the compiled program runs faster and can be distributed without the source code (1).