A program is stored on secondary storage before it is run.
Describe how the operating system manages memory when a program is started.
Mark scheme
Award up to two marks for a linked description such as:
- The program (and its data) is copied/loaded from secondary storage into main memory/RAM (1) so that the CPU can fetch/execute its instructions (1)
- An area of main memory is allocated/reserved for the program (1) that is large enough to hold the program and its data (1)
- The operating system checks that there is enough free main memory (1) before the program can be started/loaded, otherwise it cannot run/an error is reported (1)
- The operating system keeps a record of the memory addresses used by the program (1) so that its instructions and data can be found when it runs (1)
Allow 'loaded into RAM', 'stored in memory' and 'put into main memory' as equivalent to copied into main memory.
A single statement that the program is loaded/stored in main memory, with no linked development, can be given one mark only.
Do not accept descriptions of the CPU fetching/executing instructions that do not refer to the operating system loading or allocating memory.
Do not accept responses about virtual memory (moving processes to secondary storage) or about which process runs next on the CPU.
Do not accept the program being run from secondary storage/hard disk.
Example answers and how they were marked
The operating system copies the program and its data from secondary storage into main memory so that the CPU can fetch and execute its instructions.
Why: Copying the program and data into main memory (1) linked to the CPU fetching/executing instructions (1).
The operating system loads the program into main memory.
Why: The program is copied/loaded into main memory (1), but there is no linked development of how or what this leads to, so only one mark is given.
The CPU fetches the program's instructions from main memory and executes them one at a time.
Why: This describes the fetch-decode-execute cycle, not the operating system loading or allocating memory, which is the Do not accept line; no creditworthy point is made.