Syllabus coverage
- Describe the difference between system software and application software and provide examples of each
- Describe the role and basic functions of an operating system
- Understand how hardware, firmware and an operating system are required to run applications software
- Describe the role and operation of interrupts, including how an interrupt is generated, how it is handled using an interrupt service routine, and what happens as a result
- Explain what is meant by a high-level language and a low-level language, including the advantages and disadvantages of each, such as ease of reading and writing, ease of debugging, machine independence and direct manipulation of the hardware
- Understand that assembly language is a form of low-level language that uses mnemonics, and that an assembler is needed to translate an assembly language program into machine code
- Describe the operation of a compiler and an interpreter, including how high-level language is translated by each and how errors are reported
- Explain the advantages and disadvantages of a compiler and an interpreter, including that an interpreter is mostly used when developing a program and a compiler is used to translate the final program
- Explain the role of an IDE in writing program code and the common functions IDEs provide, including code editors, run-time environment, translators, error diagnostics, auto-completion and auto-correction
Part of the IGCSE Computer Science syllabus 0478.
System software and application software
Software falls into two groups, and the test that separates them is who the software is for. System software provides the services that the computer requires: it manages the hardware and keeps the machine running. Application software provides the services that the user requires: it does the job the person at the keyboard actually wants done.
System software is more than just the operating system. It also includes utility software, a set of small programs that maintain, protect or configure the computer. A utility program carries out one housekeeping job, such as backing up files, compressing files, checking a disk for faults or scanning for malware. Utilities count as system software because they keep the machine healthy rather than doing a task for the user.
Both kinds of software run at the same time. When you type in a word processor, the word processor is application software and the operating system underneath it is system software, deciding how much processor time and memory the word processor is given. Application software cannot run on its own: without system software there would be nothing to load it, no memory to load it into and no way to save the file it produces.
| Type of software | What it is for | Examples |
|---|---|---|
| System software: operating system | Provides the services the computer requires, managing the hardware, memory, files, peripherals and users | Windows, macOS, Linux, Android, iOS |
| System software: utility software | Small maintenance programs that keep the computer working, secure and tidy | Backup software, file compression, disk checking, anti-malware |
| Application software | Provides the services the user requires, doing the task the user wants done | Word processor, spreadsheet, web browser, photo editor, video game |
The operating system: role and basic functions
The operating system (OS) is the system software that sits between the user, the application software and the hardware. Its role is to manage the resources of the computer and to provide the services that everything else needs. It is the first major piece of software to load when the computer is switched on, and it stays in charge until the computer is switched off.
Managing memory means the operating system keeps track of which parts of RAM are free, allocates memory to each program that needs it, and frees that memory again when the program closes. Managing multitasking means it shares the processor between several programs that appear to run at once, switching between them so quickly that each one looks continuous. Providing an interface means it gives the user a way to work with the machine, either a graphical user interface with windows, icons and menus, or a command-line interface where instructions are typed.
Managing files means organising files into folders or directories and handling creating, naming, saving, copying, moving and deleting them. Managing peripherals and drivers means controlling the input, output and storage devices attached to the computer, using a driver for each one: a driver is the small piece of software that translates general instructions into the signals that particular device understands. Providing a platform for running applications means supplying the services that application software needs, such as memory, file access and access to devices, so that a program does not have to deal with the details of the hardware itself.
Providing system security means controlling what programs and users are allowed to do, using passwords and permissions to stop unauthorised access to the system and its files. Managing user accounts means keeping a separate account for each user, with its own settings and its own access rights, and handling logging in and logging out. Handling interrupts is the last function on the list and it has a block of its own below.
| Function | What it means in practice |
|---|---|
| Managing memory | Keeps track of which parts of RAM are free, allocates memory to a program when it starts and frees it when the program closes |
| Managing multitasking | Shares processor time between several programs so that they appear to run at the same time |
| Providing an interface | Gives the user a way to control the computer, either a graphical user interface or a command-line interface |
| Managing files | Organises files into folders and handles creating, naming, saving, copying, moving and deleting them |
| Managing peripherals and drivers | Controls the attached devices and uses the correct driver to translate instructions into signals each device understands |
| Providing a platform for running applications | Gives application software the services it needs, such as memory and file access, so it does not need to know the details of the hardware |
| Providing system security | Uses passwords and permissions to control what programs and users are allowed to do |
| Managing user accounts | Keeps a separate account with its own settings and access rights for each user, and handles logging in and out |
| Handling interrupts | Responds immediately when a device or a program signals that it needs attention |
Hardware, firmware, operating system and application software
A computer runs in layers, and you need to know what sits on what. Hardware is the physical equipment. Firmware is software that is stored permanently in the hardware itself, usually in ROM, so that it is available the instant the computer is switched on and is not lost when the power goes off. Application software is the program the user is trying to run.
The layers build upwards. The bootloader is firmware: it runs on the hardware, and its job is to find and start the operating system. The operating system then runs on the firmware, using the basic instructions the firmware provides to communicate with the hardware. Application software runs on the operating system, using the services the operating system provides. The chain is hardware -> firmware -> operating system -> application software, and each layer depends on the one below it.
This is why a program cannot run by itself. Application software needs an operating system to load it, give it memory and give it access to files and devices; the operating system needs firmware to start it and to handle the lowest-level details of the hardware; and the firmware needs the hardware to exist at all. Break any layer and everything above it stops working.
- The bootloader is firmware, and firmware runs on the hardware.
- The operating system runs on the firmware.
- Application software runs on the operating system.
- Each layer depends on the layer below it, so a broken layer stops everything above it.
Interrupts and interrupt service routines
An interrupt is a signal sent to the processor telling it to stop what it is doing and deal with something else straight away. Interrupts exist because the processor cannot know in advance when a key will be pressed or when a printer will run out of paper, and it cannot sit waiting for these events either, because that would waste almost all of its time. Instead the processor gets on with its work, and the outside world interrupts it when there is something to say.
Interrupts are generated in two ways. A hardware interrupt comes from a device: pressing a key on the keyboard, moving the mouse, or a printer signalling that it has finished a job. A software interrupt comes from a program while it is running: a program trying to divide by zero, or two processes trying to access the same memory location at the same time.
When an interrupt arrives, the processor finishes the instruction it is currently executing, then saves the contents of its registers and the address of the next instruction so that it can come back later. It looks up the address of the interrupt service routine (ISR) for that interrupt and jumps to it. The ISR is a short program written to deal with that particular interrupt: it reads the key that was pressed, or handles the division by zero error, or services the printer. When the ISR has finished, the processor restores the saved registers and the address of the next instruction and carries on from exactly where it left off, as though nothing had happened.
Interrupts also have priorities, because two of them can arrive at the same time. A high-priority interrupt, such as a hardware failure warning, is dealt with before a low-priority one such as a key press. If a higher-priority interrupt arrives while a lower-priority ISR is running, the processor can interrupt the ISR, deal with the more urgent signal, and then return to finish the ISR. Interrupts waiting to be handled are held in a queue.
As a result of an interrupt something happens that would not have happened otherwise: a character appears on the screen, an error is reported to the user instead of the program failing silently, or the processor starts the next task. The point of interrupts is that the processor can respond immediately to an event without continuously checking every device to see whether it needs attention.
- An interrupt is a signal to the processor that something needs attention now.
- Hardware interrupts come from devices: a key press, a mouse movement, a printer finishing.
- Software interrupts come from a running program: division by zero, or two processes trying to use the same memory location.
- The processor saves its registers and the address of the next instruction, runs the interrupt service routine, then returns to where it left off.
- Interrupts have priorities, and interrupts waiting to be handled are held in a queue.
High-level and low-level languages, including assembly language
A high-level language is written in a form close to English, using meaningful names and structures such as loops, conditions and procedures. A low-level language is written in a form close to the hardware, using the processor's own instructions and memory addresses.
High-level languages are easier to read and write, because the code reflects the problem being solved rather than the design of the processor. They are easier to debug, because the code is easier to follow and the translator can report an error together with the line it is on. They are also machine independent: the same program can be translated to run on different types of processor, because the high-level code does not refer to any particular processor's instructions. The cost is that the programmer loses direct manipulation of the hardware, so high-level code cannot be written to use a specific processor feature, and it may not make the most efficient use of memory or processing time.
Low-level languages are the mirror image. Because the programmer works directly with the processor's own instructions, registers and memory addresses, code can be written to run very fast or to fit into a very small amount of memory, which is why low-level languages are still used for device drivers and for the parts of an operating system where speed and control matter. The cost is that low-level code is hard to read and write, hard to debug because mistakes are easy to make and difficult to trace, and machine dependent: a program written for one type of processor will not run on another.
The processor itself executes only machine code, which is binary instructions made up of an opcode saying what to do and an operand saying what to do it to. Writing in binary is slow and full of errors, so assembly language was created: a low-level language that uses mnemonics, short letter codes such as LDA for load, ADD for add and STO for store, in place of the binary opcodes, and names in place of memory addresses. Assembly language is still a low-level language because each mnemonic corresponds to exactly one machine code instruction and the programmer still has to think about registers and addresses.
Because the processor does not understand mnemonics, an assembler is needed to translate an assembly language program into machine code. The assembler replaces each mnemonic with its binary opcode and each named address with the actual address, producing a machine code program the processor can execute. The translation is close to one assembly language instruction for one machine code instruction.
| High-level language | Low-level language | |
|---|---|---|
| Reading and writing code | Easy: close to English, uses meaningful names | Hard: close to the hardware, uses mnemonics or binary |
| Debugging | Easier: code is readable and errors can be reported with a line number | Harder: mistakes are easy to make and difficult to trace |
| Machine independence | Machine independent: can be translated to run on different processors | Machine dependent: written for one type of processor |
| Direct manipulation of the hardware | Not possible: the programmer cannot use specific processor instructions | Possible: the programmer works directly with the processor's instructions, registers and addresses |
| Where you meet it | Applications, websites, most software written today | Device drivers, operating system routines, embedded systems where speed or size matters |
Compilers and interpreters
A compiler translates the whole program at once, before any of it is executed, and produces an executable file. The programmer runs the compiler, gets the executable, and can then run that executable as many times as they like without the compiler being involved again. If the compiler finds errors it produces an error report for the whole program, listing the errors it has found with the line each one is on, and no executable file is produced until those errors are fixed.
An interpreter translates and executes the code line by line. No separate executable file is produced: the interpreter reads a line, translates it, runs it, then moves on to the next line. If it finds an error it stops execution at that point and reports the error, which means the lines before it have already run and any errors further down the program have not been found yet.
The advantages of a compiler follow from translating everything in advance. Errors are reported for the whole program at once, so the programmer can fix several at the same time. Because the program has already been translated into machine code by the time it runs, execution is fast, and the finished executable can be given to users who do not have the compiler or the source code installed. The disadvantages are that the compiler must be run again every time the code is changed, which slows development down, that translating a large program can take a long time, and that the executable file is machine dependent, so a different version is needed for a different type of processor.
An interpreter's advantages are the mirror image. It is useful while a program is being developed, because the programmer can run part of the program and see the result immediately without waiting for the whole program to be translated, and an error stops the program at the line that caused it, which makes that error easier to locate. It is also useful for teaching and for testing a few lines quickly. Its disadvantages are that the same line is translated again every time it is executed, so the program runs more slowly, and that the interpreter must be installed on the computer for the program to run at all.
In practice both are used. An interpreter is mostly used when developing a program, because it gives feedback line by line while the code is being written; a compiler is used to translate the final program, because the finished version should run as fast as possible and be ready to hand to users.
| Compiler | Interpreter | |
|---|---|---|
| How it translates | Translates the whole program at once, before it is executed | Translates and executes the code line by line |
| Executable file | Produces an executable file that can be run on its own | Produces no executable file; the interpreter must be present to run the program |
| How errors are reported | Gives an error report for the whole program, listing the errors found | Stops execution when an error is found and reports that error |
| Speed when the program runs | Fast, because the translation is already done | Slower, because each line is translated every time it is executed |
| Speed of development | Slower, because the whole program must be recompiled after every change | Faster, because part of the program can be run immediately |
| Typical use | Translating the final program | Developing and testing a program |
Integrated development environments (IDEs)
An integrated development environment (IDE) is a single piece of application software that provides everything a programmer needs to write, test and translate a program. Its role is to bring the separate tools of program development together in one place, so the programmer does not have to keep switching between a text editor, a translator and a testing tool.
The code editor is where the code is typed. It is more than a plain text editor: it numbers the lines, colours the different parts of the code so that keywords and strings stand out, and indents automatically. Error diagnostics means the IDE reports errors as the programmer works, marking the line where a problem is and explaining what the translator objected to, which turns debugging from guesswork into reading a message.
Auto-completion means the IDE suggests how a word or line might finish as it is typed, and offers a list of the available options, so the programmer types less and makes fewer typing mistakes. Auto-correction means the IDE corrects or completes obvious mistakes, such as closing a bracket that was left open or fixing the spelling of a keyword. The run-time environment means the IDE can run the program and show the output, and often step through it line by line to watch the values in variables change. The translators built into the IDE, which may include a compiler, an interpreter and an assembler, mean the program can be translated without leaving the IDE.
| Function of an IDE | What it gives the programmer |
|---|---|
| Code editor | A place to type the code, with line numbers, colour-coded keywords and automatic indentation |
| Run-time environment | The ability to run the program and see its output without leaving the IDE, and often to step through it line by line |
| Translators | A compiler, interpreter or assembler built in, so the program can be translated from inside the IDE |
| Error diagnostics | Reports of errors as the programmer works, showing the line the error is on and what is wrong |
| Auto-completion | Suggestions that finish a word or line as it is typed, and lists of available options |
| Auto-correction | Automatic correction of obvious mistakes, such as a missing closing bracket or a misspelled keyword |
Key terms you must be able to define
- System software
- Software that provides the services the computer requires, including the operating system and utility software.
- Application software
- Software that provides the services the user requires, such as a word processor, a spreadsheet or a web browser.
- Utility software
- Small system programs that maintain, protect or configure the computer, for example backup, file compression, disk checking and anti-malware software.
- Operating system
- The system software that manages the resources of the computer and provides the services that application software needs, including managing memory, files, peripherals and drivers, multitasking, user accounts, security, the interface and interrupts.
- Firmware
- Software stored permanently in the hardware itself, usually in ROM, so that it is available as soon as the computer is switched on.
- Bootloader
- The firmware that runs on the hardware when the computer is switched on and starts the operating system.
- Driver
- The small piece of software that translates general instructions from the operating system into the signals a particular peripheral device understands.
- Interrupt
- A signal sent to the processor telling it to stop what it is doing and deal with something else immediately.
- Interrupt service routine (ISR)
- The short program that is run when a particular interrupt occurs, written to deal with that interrupt; the processor saves its registers and returns to the interrupted instruction once the ISR has finished.
- Hardware interrupt
- An interrupt generated by a device, for example pressing a key on the keyboard or moving the mouse.
- Software interrupt
- An interrupt generated by a program while it is running, for example division by zero or two processes trying to access the same memory location.
- High-level language
- A programming language written in a form close to English that is easy to read and debug and is machine independent, but gives the programmer no direct manipulation of the hardware.
- Low-level language
- A programming language written in a form close to the hardware that allows direct manipulation of the hardware and can be fast and compact, but is hard to read and debug and is machine dependent.
- Machine code
- The binary instructions that the processor executes, each made up of an opcode and an operand. It is the only language the hardware understands.
- Assembly language
- A low-level language that uses mnemonics in place of binary opcodes and names in place of memory addresses, with one mnemonic for each machine code instruction.
- Mnemonic
- A short letter code used in assembly language in place of a binary opcode, such as LDA for load, ADD for add and STO for store.
- Assembler
- The translator that converts an assembly language program into machine code.
- Compiler
- A translator that translates the whole high-level program at once before it is executed, producing an executable file and giving an error report for the whole program if errors are found.
- Interpreter
- A translator that translates and executes a high-level program line by line, stopping and reporting an error when one is found.
- Executable file
- The machine code file produced by a compiler, which can be run on its own without the compiler or the original source code.
- Integrated development environment (IDE)
- A single piece of software that provides the tools needed to write, test and translate a program, including a code editor, a run-time environment, translators, error diagnostics, auto-completion and auto-correction.
Applied to real systems
Cambridge sets 0478 in systems you already use - a phone, a school network, a supermarket till, a website, a bank. Use these as models for how to apply the theory to a context you have not seen before, then write your own.
The operating system is system software and the web browser the student opens is application software, but both are needed at once: the browser cannot request a page without the operating system giving it memory and access to the network. The utility software on the laptop matters just as much, because it is what backs up the coursework folder and checks the disk for faults.
Every key you press generates a hardware interrupt. The processor finishes the instruction it is on, saves its registers and the address of the next instruction, jumps to the interrupt service routine for the keyboard, puts the character into the program's input, and then returns to exactly where it was. If it did not do this, the processor would have to keep checking the keyboard many thousands of times a second, and it would have almost no time left to run the word processor.
The engine management system is firmware running on the engine control unit. Sensors report the temperature of the coolant, and the program compares the reading with the value stored for normal running. If the reading is too high, the system acts: it switches on the cooling fan and displays a warning. The firmware must be in ROM so that it is available the instant the ignition is turned on, before anything has been loaded from storage.
A programmer writes the code in an IDE, using auto-completion to type less and error diagnostics to spot mistakes as she goes. While she is developing, she runs the program with an interpreter so she can see each line work and find the line that fails. When the program is finished, she compiles it, because the compiler produces a fast executable file that can be sold or sent to users who have no programming software installed at all.
The finished game is compiled, because a compiled executable runs far faster than a program being translated line by line, and speed is the whole point of a game. During play, interrupts keep the game responsive: every button press and every movement of the controller generates a hardware interrupt, and the interrupt service routine records the input so that the game reacts in the next frame.
The office runs an operating system with a separate user account for each member of staff, so that the accounts files can be opened only by the people allowed to see them. Files are organised into folders by year, utilities back up the accounts every evening, and the printer works because the operating system has the correct driver installed for it.
Flashcards
Click a card to flip it. Mark honestly — the tracker uses this.
Exam-style questions
8 questions, 26 marks. Write your answer, then reveal the mark scheme and tick each point you actually made. Answering honestly here is what makes the rest of the site useful.
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Exam technique for this topic
- Learn the nine operating system functions as a list, and be ready to say what each one does. The question almost always asks you to describe functions rather than just name them, and a list of names alone earns nothing.
- For an interrupt question, write the sequence in order: the interrupt is generated, the processor finishes the current instruction, the registers and the address of the next instruction are saved, the interrupt service routine is run, and the processor returns to where it left off. Missing the return costs the last mark.
- For compiler versus interpreter, the two phrases that earn marks are 'translates the whole program at once before executing it' and 'translates and executes line by line'. Add what happens when an error is found, because that is a separate mark.
- When a question asks for examples of software, say which type each example is. 'A word processor is application software' scores; 'a word processor' on its own does not answer the question that was asked.
- Keep the levels of the machine apart in your answers: applications run on the operating system, the operating system runs on the firmware, and the firmware (the bootloader) runs on the hardware.