Computer Systems 2009-2010 Week 12: System Software Alma Whitfield
Jan 17, 2016
Computer Systems
2009-2010
Week 12: System SoftwareAlma Whitfield
2
Session Aims Understand what System Software
is Operating System as an example
of System Software Functions of an operating system Study of operating system process
management function
3
Need for system software Computers very complex Come with large bundles of software
to help the non-specialist This software is called system
software
4
Software types System software
operating systems language translators (e.g. Java
language)
Application software programs we buy (sometimes and use)
e.g. Microsoft Word, Powerpoint, web browsers, games.
5
Operating systems In this session we focus on the most
important kind of system software – the operating system
Examples of operating systems include MS-DOS Windows Linux
6
What an operating system does
Just like mother
Teenager does not know how to operate toaster etc ..
… but mother does
7
What a mother does Teenager makes
service call Mother responds
by controlling the device needed
When device done it interrupts mother
Mother responds by delivering output to teenager
8
What an operating system does
Alternative would be to have the teenager understand how to work all the hardware
Not regarded by teenager as efficient!
Computers are invented by teenagers
Can you see where this is heading?
9
What an operating system does
Who is mother Operating
system Who is the
teenager Application
program
10
Tasks carried out by an operating system Running programs Managing files Managing main memory Controlling peripherals Utility programs
11
Running programs User requests a program
mouse click program name at command line
This triggers a sequence of actions ensure program is in main memory start fetch execute manage program’s file access manage program’s I/O device access
Operating system can detect and respond to errors
end a program after illegal attempt to access memory retry an operation when device not ready recover after power failure
12
Managing files Programs and data saved on disc as
files Operating System file manager
organises files enables user to add, update delete files controls file ownership in shared
system e.g. network, mainframe
13
Managing main memory Managing memory space Simultaneous programs
must not interfere with each other’s space
Large programs possible to load only required parts may use overlays
e.g. Word with little used menu options
14
Controlling peripherals Operating
system includes
kernel drivers
Drivers plug and play
15
Kernel The kernel is a key portion of the
Operating System that is loaded into memory when the machine is switched on and remains constantly in memory.
Contains the programs to handle the most frequent commands
The kernel is also know as the nucleus Good performance by the kernel is very
important for good performance by the machine
16
Utility programs Editors Clock Calculator Calendar Whatever else those nice guys at
Microsoft can think of
17
Issues over System Software What constitutes an operating system?
e.g. should it include Web browser, Java Virtual Machine and media player?
Microsoft was taken to court in the United States for anti-competitive conduct in making Internet Explorer 4.0 (and a non-standard JVM) non-removable parts of Windows 98
In 2004 the European Commission ruled that Microsoft broke EU competition law in tying Windows Media Player to its operating system
18
Do we need an Operating System?
Is the statement below True or False ?
You can’t use a computer without an Operating System!
19
False You can use a computer without an
operating system. However, you must be highly skilled
in Electrical and Mechanical Engineering
Some of the very first computers did not have Operating Systems
20
Studying the tasks carried out by an operating system Running programs Managing files Managing main memory Controlling peripherals Utility programs
21
Studying the tasks carried out by an operating system Running programs
today (Week 12) Managing files
done in Week 10, 11 Managing main memory
Week 14 Controlling peripherals
Week 13 (hard disk) Utility programs
22
Running programs
23
Running programs First machines
single user single program running at a time uniprogramming
More modern machines multiple users
e.g. bank system each user perhaps running several programs
at same time e.g. Windows PC
multiprogramming
24
Uniprogramming No Operating System Machines run from a console with
display lights and toggle switches, input device and printer
Scheduling time was an issue because one job had to finish before another could start
CPU must wait for I/O instructions to complete before proceeding
25
Programming with a femaleoperating system
http://www.berkeleyprep.org/webhouse/bh/html/histpic.htm
The girls organise the loading and running of programs.
They are effectively the 1940s version of the modern operating system
26
ENIAC (Electronic NumericalIntegrator and Computer) 1946
Men occasionally involved as well!
27
ENIAC (Electronic NumericalIntegrator and Computer) 1946 ... was the first large-scale,
electronic, digital computer capable of being reprogrammed
cost $500,000 only operational for 5 months before
it had to be shut down for refurbishment and a memory upgrade
28
Uniprogramming
29
Multiprogramming Multiple users accessing the same
data e.g. bank system
Single user running several programs at the same time e.g. Windows PC
30
Multiprogramming – two main issues Sharing the processor
how can two programs be fetching and executing at the same time in the same CPU?
Sharing the main memory how can we avoid the different sets of
program instructions and data in main memory getting mixed up?
31
Multiprogramming – two main issues Sharing the processor
how can two programs be fetching and executing at the same time in the same CPU?
Sharing the main memory how can we avoid the different sets of
program instructions and data in main memory getting mixed up?
Today
Week 14
32
Sharing the processor Original problem:
expensive , fast CPU waiting for slow peripherals – uneconomic
Solution have CPU run another program while
waiting
33
Other advantages Carry out tasks simultaneously
E.g. control central heating and word process Share peripherals
Mainframe and minis can centralise printers etc
Dumb terminals are cheap Share data
Users can access same files Concurrent programs on same machine
This is how we use Windows
34
Disadvantages Breakdowns affect everybody Portability – need link to central
machine Expense – but getting cheaper Security risks
35
Switching between programs Done by the kernel (part of
operating system) Known as a context switch Each program needs a control
block Preserves program’s state
CPU register contents Which data files are opened
36
Different strategies for switching When program finished or blocked
Simple to implement But, programs can hog the processor
At regular intervals (time slicing) Programs cannot hog processor But, complex to control so time
overhead This is the strategy in common use
37
Time slicing
Each interval is a time slice
Blocked programs (waiting for a peripheral) are not
allocated time slices
Scheduling – deciding which program runs next
38
Running programs are “processes” Processes consist of:
The program (set of instructions) Current state of data structures Current state of CPU registers Which I/O devices currently open Which files are currently open
39
Process Creation Parent processes create children
processes, which, in turn create other processes, forming a tree of processes
Resource sharing alternatives Parent and children share resources Children share subset of parent’s resources Parent and child share no resources
Execution alternatives Parent and children execute concurrently Parent waits until children terminate
40
Process states Running
During its timeslice Ready
While some other process is running Blocked
Unable to proceed e.g. waiting for input device
41
Changing Process States ready/waiting running blocked
42
Context switching with interrupts
Interrupt Signal to CPU to
stop what it is doing and execute an interrupt routine
Clock interrupt generated by clock at fixed intervals
43
Scheduling Algorithms A scheduling algorithm is the
method by which processes are given access to processor time.
e.g. Round Robin Fair Queuing FIFO
44
Lots of Scheduling Algorithms A
Anticipatory scheduling Atropos scheduler
C CFQ Critical path method
D Deadline-monotonic scheduli
ng Deficit round robin
E Earliest deadline first schedul
ing Elevator algorithm
F FIFO FINO Fair Queuing Fair-share scheduling
And so forth
45
What have we covered? Characteristics of System Software The responsibilities of Operating
System The KERNEL Uniprogramming and Multiprogramming Context Switching What makes a process How Processes are managed CPU allocation and Scheduling
Algorithms
46
Round 1Which of the following best describe
the purpose of an Operating System?
a) To make the computer easy to useb) To ensure hardware is used efficientlyc) To store data.d) To execute program instructions.
47
Round 1Which of the following best describe
the purpose of an Operating System?
a) To make the computer easy to use
b) To ensure hardware is used efficiently
c) To store data.d) To execute program instructions.
48
Round 2 Which of the following are
operating systems:1. Unix2. Visual Basic3. Pascal4. Pie Eater5. Windows6. Linux
49
Round 2 Which of the following are
operating systems:1. Unix2. Visual Basic3. Pascal4. Pie Eater5. Windows6. Linux
50
Round 3Which of the following best describe
the responsibilities of an Operating System?
a) To Manage Resourcesb) To store data.c) To execute program instructions.
51
Round 3Which of the following best describe
the responsibilities of an Operating System?
a) To Manage Resourcesb) To store data.c) To execute program instructions.
52
Round 4Which of the following best describes
the KERNEL?
a) The centre of the Operating Systemb) The part of the Operating System that
remains resident in memoryc) The execution element of the
Operating System
53
Round 4Which of the following best describes
the KERNEL?
a) The centre of the Operating Systemb) The part of the Operating System
that remains resident in memoryc) The execution element of the
Operating System
54
Round 5Which best describes
Multiprogramming Operating Systems?
a) The ability to process multiple applications at once
b) The ability to give the impression that it is processing multiple applications at once
55
Round 5Which best describes
Multiprogramming Operating Systems?
a) The ability to process multiple applications at once
b) The ability to give the impression that it is processing multiple applications at once
56
Round 6 Context Switching can best be
described as:a) Switching from one CPU to another in a Dual Core Processor
b) Saving the state of a process and loading the state of another process
c) Switching from one Multiple Simulation to the next
57
Round 6 Context Switching can best be
described as:a) Switching from one CPU to another in a Dual Core Processor
b) Saving the state of a process and loading the state of another process
c) Switching from one Multiple Simulation to the next
58
Round 7 Windows will work on an Apple
Macintosh because the computer architecture is similar.
TRUE or FALSE ?
59
Round 7 Windows will work on an Apple
Macintosh because the computer architecture is similar.
FALSE
60
Next Week Hard disc management Quiz in your seminar which is
TIMED.
You should also be working on the research in relation to your presentation assignment
61
Additional Reading O’Gorman J (2000) Operating
Systems
62
ReferencesCoustan D, Franklin C How Operating Systems Work [on-line] http://Computer.Howstuffworks.com [Accessed 10-1-2011]