Topic 6 asks how limited resources โ memory, processor time, bandwidth, storage โ are shared out. The operating system is the manager: it handles memory, the processor, peripherals and running programs.
Work through each screen, answer the questions as you go (some are wordy, some are calculations) and collect โญ stars. Press Start when you are ready.
Resources
System resources
Key resources a system must manage:
Primary memory (RAM) and secondary storage (disk capacity).
Processor speed and number of cores.
Bandwidth and network connectivity.
Cache, screen resolution, sound and graphics processors.
Every resource is finite, so demand can exceed supply and must be scheduled and prioritised.
OS
Role of the operating system
The operating system (OS) manages resources so programs and users can share the machine:
Memory management โ allocate and protect memory between programs.
Processor management โ schedule which process runs next.
Peripheral / device management โ control input and output devices.
Security and file management.
Sort it
Who or what handles it?
Tap an item, then the category it belongs to.
๐งฉ Managed by the OS
๐ง Hardware resource
๐ฆ Dedicated system
Memory
Paging and virtual memory
To run programs larger than physical RAM, the OS uses virtual memory: part of the disk is used as if it were extra RAM. Memory is divided into fixed-size pages that are swapped between RAM and disk as needed (paging).
Too much paging causes thrashing, where the system spends more time swapping than computing, and slows dramatically.
Quick check
Virtual memory
?What is virtual memory?
Scheduling
Scheduling and multitasking
Multitasking lets several processes appear to run at once. The scheduler gives each a slice of CPU time and switches quickly between them. Different scheduling policies (round-robin, priority) balance fairness and responsiveness.
Quick check
Scheduling
?Which OS function decides which process gets the CPU next when many are ready to run?
Interrupts
Interrupts and polling
Devices signal the CPU in two ways:
Interrupt โ the device sends a signal that makes the CPU pause, save its state and run an interrupt handler. Efficient: the CPU only reacts when needed.
Polling โ the CPU repeatedly checks each device. Simple, but wastes cycles when nothing has happened.
Quick check
Interrupt vs polling
?Why is using interrupts usually more efficient than polling?
Dedicated
Dedicated systems
A dedicated (embedded) system is built for one task โ a smart thermostat, an ATM, a washing-machine controller. It has limited, fixed resources and a specialised OS, so resource management is simpler but tightly constrained.
Calculate
Screen memory
1A 24-bit colour image uses 3 bytes per pixel. How many bytes of memory does a 1920 by 1080 screen need for one full frame?
bytes
Hint: 1920 times 1080 times 3.
Match it
Match the OS job
Tap a description on the left, then the OS function.
Description
OS function
Cache
The memory hierarchy
Memory forms a hierarchy, fastest and smallest first: registers, cache, RAM, then secondary storage. Cache holds recently and frequently used data close to the CPU. A high cache hit rate means most requests are served from fast cache, greatly improving performance.
Quick check
Cache purpose
?Why does a CPU use a small, very fast cache?
Calculate
Screen memory (2)
2How many bytes does one frame of a 640 by 480 screen need at 24-bit colour (3 bytes per pixel)?