620 likes | 756 Views
Computer Systems 2009-2010. Week 12: System Software Alma Whitfield. 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. Need for system software.
E N D
Computer Systems2009-2010 Week 12: System Software Alma Whitfield
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
Need for system software • Computers very complex • Come with large bundles of software to help the non-specialist • This software is called system software
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.
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
What an operating system does Just like mother Teenager does not know how to operate toaster etc .. … but mother does
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
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?
What an operating system does Who is mother Operating system Who is the teenager Application program
Tasks carried out by an operating system Running programs Managing files Managing main memory Controlling peripherals Utility programs
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
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
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
Controlling peripherals • Operating system • includes • kernel • drivers • Drivers • plug and play
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
Utility programs • Editors • Clock • Calculator • Calendar • Whatever else those nice guys at Microsoft can think of
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
Do we need an Operating System? Is the statement below True or False ? • You can’t use a computer without an Operating System!
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
Studying the tasks carried out by an operating system Running programs Managing files Managing main memory Controlling peripherals Utility programs
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
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
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
Programming with a femaleoperating system The girls organise the loading and running of programs. They are effectively the 1940s version of the modern operating system http://www.berkeleyprep.org/webhouse/bh/html/histpic.htm
ENIAC (Electronic NumericalIntegrator and Computer) 1946 Men occasionally involved as well!
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
Multiprogramming • Multiple users accessing the same data • e.g. bank system • Single user running several programs at the same time • e.g. Windows PC
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?
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
Sharing the processor • Original problem: • expensive , fast CPU waiting for slow peripherals – uneconomic • Solution • have CPU run another program while waiting
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
Disadvantages • Breakdowns affect everybody • Portability – need link to central machine • Expense – but getting cheaper • Security risks
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
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
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
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
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
Process states • Running • During its timeslice • Ready • While some other process is running • Blocked • Unable to proceed e.g. waiting for input device
Changing Process States • ready/waiting • running • blocked
Context switching with interrupts • Interrupt • Signal to CPU to stop what it is doing and execute an interrupt routine • Clock interruptgenerated by clock at fixed intervals
Scheduling Algorithms • A schedulingalgorithm is the method by which processes are given access to processor time. • e.g. • Round Robin • Fair Queuing • FIFO
Lots of Scheduling Algorithms • A • Anticipatory scheduling • Atropos scheduler • C • CFQ • Critical path method • D • Deadline-monotonic scheduling • Deficit round robin • E • Earliest deadline first scheduling • Elevator algorithm • F • FIFO • FINO • Fair Queuing • Fair-share scheduling And so forth
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
Round 1 Which of the following best describe the purpose of an Operating System? • To make the computer easy to use • To ensure hardware is used efficiently • To store data. • To execute program instructions.
Round 1 Which of the following best describe the purpose of an Operating System? • To make the computer easy to use • To ensure hardware is used efficiently • To store data. • To execute program instructions.
Round 2 • Which of the following are operating systems: • Unix • Visual Basic • Pascal • Pie Eater • Windows • Linux
Round 2 • Which of the following are operating systems: • Unix • Visual Basic • Pascal • Pie Eater • Windows • Linux
Round 3 Which of the following best describe the responsibilities of an Operating System? • To Manage Resources • To store data. • To execute program instructions.