Skip to content
Cambridge AS & A Level9618

Purposes of an Operating System (OS)

Computer Science 9618 Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Purposes of an Operating System (OS) notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Purposes of an Operating System (OS) notes as text: skim, search, and jump between subtopics.

~15 min read

1. Managing the computer's resources

The operating system (OS) manages the computer's resources. Each resource has its own management task.

The key tasks are memory management, file management, security management, hardware / device management, input / output management and process management. The OS also does error checking and recovery, and provides a platform for software and a user interface.

Memory management makes efficient use of memory. Process management switches between processes so that they share the use of the processor. The next blocks show how.

Examiner insight

“A common incorrect response was to repeat one of the tasks already listed such as hardware management as well as device management.”

Worked example 14 marks

Identify four key management tasks that the Operating System will perform.

  1. 1

    memory management [1]

  2. 2

    file management [1]

  3. 3

    security management [1]

  4. 4

    process management (also credited: hardware / device / peripheral / resources management, input / output management, error checking and recovery) [1]

2. The user interface hides complexity

The user interface hides the complexities of the computer hardware from the user. The user does not need to know about memory locations, buses or hardware commands.

A graphical user interface lets the user click an icon instead of writing code. Device drivers let the OS control peripherals such as printers, and device mapping makes devices easy to identify and use.

Examiner insight

“Candidates who stated a benefit of a user interface, such as that the user interface hides the complexities of the computer hardware from the user, followed up with an example, such as clicking on an icon instead of writing code.”

Worked example 12 marks

A student buys a new computer. State one benefit to the student of a user interface and give an example.

  1. 1

    Benefit: the user interface hides the complexities of the computer hardware / operating system from the user [1]

  2. 2

    Example: clicking on an icon rather than writing code [1]

3. Multi-tasking and process states

Multi-tasking allows a computer to carry out, or seem to carry out, more than one process at a time. Processor time and other common hardware are shared between tasks.

At any moment a process is in one of three states. It is running when it has been given CPU time. It is ready when it is waiting in the ready queue for a slice of CPU time and could run. It is blocked when it is waiting for an I/O operation or other event.

Examiner insight

“However, very few candidates recognised that the word ‘processes’ was being used in the technical sense and the most usual answer was a list of all the different management functions the Operating System.”

Worked example 13 marks

In process management, a process can be in one of three process states: running, ready or blocked. Complete the table to identify one reason why a process could be in each of the three states.

Process stateReason
running
ready
blocked
  1. 1

    running: CPU time has been allocated and the process is being executed [1]

  2. 2

    ready: the process is waiting in the ready queue for a slice of CPU time, or it has been displaced by a higher priority process and could otherwise still run [1]

  3. 3

    blocked: the process is waiting for an I/O operation or some event to take place [1]

4. Scheduling routines

A scheduling routine decides which process gets the CPU next. Scheduling enables multi-tasking, keeps the CPU busy, and lets high priority jobs finish first.

In round robin each process in turn gets a fixed time slice. When the slice expires, the running process returns to the ready state. First come first served runs processes in the order they arrive. Shortest job first runs the process with the shortest run time next. Shortest remaining time runs the process with the least time left to run.

A higher priority process in the ready queue can pre-empt the running process.

Examiner insight

“The best responses from some candidates gave good descriptions of each of the given scheduling routines that said more than was implied from their name.” “Most candidates achieved at least one mark here, usually for stating that a process could change from the running state to the ready state when its current time slice expires, or by describing the impact of the CPU receiving an interrupt.”

Worked example 12 marks

Two of the process states are the running state and the ready state. Outline conditions under which a process could change from the running state to the ready state.

  1. 1

    When the time slice of the running process expires (round robin) [1]

  2. 2

    ... and there is a process with a higher priority in the ready queue, the running process is pre-empted [1]

  3. 3

    Alternatively, when an interrupt arrives at the CPU, the running process gets pre-empted

5. The kernel and interrupt handling

The kernel is the central component of the OS. It acts as the interrupt handler: it receives the signal when an interrupt is generated and checks its priority against the current process.

