This mini-lesson covers OCR 1.2 β Software and software development: what the operating system is actually doing while your program runs, how source code becomes machine code, and how software projects are organised.
Work through each screen, answer the questions as you go (some are recall, some are calculations you must actually work out) and collect β stars. Press Start when you're ready.
The OS sits between the hardware and the applications and hides the hardware's complexity. Its jobs:
Paging vs segmentation: pages are fixed-size physical divisions of memory; segments are variable-size logical divisions that correspond to actual parts of a program (a subroutine, an array). Pages are simpler for the hardware; segments map better onto how a program is really structured.
Virtual memory uses secondary storage as an extension of RAM. Pages not currently needed are swapped out. If the swapping becomes constant, the machine thrashes β more time is spent moving pages than executing code.
Types of OS: multi-tasking (time-slices the CPU between processes), multi-user (schedules fairly between users), distributed (spreads work across many machines), embedded (built for one task, limited resources, highly reliable), real-time (guarantees a response within a fixed deadline β an aircraft or a pacemaker).
An interrupt is a signal telling the processor that something needs attention now β a key pressed, a disk transfer finished, a divide-by-zero, a power failure.
At the end of each FDE cycle the processor checks the interrupt register. If an interrupt of higher priority than the current task is waiting:
Why a stack and not just a variable? Because a higher-priority interrupt can arrive while an ISR is running. The stack nests them naturally: the most recent state saved is the first restored. LIFO is not a convenience here β it is a necessity.
The scheduler decides which process gets the CPU. It aims to maximise throughput, keep the CPU busy, and be fair.
| Algorithm | How it works | Weakness |
|---|---|---|
| Round robin | Each process gets a fixed time slice in turn | Fair, but ignores urgency and priority |
| First come, first served | In arrival order, run to completion | One long job blocks everything behind it (convoy effect) |
| Shortest job first | The shortest total burst goes first | Gives the best average wait β but long jobs may starve, and it needs the burst times in advance |
| Shortest remaining time | Pre-emptive: switch if a new job is shorter than what remains | Best response times; the most context switching |
| Multi-level feedback queues | Several queues of different priority; jobs move between them | Flexible but complex to tune |
Burst times 6, 2, 8, 4 (all arriving at once). SJF runs them in the order 2, 4, 6, 8.
Waiting times: 0, then 2, then 2+4 = 6, then 6+6 = 12.
Average wait = (0 + 2 + 6 + 12) Γ· 4 = 20 Γ· 4 = 5
Run them first-come-first-served in the original order and the average wait is 7.5 β half as good again.
| Compiler | Interpreter | Assembler |
|---|---|---|
| Translates the whole program in advance | Translates and runs one statement at a time | Translates assembly to machine code, one-to-one |
| Produces an executable; runs fast | Produces nothing; slow; re-translates every loop pass | Produces machine code |
| Reports all errors at the end | Stops at the first error β great for debugging | β |
The four stages of compilation:
Linkers and loaders: a linker combines your object code with the library modules it calls. Static linking copies them into the executable (bigger file, no dependencies); dynamic linking leaves them to be loaded at run time (smaller file, shared libraries, but it breaks if the library is missing). A loader puts the executable into memory and starts it.
| Method | Character | Best when⦠|
|---|---|---|
| Waterfall | Strict linear stages; each is signed off before the next | Requirements are fully known and stable; heavy documentation is required (safety-critical, government) |
| Agile / extreme programming | Short iterations, working software each cycle, constant customer contact, pair programming, test-driven development | Requirements are unclear or changing; the customer is available |
| Spiral | Iterative, with formal risk analysis at every loop | Large, expensive, high-risk projects |
| Rapid application development | Prototype fast, get user feedback, refine, repeat | The interface matters most and the user must see it to react to it |
The honest comparison: waterfall's fatal flaw is that a requirement misunderstood at the start is not discovered until testing, when it is ruinously expensive to fix. Agile's cost is thinner documentation and a scope that can drift β and it needs a customer who will genuinely engage. Neither is universally right: a pacemaker's firmware should not be built by iterating on user feedback in production.
Tap an item, then tap the group it belongs to.
Tap an item on the left, then its partner on the right.
OS: memory management (paging = fixed, segmentation = variable) Β· scheduling Β· interrupts Β· files Β· peripherals Β· security
Virtual memory: pages swapped to secondary storage; constant swapping = thrashing
Interrupts: checked at the end of each FDE cycle Β· registers pushed to a stack Β· ISR runs Β· state popped back
Scheduling: round robin (fair) Β· FCFS (convoy effect) Β· SJF (best average wait, risks starvation) Β· SRT (pre-emptive)
Compilation: lexical β syntax β code generation β optimisation; then linking (static or dynamic) and loading
Methodologies: waterfall (fixed requirements) Β· agile (evolving) Β· spiral (risk-driven) Β· RAD (prototypes)
That is the whole of OCR 1.2. Press Finish to see your score.
You've worked through Software & software development for OCR A-level Computer Science (H446). π
Your stars: 0 / 0
Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.