AS Level · Topic 5.1
A-Level Computer Science 9618 / Topic 5 / AS

Tools and ready-made code.

An operating system comes with utility programs that format, protect, tidy, repair, shrink and back up your storage. Programmers, meanwhile, rarely start from nothing: they build on program libraries, including Dynamic Link Library files. Learn what each utility does and why libraries help developers.

The key idea

Utility software is system software that helps to maintain, protect and optimise the computer: a disk formatter, a virus checker, defragmentation software, disk contents analysis / disk repair software, file compression and back-up software. A program library is a collection of pre-written, pre-tested routines that developers can use in new programs. A Dynamic Link Library (DLL) is linked to a program when it runs, so one copy can be shared by many programs and updated without recompiling them.

Defragmentation: each file's blocks are moved next to each other Before After File A File B File C free space Fewer head movements on a magnetic disk, so files are read faster
Fig. 1: defragmentation moves the scattered blocks of each file together
Section 01

Utilities that come with the OS.

Each utility exists because of a specific problem. In an answer, name the utility and then say what it does and why that is needed.

UtilityWhat it does and why it is needed
Disk formatterprepares a storage device for first use: sets up the file system and the structure (e.g. tracks and sectors) the OS uses to store files; can partition a disk; removes existing data so a disk can be reused; a full format also checks for bad sectors
Virus checkerscans files and memory for viruses and other malware, comparing them with a database of known signatures and looking for suspicious behaviour; quarantines or deletes infected files; must be updated regularly to detect new threats
Defragmentation softwareover time files are split into blocks scattered across a magnetic hard disk; the defragmenter moves blocks so each file is stored contiguously and free space is grouped, so the read/write heads move less and files load faster
Disk contents analysis / disk repairanalyses how disk space is used (which files and folders take most space) so space can be freed; checks the disk for errors and bad sectors, marks bad sectors so they are not used, and repairs file system inconsistencies
File compressionreduces the size of files (lossless or lossy) so they take less storage space and are quicker to transmit; can bundle several files into one archive
Back-up softwaremakes copies of files on another device or in the cloud, often automatically to a schedule (full or incremental back-ups), so data can be restored after loss, corruption or a ransomware attack
Examiner trap

Defragmenting a solid state drive gives no speed benefit (it has no moving heads) and causes extra write operations that wear it out. Defragmentation is for magnetic hard disks.

Section 02

Program libraries.

Software under development is often constructed from existing code. A program library holds routines (procedures, functions, classes) that have already been written, compiled and tested, such as maths functions, graphics, sorting or file handling.

Examiner trap

Say the routines are pre-tested, not just pre-written. "It is already written" gains the time mark but not the reliability mark.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

What does defragmentation software do?

Quick check+10 XP

Which utility prepares a new disk for use by setting up its file system?

Quick check+10 XP

What is a program library?

Quick check+10 XP

When is a Dynamic Link Library linked to a program?

Section 03

Dynamic Link Libraries.

A library can be joined to a program in two ways. With a static library, the linker copies the routines into the executable file. With a DLL, the executable only holds a reference, and the DLL file is loaded and linked when the program runs.

Static libraryDynamic Link Library (DLL)
When linkedat compile / link timeat run time (when loaded or when first called)
Executable file sizelarger: contains the library codesmaller: library code is in a separate file
Memory useeach program loads its own copyone copy in memory can be shared by several programs
Updating the libraryevery program must be re-linked / recompiledreplace the DLL file; all programs using it get the update
Riskprogram is self-containedif the DLL is missing, or a new version is incompatible, the program fails to run
Worked example Why use a DLL?
Three programs on a computer each use the same 4 MiB graphics library. Compare static linking with using a DLL when all three programs are running.
  1. Static linking: each executable contains its own 4 MiB copy, so 3 × 4 = 12 MiB of library code is stored and loaded.
  2. DLL: there is one 4 MiB file on disk, and one copy in memory is shared by all three programs: 4 MiB.
  3. Saving: 12 − 4 = 8 MiB of memory and storage.
  4. Also, a bug fix to the graphics library only needs the one DLL file replaced; none of the three programs needs to be recompiled.
Answer: The DLL uses 4 MiB instead of 12 MiB, and can be updated once for all three programs.
Your turn
A program that worked yesterday now reports "missing .dll file" after another application was uninstalled. Explain what has happened.
Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to AS Paper 1 and Paper 2 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

Which is a benefit to a developer of using DLL files?

Exam style+20 XP

Why does a virus checker need regular updates?

Exam style+20 XP

Which utility identifies bad sectors and marks them so they are not used?

Exam style+20 XP

Why might a developer not want to use a library routine?

Skill unlocked

Utilities and program libraries, sorted.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Disk formatter, virus checker, defragmenter, disk analysis and repair, compression, back-up, program libraries and DLL files.