The kernel consults the interrupt dispatch table to find the routine for that interrupt. It saves the state of the interrupted process, with the register contents on the kernel stack, and restores it once the interrupt is serviced.

In low-level scheduling, the handling of interrupts by priority ensures that critical events are handled without delay.

Examiner insight

“There seemed to be an assumption that all current processes would be stopped immediately and the interrupt from the keyboard would be processed without any delay.”

Worked example 12 marks

The kernel is the central component of an Operating System (OS). Outline how the kernel of an OS acts as an interrupt handler.

  1. 1

    The kernel receives a signal when an interrupt is generated, and checks its priority against the current process [1]

  2. 2

    It consults the interrupt dispatch table (IDT) and saves the state of the interrupted process (register contents) on the kernel stack [1]

  3. 3

    Alternatively: the kernel restores the process state once the interrupt is serviced

6. Virtual memory and paging

Virtual memory is an area of secondary storage used to temporarily extend the available memory. It is not a virtual machine.

It is used when RAM is running low, for example when many processes run at once. Data or programs that are not immediately needed can be moved from RAM to virtual memory, so the RAM and processor are used efficiently.

In paging, memory is divided into fixed size blocks called pages, and pages are swapped between main memory and secondary storage.

Examiner insight

“A number of candidates incorrectly gave answers that related to virtual machines.” “Candidates who stated that virtual memory is used when RAM is running low, and correctly expanded on this point achieved the marks.”

Worked example 12 marks

Outline the reasons why an operating system may need to use virtual memory.

  1. 1

    Virtual memory is used when RAM is running low ... [1]

  2. 2

    ... such as when a computer is running many processes at once. (Or: data / programs not immediately needed can be moved from RAM to virtual memory, for efficient use of RAM / the processor) [1]

7. Segmentation, and how it differs from paging

In segmentation the logical (virtual) address space is broken into varying sized blocks called segments. Each segment has a name and a size.

The address is specified by the user and holds a segment name and an offset. A segment map table maps logical addresses to physical addresses.

So paging uses fixed size blocks and segmentation uses variable size blocks. A difference needs both halves.

Examiner insight

“A few candidates incorrectly stated these the wrong way round, and a number of other candidates only gave a statement for either paging or segmentation, not both, which does not therefore give a difference.”

Worked example 14 marks

Describe the process of segmentation for memory management.

  1. 1

    In segmented memory, the logical / virtual address space is broken into varying sized blocks called segments [1]

  2. 2

    Each segment has a name and size [1]

  3. 3

    During execution, segments from logical / virtual memory are loaded into physical memory [1]

  4. 4

    A segment map table maps logical / virtual addresses to physical addresses [1]

8. Page replacement and disk thrashing

When main memory fills up, more and more pages need to be swapped in and out of virtual memory.

This swapping leads to a very high rate of hard disk access, with excessive disk head movements. Eventually, more time is spent swapping pages than processing data. This is disk thrashing, and it can make a program freeze or not run.

Disk thrashing is not disk fragmentation.

Examiner insight

“Some candidates incorrectly linked disk thrashing to disk fragmentation.”

Worked example 13 marks

Explain what is meant by disk thrashing.

  1. 1

    Disk thrashing is a problem that may occur when virtual memory is being used [1]

  2. 2

    As the main memory fills up, more and more pages need to be swapped in and out of virtual memory [1]

  3. 3

    This swapping leads to a very high rate of hard disk access / excessive disk head movements [1]

