1. IB Computer Science
Content developed by
Dartford Grammar School
Computer Science Department
Resource
Management
2. 1: System design
2: Computer
Organisation
3: Networks
4: Computational
thinking
5: Abstractdata
structures
6: Resource
management
7: Control
D: OOP
HL only 6 Overview
Content developed by Dartford Grammar School Computer Science Department
Systemresources
1. Identify theresources that need to be managed within acomputer system
2. Evaluatetheresources availablein a variety of computer systems
3. Identify thelimitations of a rangeof resources in a specified computer system
4.Describethepossible problems resulting from thelimitations in theresources in a
computer system
Role of theoperating system
5.Explain therole of theoperating system in terms of managing memory, peripherals and
hardware interfaces
6.1.7 OutlineOS resource management techniques: scheduling, policies, multitasking,
virtual memory, paging, interrupt, polling
8. Discuss theadvantagesof producing a dedicated operating system for a device
9.Outlinehow an operating system hides thecomplexity of thehardware from users and
applications
3. Topic 6.1.1
Identify the resources that need to be
managed within a computer system
Content developed by Dartford Grammar School Computer Science Department
5. Important resources to manage
• Primary memory (RAM)
• Secondary storage (HDD/SSD/optical drives)
• Processor speed
• Bandwidth
• Screen resolution
• Sound processor
• Graphics processor
• Cache
• Network connectivity
Content developed by Dartford Grammar School Computer Science Department
6. It’s all about the money
Ultimately, most computersare
commodities – items to be sold.
If profitis a factor, so will be reducing
the costs of manufacturing.
To give users the best possible
experience, it is essential to tailor
each system’s configurationto its
intended purpose.
Each componentin a computer
affects its function in a particular
way.
Content developed by Dartford Grammar School Computer Science Department
7. Primary Memory (RAM)
What it does:
• Place where all data/programs currently being
processed are kept
Common capacities:
• Gigabytes (GB): 1/2/4/8/16
Effect on system if too limited:
• If too little physical memory exists, the system will
need to use secondary storage, which is much slower,
by means of virtual memory.
• If virtual memory cannot be created or is insufficient,
the program/data simplycannot be loaded.
• It influences how manyprocesses can be done
silmulataneously.
Content developed by Dartford Grammar School Computer Science Department
8. Secondary Storage (HDD/SSD/Optical)
What it does:
• Place were data/programcan be stored if
powered is lost (RAM is volatile).
Common capacities:
• Gigabytes (GB) / Terabyte (TB):
– HDD: 500GB / 1TB / 2TB
– SDD: 256GB / 512GB
– Optical: CD 650MB / DVD 4.7GB
Effect on system if too limited:
• No place to ‘save’work – so data might be lost
• Can also prevent the OS from using storage as
virtual memory if RAM fills up
• Limits howmuch data can be kept
Content developed by Dartford Grammar School Computer Science Department
9. Processor: Speed
What it does:
• Processor does all calculationsin a
computer system.
• Speed is measurement ofhow many
calculations can be done per second
(1Ghz = 1 billion calculations per
second)
Common speeds:
• Gigahertz (GHz): 1/1.2/2/2.4/3.2
Effect on system if too limited:
• Processor will take longer to perform
tasks
Content developed by Dartford Grammar School Computer Science Department
11. Processor: Cores
What it does:
• Each processor has at least 1 ALU or core. If
you have 2 ALUs you can do two operations
at once, etc.
Common capacities:
• 2 core = dual core, 4 = quad,8 = octa, etc.
Effect on system if too limited:
• If you haveonlyone core, you can only
perform one set of operations/calculations
at a time. If you have two or more you can
do more calculation in the same time frame.
• It affects how manytasks a system can cope
with simulataneously.
Content developed by Dartford Grammar School Computer Science Department
12. Bandwidth (network transmissions)
What it does:
• Measurement of howmuch data can be sent
at same time in a certain time frame (also
called bitrate)
Common capacities:
• Measured in bits per second (bps):
Broadband= 16-100Mbps;
LAN = up to 1Gbps (note: 1 Gbps = 1/8 GBps)
Effect on system if too limited:
• Limitingthe bandwidth means data will take
longer to move between two points.
• It affects how longit takes before data can
be processed in its entirety.
Content developed by Dartford Grammar School Computer Science Department
13. Low vs High bandwidth
Content developed by Dartford Grammar School Computer Science Department
14. Screen resolution
What it is:
• Measurement of number of pixels in height x width of
display
Common capacities:
• 1024×768 (XGA)
• 1366×768 (HD 720p)
• 1920x1080 (HD 1080p)
• 4096x2304 (4K)
Effect on system if too limited:
• If resolutionis too limited, the number of pixles that can
be displayed is less – display might be pixelated (blocky)
• Lower resolutions = smaller file size but poorer quality
images
https://en.wikipedia.org/wiki/List_of_common_resolutions
Content developed by Dartford Grammar School Computer Science Department
15. Sound processor
What it does:
• Sound reproductionis done by a separate processor,
freeing up the CPU to do other calculations.
• Can also contain a bank of ‘sampled’sounds to
reproduce better qualitymusic/audio
Commonly seen in:
• Home theatre systems
• Cinemas
Effect on system if too limited:
• CPU is taxed with havingto processes sounds, slows
down system overall.
• Overall qualityis not as high as in a system with a
dedicated sound processor.
Content developed by Dartford Grammar School Computer Science Department
16. Graphics processor (GPU)
What it does:
• Does complexgraphic
processing (like 3D rendering)
Commonlyseen as:
• Nvidia graphics card
• ATI graphics card
Effect on system if too limited:
• If CPU has to do graphics
processing, it will take longer
or be limited.
Note: SoC vs ‘on board’ vs GPU vs Graphics card
Content developed by Dartford Grammar School Computer Science Department
17. Cache (physical cache)
What it does:
• Contains the instruction/data the CPU is
likely to request next from RAM – it
massively speeds up processing as the
CPU does not haveto ‘wait’for
instructions to arrivefrom RAM.
Common capacities:
• Megabytes (MB): 1 to 128
Effect on system if too limited:
• CPU will haveto ‘wait’for
instructions/data to be fetched from
RAM – slowingdown system. User
experiences ‘sluggish’ system.
Content developed by Dartford Grammar School Computer Science Department
18. Network connectivity (NIC/WNIC/Bluetooth)
What it is:
• Each network card connects to a
particular type of network media
(cable/wireless signal)
Commonly found as:
• NIC = LAN/ethernet cables
• WNIC = WiFi signals
• Bluetooth = Bluetoothsignals
• 3G radio = cellularsignals
Effect on system if limited:
• Limited connection types limits the way
data can be sent or received in a system.
• Speed can also be a factor.
Content developed by Dartford Grammar School Computer Science Department
20. Topic 6.1.2
Evaluate the resources available in a
variety of computer systems
Content developed by Dartford Grammar School Computer Science Department
21. Types of computer systems
• Mainframe
• Servers
• PCs
• Sub-laptops
• Cell phones
• Tablets
• PDAs
• Digital cameras
Content developed by Dartford Grammar School Computer Science Department
22. Mainframes
Processor: Thousands of cores
Primary memory: Vast amounts
Secondary memory: Vast amounts
Common use:
• Used in large companies
• Used for weather/financial
models and predictions
• Used to ‘virtualize’ smaller
computers
• Main players: CRAY/IBM
Content developed by Dartford Grammar School Computer Science Department
23. Server & Server farms
Processor: Many high spec PCs
running in parallel (3-4GHz)
Primary memory: Big capacity
(32GB+ per machine)
Secondary memory: Terabyte per
machine
Common use:
• Used to ‘serve’ networks
• Used as data centers for ‘cloud
storage’
• Size varies according to use
Content developed by Dartford Grammar School Computer Science Department
24. PCs (Desktop)
Processor: Single processor
(multiple cores) 1-4 GHz
Primary memory: 2-16 GB
Secondary memory: 256 GB to 2 TB
Common use:
• Used in companies/schools
(where portablility is not needed)
• Can be expanded by adding
expansion cards (graphics cards)
• Used to be the most common
type of personal computer
Content developed by Dartford Grammar School Computer Science Department
25. Sub-laptops (netbooks)
Processor: Single/multiple core (1-2 GHz)
Primary memory: 1-2 GB
Secondary memory: Normally SSD – 16-
128 GB
Common use:
• Fueled by ‘netbook boom’ of early
2000s (before tablets)
• Runs stripped down OS (Linux,
Chrome OS)
• Portablity and battery life are key
features
Content developed by Dartford Grammar School Computer Science Department
26. Cell phones/mobiles
Processor: Single/Multicore
Primary memory: 1-3 GB
Secondary memory: Usually limited, but
can be upgraded (MicroSD card)
Common use:
• Most common personal computing
device in the world
• Getting more capable, rivaling
PCs/laptops
• Biggest constraint is screen size and
input options (lack of physical keyboard)
Content developed by Dartford Grammar School Computer Science Department
27. Tablets
Processor: Single/Multicore
Primary memory: 1-4 GB
Secondary memory: Usually limited, but
can be upgraded (MicroSD card)
Common use:
• Very common for media consumption
• Getting more capable, rivaling
PCs/laptops
• Biggest constraint is lack of physical
keyboard
Content developed by Dartford Grammar School Computer Science Department
28. PDAs (Personal Digital Assistants)
Processor: Single core (<1GHz)
Primary memory: Limited (<500MB)
Secondary memory: Limited
(<128MB)
Common use:
• Not used that much any more
• Used for calendars/emails
• Was overtaken by smartphones
and mobiles in early 2000s
DON’T confuse with Siri/Cortana!
Content developed by Dartford Grammar School Computer Science Department
29. Digital Camera
Processor: Single core
Primary memory: Limited
Secondary memory: Expandable
through use of memory cards
(SD/Compact flash/Memory Stick)
Common use:
• For higher end photography
• Most digital cameras now
integrated in mobile
phones/laptops/tablets
Content developed by Dartford Grammar School Computer Science Department
30. Topic 6.1.3
Identify the limitations of a range of
resources in a specified computer
system
Content developed by Dartford Grammar School Computer Science Department
31. Case study: 3D graphics rendering
• Single processor computers may not be able to render 3D
graphics as effectively as multicore/systems with a GPU
Content developed by Dartford Grammar School Computer Science Department
33. What would the consequence be if
you had to limit…
• Primary memory?
• Secondary storage?
• CPU speed?
• CPU cores?
• Connectivity?
Content developed by Dartford Grammar School Computer Science Department
34. Would this be a good gaming setup?
What is limiting this system?
Content developed by Dartford Grammar School Computer Science Department
35. Would this be a video editing setup?
What is limiting this system?
Content developed by Dartford Grammar School Computer Science Department
36. Would this be good setup for watching movies?
What is limiting this system?
Content developed by Dartford Grammar School Computer Science Department
37. Topic 6.1.4
Describe the possible problems
resulting from the limitations in the
resources in a computer system
Content developed by Dartford Grammar School Computer Science Department
38. What is the consequence to the user
• If the processor is too slow?
• If the processor has only one core?
• If the amount of primary memory is limited?
• If the amount of cache is limited?
• If network connectivity is limited?
• If user access is limited to a single user per device?
Content developed by Dartford Grammar School Computer Science Department
39. Specific examples in syllabus
• User time wasted if primary memory is too
small or processor speed inadequate
• Multi-access and multi-programming
environments should be considered as well as
single-user systems
Content developed by Dartford Grammar School Computer Science Department
40. Multi-user system
• Either many users on the same machine
• Or many users connected to the same network
Content developed by Dartford Grammar School Computer Science Department
41. Multi-programming system
• Multi-programming system = system that can have different
programs (apps) installed
• Single programming system = can only run one program/set
of programs
Content developed by Dartford Grammar School Computer Science Department
42. Topic 6.1.5
Explain the role of the operating
system in terms of managing memory,
peripherals and hardware interfaces
Content developed by Dartford Grammar School Computer Science Department
43. Functions of an operating system
Content developed by Dartford Grammar School Computer Science Department
44. Controls (peripheral) devices
• Through the use of drivers (specially written, individualised)
‘translation’ programs, the other programs (and ultimately
the user) can use and control peripheral devices (like a
keyboard, mouse, printer, etc.)
Content developed by Dartford Grammar School Computer Science Department
45. Managing (primary) memory
• The OS has to ensure that
each process (program)
runs in its own allocated
memory space.
• If programs interfere with
each other’s memory
space it could cause many
problems including
corruption and security
issues.
Content developed by Dartford Grammar School Computer Science Department
46. Virtual memory
• Virtual memory is a
feature of an operating
system (OS) that allows a
computer to compensate
for shortages of physical
memory by temporarily
transferring pages of data
from random access
memory (RAM) to disk
storage.
Content developed by Dartford Grammar School Computer Science Department
47. Managing (secondary) storage
• The OS manages the secondary
storage by providing structure
and access methods to these
structures
• We often refer to this as the
folder-structure but in some OSes
it is referred to as the directory
structure.
• The OS also manages the security
access of these folders
Content developed by Dartford Grammar School Computer Science Department
48. Provides an interface
Content developed by Dartford Grammar School Computer Science Department
• User interface is used to interact with the computer to
performs various tasks. User gives commands to computer
and enters the data into computer. The operating system
then translates the input/output and sends it to the correct
memory address/folder address to be processed.
• Types of Operating Systems
Based on the user interface, there are two types of operating
systems.
• Graphical User Interface Operating System (Windows)
• Command Line Operating System (Linux Terminal)
49. Android vs Windows Phone (GUI)
Content developed by Dartford Grammar School Computer Science Department
50. Windows vs OS X (Apple)
Content developed by Dartford Grammar School Computer Science Department
51. Windows vs Linux vs OSX terminals
Content developed by Dartford Grammar School Computer Science Department
52. Time-slicing
• With a multi-user system, a time-slice is the set amount of
processing time each user gets.
• With a single-user system, a time-slice is the set amount of
processing time each program gets.
• Slices (also called threads) are alternately processed to give
the illusion of many tasks happening at once.
Content developed by Dartford Grammar School Computer Science Department
53. Interrupt handling
Content developed by Dartford Grammar School Computer Science Department
• An interrupt handler is a function in of the OS or a device
driver, whose execution is triggered by the reception of an
interrupt.
• In general, interrupts are used to handle high-priority
conditions that require the interruption of the current code
the processor is executing.
• For example, pressing a key on a keyboard, or moving the
mouse, triggers interrupts that call interrupt handlers which
read the key, or the mouse's position, and copy the
associated information into the computer's memory.
54. Waiting for input trigger
Content developed by Dartford Grammar School Computer Science Department
55. Can you discuss the following?
• Allocating storage and keeping track of
programs in memory
• Swapping between programs on time-slicing,
priority or when one is waiting for input
Content developed by Dartford Grammar School Computer Science Department
56. Topic 6.1.7
Outline OS resource management
techniques: scheduling, policies,
multitasking, virtual memory, paging,
interrupt, polling
Content developed by Dartford Grammar School Computer Science Department
57. Scheduling
• Scheduling is the method by which work is assigned to
resources that complete the work.
• The work could be processes which are in turn scheduled
onto hardware resources such as processors, network links
or expansion cards.
• The algorithm used may be as simple as round-robin in which
each process is given equal time (for instance 1 ms, usually
between 1 ms and 100 ms) in a cycling list. So, process A
executes for 1 ms, then process B, then process C, then back
to process A.
Content developed by Dartford Grammar School Computer Science Department
58. Policies
Content developed by Dartford Grammar School Computer Science Department
• The policies what is to be done while the mechanism
specifies how it is to be done.
• For instance, the timer construct (limiting the time a process
can use the CPU for) thereby ensuring CPU protection is
mechanism.
• On the other hand, the decision of how long the timer is set
for a particular user is a policy decision.
• The separation of mechanism and policy is important to
provide flexibility to a system.
59. Multitasking
• Multitasking, in an operating system, is allowing a user to
perform more than one computer task (such as the
operation of an application program) at a time.
• The operating system is able to keep track of where you are
in these tasks and go from one to the other without losing
information.
• Almost all of today's operating systems can do this.
• When you open your Web browser and then open Word at
the same time, you are causing the operating system to do
multitasking.
Content developed by Dartford Grammar School Computer Science Department
60. Virtual memory
• Virtual memory is a feature of an
operating system (OS) that allows a
computer to compensate for
shortages of physical memory by
temporarily transferring pages of
data from random access memory
(RAM) to disk storage.
• Eventually, the OS will need to
retrieve the data that was moved to
temporarily to disk storage -- but
remember, the only reason the OS
moved pages of data from RAM to
disk storage to begin with was
because it was running out of RAM.
Content developed by Dartford Grammar School Computer Science Department
61. Paging
• When using virtual memory, the OS needs to retrieve the data that was
moved to temporarily to disk storage; the only reason the OS moved pages
of data from RAM to disk storage to begin with was because it was running
out of RAM.
• To solve the problem, the operating system will need to move other pages
to hard disk so it has room to bring back the pages it needs right away
from temporary disk storage.
• This process is known as paging or swapping and the temporary storage
space on the hard disk is called a pagefile or a swap file.
• Swapping, which happens so quickly that the end user doesn't know it's
happening, is carried out by the computer’s memory manager unit
(MMU).
• The memory manager unit may use one of several algorithms to choose
which page should be swapped out, including Least Recently Used (LRU),
Least Frequently Used (LFU) or Most Recently Used (MRU).
Content developed by Dartford Grammar School Computer Science Department
62. Interrupt
• An interrupt is a signal to the processor emitted by hardware or
software indicating an event that needs immediate attention.
• An interrupt alerts the OS to a high-priority condition requiring the
interruption of the current code the processor is executing.
• The OS responds by suspending its current activities, saving its
state, and executing a function called an interrupt handler to deal
with the event.
• This interruption is temporary, and, after the interrupt handler
finishes, the processor resumes normal activities.
• There are two types of interrupts:
– hardware interrupts
– software interrupts
Content developed by Dartford Grammar School Computer Science Department
63. Polling
• Polling is the process where the computer or controlling
device waits for an external device to check for its readiness
or state, often with low-level hardware.
• For example, when a printer is connected via a parallel port,
the computer waits until the printer has received the next
character.
• Alternative to polling?: interrupts (signals generated by
devices or processes to indicate that they need attention)
• Although polling can be very simple, in many situations (e.g.,
multitasking operating systems) it is more efficient to use
interrupts because it can reduce processor usage and/or
bandwidth consumption.
Content developed by Dartford Grammar School Computer Science Department
64. For the exams: know when & why
Technique When is it used? Why is it used?
Scheduling
Policies
Multi-tasking
Virtual memory
Interrupts
Polling
Content developed by Dartford Grammar School Computer Science Department
65. Topic 6.1.8
Discuss the advantages of producing a
dedicated operating system for a
device
Content developed by Dartford Grammar School Computer Science Department
66. Examples of dedicated OS
• Apple’s iOS 9 for iPhones/iPads only
• Ubuntu Kylin for Chinese users
• OS for a digital camera
• OS for satellite TV receiver box
• OS for satnav
• Different versions of Linux, particular to each case –
example Raspbian for the Raspberry Pi
Content developed by Dartford Grammar School Computer Science Department
67. Advantages
• Security: A dedicated operating system ensures a higher
level of security.
– Example: Banks would require a dedicated operating system to prevent cyber
attacks on financial transactions
• Customisability: Dedicated operating systems custom made
to do a specific function at maximum efficiency.
– Example: A ‘dumb phone’ OS
• Modify priorities: can make running some devices easier to
use or better suited to their audience. By having a custom OS
you can eliminate certain aspects of the OS which are not
needed, reducing the size of the OS, therefore reducing the
amount of secondary memory and RAM being used
– Example: Raspbian Linux on Raspberry Pi
Content developed by Dartford Grammar School Computer Science Department
68. Are you able to explain
these in an exam?...
• Advantages related to size, speed and
customisation
• Typical example to be explained: Using a
dedicated operating system for a cell phone
rather than using a pre-existing operating
system (e.g. difference between iOS and OS X)
• Issue of proprietary software
Content developed by Dartford Grammar School Computer Science Department
69. Topic 6.1.9
Outline how an operating system hides
the complexity of the hardware from
users and applications
Content developed by Dartford Grammar School Computer Science Department
70. Teacher’s note
Content developed by Dartford Grammar School Computer Science Department
• Students should be aware of a range of
examples where operating systems virtualize
real devices, such as drive letters, virtual
memory, input devices, the Java virtual
machine.
• The issue of localization causing compatibility
problems between systems in different
countries is also important.
71. Abstraction leads to simplicity
Content developed by Dartford Grammar School Computer Science Department
• Users and applications do not see the hardware directly, but
view it through the OS.
• This is used to hide certain hardware details from users and
applications (called abstraction).
• Due to this abstraction, users cannot see changes in the
hardware. Can be used is to make related devices appear the
same from the user’s point of view.
• For example, hard disks, floppy disks, CD-ROMs, and USB
keys are all very different media, but in many OSes they
appear the same to the user.
72. Drive letters
• A ‘drive letter; is a single
alphabetic character A through Z
that has been assigned to a
physical drive or drive partition in
the computer.
• For example, a computer with a
floppy drive has a drive letter of A:
assigned to the drive.
• All computers with a hard drive will
always have that default hard drive
assigned to a C: drive letter
• CD-ROM or other drive is the next
drive letter (e.g. D:) etc.
Content developed by Dartford Grammar School Computer Science Department
73. Java Virtual Machine
• A Java virtual machine (JVM interprets compiled
Java binary code (called bytecode) for a computer's
processor (or "hardware platform") so that it can
perform a Java program's instructions.
• Each platform gets its own JVM so that Java code
can run on any platform.
Content developed by Dartford Grammar School Computer Science Department