An operating system (OS) sits between the hardware and the applications. It hides the complexity of the hardware and provides a set of essential services that every program needs.
Process management – creation, scheduling and termination of processes.
Memory management – allocation, protection, paging/segmentation and virtual‑memory support.
File‑system management – organising, storing and retrieving data on disks.
Device (hardware) management – abstracting keyboards, displays, disks, printers, etc.
Common operations – create, open, read, write, close, delete.
Device Management
Device drivers translate generic OS requests into hardware‑specific actions.
Uniform I/O interface (e.g., read/write system calls) works for disks, keyboards, mice, network cards, etc.
Security & Protection
Authentication – verifying user identity (passwords, biometrics).
Access‑control lists (ACLs) – specify which users or groups may read/write/execute a file.
Audit logs – record security‑relevant events for later review.
Firewalls and sandboxing – limit network traffic and isolate applications.
5.1.3 Utility Software Supplied with the OS
Beyond the kernel, most operating systems provide a suite of utility programmes that help users and administrators manage the system.
Disk formatter / partitioner – prepares storage media for use.
File manager / explorer – graphical or command‑line interface to the file system.
Virus / malware scanner – checks files for known threats.
System monitor (Task Manager, top) – displays running processes and resource usage.
5.1.4 What Is a Program Library?
A program library is a collection of pre‑compiled routines (functions, procedures, classes) that can be called by many different programs. Libraries give developers:
Reusable code – avoid rewriting common functionality.
Encapsulation – hide implementation details behind a simple interface.
Faster development – concentrate on the unique parts of an application.
5.1.5 Types of Program Libraries
Static libraries – linked into the executable at compile time; the code becomes part of the final program file.
Dynamic (shared) libraries – linked at run‑time; a single copy can be shared by many processes.
Import libraries – small stub files that describe the symbols in a dynamic library for the linker.
Dynamic libraries are loaded by the OS loader when the program starts, whereas static libraries are incorporated before the loader ever sees the executable.
5.1.6 Static vs Dynamic Linking – Comparison
Aspect
Static Linking
Dynamic Linking
When linking occurs
During compilation (build time)
At program start‑up or on‑demand (run‑time)
Executable size
Larger – library code is copied into each executable
Smaller – only references to the shared object are stored
Memory usage
Each process has its own copy of the library code
All processes can share a single copy in RAM
Update / patching
Requires recompilation of every program that uses the library
Replacing the shared library automatically updates every program that loads it
Portability
Executable is self‑contained – easier to move between systems
Depends on the correct version of the shared library being present on the target system
Typical file extensions
.a (Unix), .lib (Windows)
.so (Unix/Linux), .dll (Windows)
5.1.7 How Dynamic Linking Works
When a program that uses a dynamic library is started, the OS loader performs these steps:
Read the executable’s import table to discover which shared objects are required.
Search the system’s library path (e.g., /lib, /usr/lib, PATH) for the required .so or .dll files.
Map the shared object into the process’s address space (typically with mmap on Unix‑like systems).
Resolve symbols – the loader patches the program so that calls to library functions jump to the correct memory addresses.
If the library itself depends on other libraries, repeat the process recursively.
5.1.8 Versioning and Compatibility
Dynamic libraries usually follow semantic versioning to signal API compatibility:
Major version – incompatible API changes.
Minor version – backward‑compatible additions.
Patch version – bug‑fix releases only.
Operating systems can keep several versions of a library side‑by‑side, allowing older programs to continue using the version they were built against.
5.1.9 Common Examples of Program Libraries
C Standard Library (libc) – printf, malloc, string handling, etc.
Java Standard API – packages such as java.util, java.io packaged in rt.jar.
.NET Framework Class Library (FCL) – classes in assemblies like System.dll.
POSIX Threads Library (pthread) – functions for creating and managing threads.
OpenGL / DirectX – graphics rendering libraries that rely on OS video‑driver services.
5.1.10 Advantages of Using Libraries
Code reuse reduces development time and the chance of errors.
Complex functionality is encapsulated behind simple interfaces.
Centralised maintenance – fixing a bug in the library benefits all dependent programs.
Memory efficiency when shared libraries are used.
5.1.11 Disadvantages and Risks
Version conflicts can lead to “DLL hell” or “dependency hell”.
A compromised shared library can affect many applications (security risk).
Dynamic linking adds a start‑up overhead while the loader resolves symbols.
Static linking inflates executable size, which may be unsuitable for embedded systems.
5.1.12 Sample Calculation – Memory Savings with Shared Libraries
Assume each process needs 2 MB of library code. If 10 processes run simultaneously:
Static linking total memory:
\$\text{Static total memory}=10\times2\text{ MB}=20\text{ MB}\$
Dynamic linking total memory (one shared copy + process‑specific data):
\$\text{Dynamic total memory}=2\text{ MB (shared)}+10\times\text{(process‑specific data)}\$
Thus, the shared approach can save up to 18 MB of RAM in this scenario.
Suggested diagram: Flowchart of the dynamic linking process from program start‑up to symbol resolution.
5.1.13 Key Points to Remember
A program library is a reusable collection of compiled code.
Static linking incorporates the library into the executable; dynamic linking loads it at run‑time.
Dynamic libraries reduce memory usage and simplify updates, but they introduce version‑dependency issues.
Understanding the OS loader’s role is essential for diagnosing linking problems.
Core OS management tasks (process scheduling, virtual memory, file systems, device drivers and security) provide the services on which libraries rely.
Support e-Consult Kenya
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources,
past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.