Recap

  • The OS manages memory, files, security, hardware, input / output and processes, and provides a user interface.
  • The user interface hides the complexities of the hardware, for example by clicking an icon instead of writing code.
  • Multi-tasking shares processor time between processes. States: running, ready (could run, waiting for CPU time), blocked (waiting for I/O).
  • Scheduling routines: round robin, shortest job first, first come first served, shortest remaining time.
  • The kernel handles interrupts: check priority, use the interrupt dispatch table, save and restore the process state.
  • Virtual memory extends RAM using secondary storage. Paging is fixed size blocks; segmentation is variable size segments.
  • Disk thrashing: heavy page swapping, so more time is spent swapping than processing.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. State the OS management task that (a) gives RAM to a process that has just started, (b) checks that a user is who they claim to be, (c) installs the programs that let the OS use a printer plugged into a USB port.3 marks
    Answer
    1. (a) Memory management.
    2. (b) Security management.
    3. (c) Hardware management (device drivers).

    Trap: Installing programs for a connected device is hardware management, not process management.

  2. A user saves a document by clicking a floppy-disk icon. Describe how the user interface hides the complexity of the hardware from the user in this action.2 marks
    Answer
    1. The user clicks an icon instead of writing code or commands.
    2. The user does not need to know about memory locations or hardware; the OS deals with them.

    Trap: Saying only that the interface is easy to use gives no link to hidden hardware complexity.

  3. A student says that virtual memory is a virtual machine inside the computer. Explain why this is wrong and state what virtual memory is.2 marks
    Answer
    1. Virtual memory is about extending memory, not about a machine.
    2. It is an area of secondary storage used to temporarily extend the available memory.

    Trap: Examiners reported answers that described virtual machines instead of virtual memory.

  4. (a) State what is meant by multi-tasking. (b) A program is waiting for the user to type a file name. State its process state and explain why it is not in the ready state.3 marks
    Answer
    1. (a) Multi-tasking allows the computer to carry out, or seem to carry out, more than one process at a time.
    2. (b) Blocked.
    3. A ready process could run if given CPU time; this process is waiting for an I/O event, so it cannot run yet.

    Trap: Both ready and blocked processes are waiting, but only a ready process is waiting for CPU time alone.

  5. A process is running when a printer sends an interrupt saying it is out of paper. Describe how the kernel deals with the interrupt.3 marks
    Answer
    1. The kernel receives the interrupt signal and checks its priority against the running process.
    2. It saves the state of the interrupted process (register contents) on the kernel stack and uses the interrupt dispatch table to find the routine.
    3. Once the interrupt is serviced, the kernel restores the process state so it can continue.

    Trap: Without saving and restoring the process state, the interrupted process cannot carry on where it stopped.

  6. Memory is divided into fixed size blocks of 4 KiB. (a) State the name of this scheme. (b) A program is 10 KiB. State the number of blocks it needs.3 marks
    Answer
    1. (a) Paging.
    2. (b) 10 ÷ 4 = 2.5, so it cannot fit in 2 blocks.
    3. It needs 3 blocks.

    Trap: Rounding 2.5 down to 2 leaves part of the program without a block.

  7. An OS uses round robin with a time slice of 2 ms. Processes A, B and C arrive together, in that order. They need 5 ms, 3 ms and 2 ms of CPU time. Give the order in which they use the CPU and the time at which each finishes.3 marks
    Answer
    1. Order: A (0 to 2 ms), B (2 to 4), C (4 to 6), A (6 to 8), B (8 to 9), A (9 to 10).
    2. C finishes at 6 ms and B at 9 ms.
    3. A finishes at 10 ms.

    Trap: B needs only 1 ms in its second turn, so it hands over the CPU at 9 ms and does not wait for the slice to end.

  8. Four processes arrive together, in the order P1, P2, P3, P4. They need 8 ms, 4 ms, 1 ms and 3 ms of CPU time. Find the average waiting time before each starts when the OS uses (a) first come first served, (b) shortest job first.4 marks
    Answer
    1. (a) Waiting times: P1 0, P2 8, P3 12, P4 13. Total 33, so average 33 ÷ 4 = 8.25 ms.
    2. (b) Order: P3, P4, P2, P1. Waiting times: P3 0, P4 1, P2 4, P1 8. Total 13, so average 13 ÷ 4 = 3.25 ms.

    Trap: Waiting time is the time before a process starts, not the time at which it finishes.

  9. An OS uses round robin with a time slice of 3 ms. Processes are pre-empted only when their time slice ends. Processes A and B arrive together, in that order: A needs 7 ms of CPU time and B needs 4 ms. After 2 ms of its first turn, B asks the disk for data. The data arrives 2 ms later; B then joins the back of the ready queue and still needs 2 ms of CPU time. (a) State the process state of B at 1 ms, 4 ms, 6 ms and 7.5 ms. (b) State the time at which each process finishes.6 marks
    Answer
    1. (a)
    2. A runs 0 to 3 ms, B runs 3 to 5 ms and is then blocked until its data arrives at 7 ms. A runs 5 to 8 ms.
    3. At 1 ms B is ready; at 4 ms it is running.
    4. At 6 ms B is blocked; at 7.5 ms it is ready, waiting for A's time slice to end at 8 ms.
    5. (b)
    6. B runs 8 to 10 ms, so B finishes at 10 ms.
    7. A then needs 1 ms more and runs 10 to 11 ms, so A finishes at 11 ms.

    Trap: Examiners reported the assumption that the running process stops at once; when B's data arrives it waits in the ready state until A's time slice ends.

  10. A video editing program uses 6 MiB of data. The OS uses paging with a page size of 4 KiB, and only 1000 page frames are free in RAM. The disk light stays on and the program freezes. A technician says: "The disk is fragmented, so I will run defragmentation software." (a) Calculate the number of pages the data occupies. (b) Explain what is happening to the computer. (c) Explain why the technician's fix will not work, and state a hardware change that would help.8 marks
    Answer
    1. (a)
    2. 6 MiB = 6 × 1024 = 6144 KiB.
    3. 6144 ÷ 4 = 1536 pages.
    4. (b)
    5. Only 1000 pages fit in RAM, so 536 pages must be held in virtual memory at any time.
    6. As the program uses its data, pages are swapped in and out of virtual memory again and again.
    7. This leads to a very high rate of hard disk access and excessive disk head movements.
    8. Eventually more time is spent swapping pages than processing data: this is disk thrashing, so the program freezes.
    9. (c)
    10. Disk thrashing is caused by swapping pages, not by fragmentation, so defragmentation does not reduce the swapping.
    11. More RAM means more of the data can be stored without needing to use virtual memory.

    Trap: Examiners reported candidates linking disk thrashing to disk fragmentation; a second slip is taking 1 MiB as 1000 KiB, which gives 1500 pages.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
