System Software
1. What is an Operating System (OS)?
Definition: An operating system is a software platform that provides facilities for programs to be run which are of benefit to a user.
Hardware on its own is no use — a mouse lying on your desk does nothing unless an OS gives an interface that makes it usable, and gives all your software a platform to be hosted on.
Q: Why should an operating system be used?
- Hardware is unusable without an operating system
- Acts as an interface and controls communication between user and hardware
- Provides a software platform (programs run on top of the OS)
2. User Interface — CLI vs GUI
Interface = a method of communication. (Sir ↔ students = Zoom; sir ↔ YouTube viewers = YouTube.) Between a user and the hardware the OS provides the interface — and there are two types:
Command Line Interface (CLI)
- User types in instructions to open or launch a program
- User is in direct communication with the computer system
- Usually a number of instructions are needed to be typed in to open / launch a program
Graphical User Interface (GUI)
- User interacts with the computer system by using icons
- User does not need to know where the application resides within the computer
- User launches the application by the use of a pointer
- Windows is the example of a GUI
3. Key Management Tasks of the OS
① Memory Management
- Allocates memory to processes
- Ensures fair usage of memory
- Organises memory by making use of virtual memory
- Keeps processes separate
- Releases memory when a process stops
Allocate + fair usage: every process needs RAM — e.g. a game ≈ 5 GB, OneNote ≈ 2 GB. The OS decides how much each process gets, so one process can't take all the RAM while the others sit idle. A process must be in RAM before the CPU can execute it.
Separate + release: each process keeps to its own area of RAM; as soon as a process finishes, its memory is released so another process can use that space.
② Process Management
- Manages scheduling of processes
- Allows multitasking
- Handles priorities
- Enables processes to share information
- Prevents interference between the processes
- Manages which resources the process requires
Multitasking: the CPU can run only one instruction at a time. To look like it does two jobs, the OS gives each process a tiny slice of CPU time (a few ms — "burst time") and keeps switching P1 → P2 → P1 → P2… Deciding who gets the CPU, and for how long, is scheduling (round robin / first-come-first-served are A2 topics).
Priorities: an interrupt is also a process — if its priority is higher it is served first. Share information / no interference: processes can pass data to each other, but one must not disturb another.
Resources: a process in the blocked state is waiting (e.g. for an input/output request) until that request arrives. A resource can't be given to two processes at once — e.g. Snapchat is using the phone camera, so turning the camera on in a Zoom class gives an error: the OS decides which process gets which resource.
③ Provision of User Interface
- Allows a user to communicate with hardware by making navigation around the system easier
- Provides facilities for the user to input data
- Provides facilities to show output results to the user
- e.g. CLI and GUI
Input = what you type / click (sir typing); output = what you see (a lecture on screen). Say it in your own words: icons and menus make talking to the hardware and moving around the system easy.
④ Security Management Task
- Sets up user accounts
- Sets / maintains access rights
- Checks usernames and passwords
- Automatic back-up
- System restore
Back-up: can be automatic so your data is always saved; you choose what is / isn't backed up. System restore: go back to an earlier version of the system — e.g. Windows 11 runs slowly on hardware that isn't compatible, so restore the previous Windows version.
⑤ File Management
- Storage space is divided into file allocation units
- Space is allocated for particular files
- Maintains the directory structure
- Specifies the logical method of file storage
- Provides a file naming convention
- Controls file access
- Specific tasks that can be performed on a file — e.g. open, delete, copy
Directory structure: My Computer → drives (C:, D:, CD…) → folders → folders → files. Without an OS it would be practically impossible to maintain. Naming convention: you can easily name / rename a file (e.g. when converting to PDF you give it a name). Access control: decide who may use which file — e.g. finance-department files are not accessible to engineering employees. Tasks: open, delete, copy are done through the OS.
⑥ Printer Management
- Installs printer driver
- Sends data to the printer
- Handles error messages
- Sends commands to the printer
Driver = software that lets the OS talk to that printer (old printers came with a CD to install it). Error e.g. "printer out of paper". Commands e.g. print 2 copies, both sides, which colours.
⑦ Interrupt Handling
- Identifies priorities of the interrupts
- Saves data on a power outage
- Loads the appropriate interrupt service routine (ISR)
⑧ Input Output Management
- Installation of appropriate drivers
- Controls access to the data being sent
- Controls access to the hardware
- Manages communication between devices
| # | Task | Key words to remember |
|---|---|---|
| 1 | Memory | allocate · fair use · virtual memory · keep separate · release |
| 2 | Process | scheduling · multitasking · priorities · share info · no interference · resources |
| 3 | User interface | easier navigation · input · output (CLI / GUI) |
| 4 | Security | user accounts · access rights · username/password · auto back-up · system restore |
| 5 | File | allocation units · directory structure · logical storage · naming · access · open/delete/copy |
| 6 | Printer | install driver · send data · handle errors · send commands |
| 7 | Interrupt | priorities · save data on power cut · load ISR |
| 8 | Input / output | drivers · control data access · control hardware access · device communication |
4. Utility Software
Definition: Utility software analyses and maintains a computer system and makes it functional. There are 6 you must know. (Most come pre-installed when Windows is installed.)
① Hard-disk Formatter
- Makes existing data inaccessible
- Partitions the disk into logical drives (C: drive, D: drive)
- Prepares the disk for initial use
- Might search for errors
- Sets up the specified file system
"Inaccessible" ≠ erased. Formatting does not wipe the data: it removes the address of the data. Like a house whose address you've forgotten — the house still exists, you just can't find it. The data stays on the disk until new data is overwritten on that address.
Logical drives: the physical drive is the hardware (platters, spindle, arm). A platter has concentric (circular) tracks divided into sectors; splitting the platter into sections = partitioning into logical drives (C:, D:). Knowing the sector tells you where a file is.
Use it when: a new disk must be prepared · the disk has errors · the disk is slow or has a virus / malicious code · you want to remove everything instead of deleting files one by one. File system = how files will be organised on the disk.
② Hard-disk Defragmenter
- Re-organises the disk content
- Moves split files so they are contiguous
- Creates a large area of contiguous free space
Why it's needed: a new disk is fast. As files are saved and deleted, free space and file pieces end up scattered over the disk (fragmented). The read arm has to hop from sector to sector to collect one file, so loading gets slow even though nothing is broken. After defragmenting, the arm reads one track after another with no pause — faster. You can make either the used space or the free space contiguous.
③ Disk Content Analysis / Disk Repair
- Checks for any error
- Resolves any errors on the disk
- Retrieves files from a damaged disk
- Marks bad sectors of the disk
Bad sector: over time some part of the disk can no longer hold data (scratches, damage…). The utility marks it as a bad sector so no data is ever stored there. It both analyses and repairs.
④ Virus Checker
- Scans files on a computer for malicious code
- Scans files when they enter the system — e.g. when a memory stick is inserted
- Sets up a schedule for virus checking
- Deletes the virus
- Regularly updates virus definitions
It scans data coming in and going out. A schedule lets you e.g. check at 2 a.m. New viruses keep appearing, so the list of what counts as a virus (the virus definition) must be updated regularly — otherwise new viruses are missed.
⑤ Backup Software
- Creates a copy of the content of the disk
- Can be set up to automatically back up
- Allows the user to decide what is backed up
- Allows off-site backup
- May encrypt backed-up files
- Restores the data if necessary
Why: if the disk is lost to fire, an environmental hazard, a virus or a system fault, a copy of the content still exists. User chooses e.g. "only PDF files" or "only images".
⑥ File Compression Utility
- Compresses and decompresses files
- Infrequently used files are compressed
- Saves space in the hard disk
Makes files smaller (compression techniques such as run-length encoding are studied elsewhere in the course); decompress when you need the file again.
| Utility | One-line job |
|---|---|
| Formatter | hides old data, makes logical drives, prepares disk & file system |
| Defragmenter | moves split files together → large contiguous free space (faster) |
| Disk repair | checks / fixes errors, recovers files, marks bad sectors |
| Virus checker | scans (incl. new devices), schedules, deletes, updates definitions |
| Backup | copy of disk — automatic, user-chosen, off-site, encrypted, restorable |
| Compression | shrinks rarely-used files to save disk space |
5. Program Libraries
Analogy: you can buy a book (your own copy) or go to a library, borrow what you need, return it, and the next person uses the same book. In programming, someone has already written and compiled functions (mean, median, mode, normal distribution…) and stored them in a library (e.g. Python's pandas, BeautifulSoup for scraping data from websites). You just import it and call the function.
Sum ← x + y + z
Mean1 ← Sum / 3
RETURN Mean1
ENDFUNCTION
result ← Mean(x, y, z)
result ← mean(x, y, z)
(already compiled — nothing else to write)
You don't load the whole library into your program — it is stored elsewhere and only the function you call comes into RAM and runs. Everyone's mean code would be identical, so reuse one pre-compiled copy. Focus on the word "common" in the definition. Each language has its own libraries (a Python library can't simply be used in JavaScript); a language's own built-ins such as input() are part of the language itself.
Benefits of library routines
- Less code needs to be written, so saves time
- Pre-tested, so reduces testing time
- Can be written in different programming languages, which lets you use the special features of that language
- Can be complex algorithms — no need to work out how to write them
- Simplifies the program, since just the name of the function is included
Complex work (data scraping, file handling, hard algorithms) is already solved for you — like buying a ready-made part instead of designing it yourself; you only need to know how to use it.
Drawbacks of library routines
- Compatibility issues — may not work with other code
- Not guaranteed thorough testing — may contain unknown, unexpected bugs
- The code may not meet exact needs — may give unexpected results
6. Dynamic Link Library (DLL)
You've seen .dll files in the Windows folders, and sometimes the error "DLL file not found". A DLL works like a library routine, but the code sits in a separate shared file that many programs use.
Q: Describe a dynamic link library (DLL)
- A collection of self-contained shared library programs (self-contained = independent, depends on nothing)
- That are already compiled
- Linked to the main program during execution
- Library program code is separated from the .exe file
- Library file is only loaded into memory when required at run-time
- A DLL file can be made available to several applications at the same time
- If a change is made in the DLL code, all the programs that use the DLL will get changed
Example: Word, Epic Games and Google all show pop-up notifications and the ✕ / minimise buttons — that common code lives once in a DLL. Epic Games launches Fortnite, PUBG, Rocket League… the code common to all of them is put in one DLL. There can be many DLL files (Windows has its own).
At run-time: while the program is closed, the DLL sits in secondary memory; when you click the .exe, the DLL is picked up into RAM and linked to the main program. The .exe files (Word, Epic Games, Google icons) are the programs you click to execute.
Benefits of a DLL
- The executable file is smaller
- DLL file only loaded into memory when required at run-time
- Changes to DLL code are done independently of the main program → no need to recompile the main program
- A single DLL can be made available to several applications, saving space in memory
Without DLLs the same common code would be copied into every .exe (repetition → more memory used). With a DLL it is stored once. Editing the DLL doesn't mean Word must be recompiled.
Drawbacks of a DLL
- The executable code is not self-contained — it depends on the DLL
- The DLL file needs to be included at run-time
- Appropriate linking software must be available at run-time to import the DLL file
- The DLL file should be present or else error — "DLL file not found" pop-up
- Unexpected changes to the DLL could mean the program stops working as expected
- Malicious changes to the DLL file could install a virus on the user's computer
If a DLL is deleted by mistake, every program that used it throws an error. If you change a DLL to suit one program, other programs using it may suddenly misbehave. Microsoft keeps its own Windows DLLs (UI, icons) locked — nobody can change them without Microsoft's access.
7. Language Translators
Three types: Assembler · Compiler · Interpreter. The processor understands only binary (machine code = object code, e.g. 0110…), so every program must be translated into it.
Assembler
Definition: Programs written in assembly language are translated into machine code by an assembler program. Each instruction in the source code consists of an opcode and an operand. The software translates low-level language into machine code for the processor to execute. The source code uses instructions from the processor's instruction set.
Instruction-set examples: LDD, ADD, INC, DEC. Assembly language is low-level, but the processor still can't run it — it needs binary. Assembly code is also called source code (not only high-level code). (Few direct past-paper questions on the assembler — assembly language has its own chapter.)
Compiler
- Translates high-level language into machine code for the processor to execute
- Creates an executable file
- No need to give access to the source code, so it is more difficult for the user to modify the code
High-level languages: Python, JavaScript, C, C#… The Word icon you click is an executable file — you never need Word's source code. To modify a program you'd need the source code, and the programmer only hands out the compiled version.
Benefits of a compiler
- Produces an executable file
- User does not have access to source code
- It will probably be faster to run the executable file
- Code does not have to be compiled each time it is executed
- Does not need the compiler present at run-time
Already translated → faster. Compile once on one PC and share the .exe — it doesn't have to be compiled again on every other PC.
Drawbacks of a compiler
- The source code must be re-compiled every time the programmer changes the program
- Finding errors is difficult as error messages are given at the end
- The source code must be 100 % correct for the executable file to be produced
The compiler translates the whole code first, then gives one error report — so you have to work out where each error was.
Interpreter
- Translates high-level language into machine code for the processor to execute line by line
- Reads each statement and checks it before running it
- Halts when it encounters an error
- Analyses and checks each line before executing it
Benefits of an interpreter
- Errors can be corrected as they occur (it stops there, so just look at that line)
- Can run a partially complete program when developing
- The effect of any change made to the code can be seen immediately
Drawbacks of an interpreter
- No executable file is produced
- User has access to the source code (and can change it)
- Need to translate the source code again and again, so it consumes time
- The interpreter must be present at the time of execution
To give someone an interpreted program you must give the source code, and they need an interpreter; every time they run it (even half an hour later) the whole translate-and-run process repeats.
Differences between a compiler and an interpreter
| Compiler | Interpreter | |
|---|---|---|
| Output | creates an executable file | does not create an executable file |
| Distribution | compiled program can be independently distributed (no source needed) | needs the source code and an interpreter |
| Errors | checks the whole program for errors (report at the end) | executes each statement immediately after decoding; stops at an error |
| At run-time | compiled program does not require the compiler | interpreter software must be in main memory every time the program is executed |
| Other hardware | cross-compilation is possible — compile on one hardware to run on another | has to be interpreted again on each hardware |
✓ To convert a high-level programming language into a different form — mostly machine code (object code, 0110…) the processor can execute.
8. Partially Compiled & Partially Interpreted
✓ Bytecode can be used on any platform (Windows, Linux, Mac, Android, iOS) → the same Java program runs without being recompiled for each platform.
✓ The bytecode can be optimised for the CPU during the interpretation phase: the virtual machine uses information about the hardware architecture to generate optimised machine code on the fly — the same bytecode runs on different CPUs, but the machine code generated at run-time is specific to each CPU.
Mark-scheme summary: partially compiled programs can be used on different platforms as they are interpreted when run · code is optimised for the CPU as machine code is generated at run-time.
9. Integrated Development Environment (IDE)
Definition: An integrated development environment is a software application that combines all of the features and tools needed by a software developer. It is a coding platform — you write code, and the compiler / terminal, running and error-finding tools are all in the same place.
Examples: Eclipse (the board screenshot), VS Code, PyCharm, Atom, Sublime Text, Notepad++. Trying to type Python straight into one without installing Python itself won't work — the language must be downloaded too. IDE is now in Paper 1 (it used to be Paper 2), so don't skip it.
Q: What are the features of an IDE?
- Pretty print ✓
- Automatic indentation ✓
- Syntax checking
- Highlights any undeclared variable
- Type checking
| # | What the figure shows |
|---|---|
| 1 | Pretty print — colour-coding: keywords, variables, etc. in different colours → code is more attractive and easy to understand |
| 2 | Automatic indentation — the IDE indents code inside the class / blocks for you (plain Notepad doesn't) |
| 3 | Unused variable highlighted (yellow) |
| 4 | Breakpoint (red dot) — run the code up to this point to look for errors |
| 5 | Syntax / type / declaration error underlined — e.g. y used without being declared |
| 6 | Variable watch — contents of variables at specific points |
| 7 | Report window — errors displayed in a separate window |
| 8 | Single stepping — the green line moves one line at a time |
Syntax checking: e.g. an opened curly bracket never closed, a missing "=" — the IDE flags it. Undeclared variable: in languages that need declaration (e.g. Visual Basic) you must say whether a variable is a string, integer…; an undeclared one is highlighted (Python needs no declaration). Type checking: checks what you type against the data types.
Q: Features of an IDE that assist in "initial error detection"
- Dynamic syntax checking ✓
- Type checking ✓
- Identification of unused variables ✓
Debugging tools that an IDE can provide ✓
| Tool | What it does |
|---|---|
| Breakpoint | run the code up to a set point to find errors; then check the next section |
| Report window | errors are displayed in a separate window in the IDE (traceback / "line 5" messages become easier to read with practice) |
| Single stepping | execute the code line by line (like an interpreter) and debug as each error appears |
| Variable watch | checks the content of variables at specific points — like a dry run, seeing what is stored before and after each step |
10. Full Chapter Cheat-Sheet
- OS = software platform that provides facilities for programs to run which benefit the user.
- Why: hardware unusable without it · interface & controls user ⇄ hardware communication · software platform.
- CLI = type commands, direct communication · GUI = icons + pointer, no need to know where the app is (Windows).
- Memory (allocate, fair, virtual memory, separate, release) · Process (scheduling, multitasking, priorities, share, no interference, resources)
- User interface · Security (accounts, access rights, passwords, auto back-up, restore) · File (allocation unit, directory, naming, access, open/delete/copy)
- Printer (driver, data, errors, commands) · Interrupt (priorities, save data, ISR) · Input/output (drivers, control data & hardware access, device communication)
- Formatter · Defragmenter · Disk repair · Virus checker · Backup · File compression
- Formatting hides data (address removed); defrag = contiguous files + big free area; bad sectors marked; off-site backup survives hazards.
- Library routine = pre-existing / pre-compiled code, linked to programs, for common complex tasks. + saves time, pre-tested, simplifies · − compatibility, may have bugs, may not fit needs.
- DLL = self-contained shared, already-compiled library, linked at run-time, separate from .exe, loaded only when needed, shared by many apps. + smaller .exe, no recompiling, saves memory · − not self-contained, must be present (else error), unexpected / malicious changes.
- Assembler: assembly (opcode + operand) → machine code. Compiler: whole HLL program → executable file; fast, source hidden; recompile on every change; errors at the end.
- Interpreter: line by line, halts at error; no .exe; source visible; slower; interpreter needed at run-time.
- Java: source → (compiler) → bytecode → (JVM interpreter) → machine code at run-time: platform-independent + CPU-optimised.
- Features: pretty print · automatic indentation · syntax checking · undeclared variables highlighted · type checking.
- Initial error detection: dynamic syntax checking · type checking · unused-variable identification.
- Debugging tools: breakpoint · report window · single stepping · variable watch.