Virtual memory is a virtual machine inside the computer.Virtual memory is an area of secondary storage used to temporarily extend the available memory.
Paging and segmentation are both ways of splitting memory.Paging uses fixed size blocks; segmentation uses variable size blocks.
Disk thrashing is the disk becoming fragmented.Disk thrashing is frequent swapping of pages between main and secondary memory, so more time is spent swapping than processing.
The running process stops at once and the interrupt is handled immediately.The kernel checks the priority of the interrupt; the system enters kernel mode only if the interrupt has a higher priority than the current process.

Frequently asked questions

What are the key management tasks of an operating system?
The operating system manages the computer's resources, and each resource has its own management task. The key tasks are memory management, file management, security management, hardware or device management, input / output management and process management. The operating system also does error checking and recovery, and provides a user interface.
What are the running, ready and blocked process states?
A process is running when it has been given CPU time. It is ready when it is waiting in the ready queue for a slice of CPU time and could run. It is blocked when it is waiting for an I/O operation or other event.
What scheduling routines does an operating system use to decide which process runs next?
A scheduling routine decides which process gets the CPU next. In round robin each process in turn gets a fixed time slice. First come first served runs processes in the order they arrive, shortest job first runs the process with the shortest run time next, and shortest remaining time runs the process with the least time left to run.
How does the kernel handle an interrupt?
The kernel is the central component of the operating system, and it acts as the interrupt handler. It receives the signal when an interrupt is generated and checks its priority against the current process. It consults the interrupt dispatch table to find the routine, and saves the state of the interrupted process on the kernel stack. The state is restored once the interrupt is serviced.
What is virtual memory and how does paging differ from segmentation?
Virtual memory is an area of secondary storage used to temporarily extend the available memory, and it is used when RAM is running low. In paging, memory is divided into fixed size blocks called pages. In segmentation, the logical address space is broken into varying sized blocks called segments, and a segment map table maps logical addresses to physical addresses.
Is disk thrashing the same as disk fragmentation?
No. Disk thrashing is not disk fragmentation. It is frequent swapping of pages between main memory and virtual memory, which leads to a very high rate of hard disk access, so more time is spent swapping than processing data.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters