View
215
Download
0
Tags:
Embed Size (px)
Citation preview
www.hope.ac.uk Deanery of Business & Computer Sciences
Computing Concepts
Week 15
A Day in the Life of an Operating System
Assignment Details
www.hope.ac.uk Deanery of Business & Computer Sciences
What this lecture covers
Groupwork and Teamwork Assignment
How to complete the Teamwork Task
www.hope.ac.uk Deanery of Business & Computer Sciences
Assignment "A Day in the Life of the Operating System"
Given an operating system which supports multiprogramming and a paged, virtual memory management system:– Consider the execution of a particular program,
from its creation as a process in the system, to its completion when the process is destroyed.
– During the lifetime of the process, the operating system will be called on many occasions.
www.hope.ac.uk Deanery of Business & Computer Sciences
Teamwork
You are required, as a team, to design, create and present a presentation that traces through the possible sequence of operating system calls.
You will explain, where appropriate, how the calls are made and interpreted.
You will consider the design options which the system designer must consider when designing the operating system.
www.hope.ac.uk Deanery of Business & Computer Sciences
Some Guidelines:
The presentation should incorporate non-technical language using analogies from everyday experience to support the explanations.
Although common thread is not essential as far as the analogies are concerned, an overarching scenario would result in a more coherent product.
www.hope.ac.uk Deanery of Business & Computer Sciences
Guidelines (2) You should use cartoon style characters as
actors in your created world or even become the actors yourselves as part of your presentation.
Look at the marking scheme, this should be used as a check list for the areas to be considered
Please refer to the agreed policy on Group Work, which can be found on Moodle.
www.hope.ac.uk Deanery of Business & Computer Sciences
Date of Submission: Week 18 seminar w/b 21st February 2011
If one team member does not turn up for class the rest of the team MUST proceed, or lose the marks. MAKE SURE YOU ALL HAVE A COPY OF THE PRESENTATION
www.hope.ac.uk Deanery of Business & Computer Sciences
Presentation is: Total Comments
Meaningfully Structured: Good Team Interaction /10 Mark sheet error, says 20%
Good Explanations of:
Process Model /10
Interrupt Processing /10
Priority Levels /10
Polling /10
Peripheral Interaction /10
Paging /10
Page Replacement Algorithms /10
Scheduling /10
Context Switching /10
Total /100
www.hope.ac.uk Deanery of Business & Computer Sciences
Library scenario – Caching
The librarian behind the desk waiting to give you your requested book. You have to ask the librarian for any book you want to read, and the librarian fetches it for you from a set of stacks in a storeroom
The librarian does not have a cache to store the books.
(Taken from HowStuffWorks by Guy Provost)
www.hope.ac.uk Deanery of Business & Computer Sciences
Library scenario – Caching The first customer requests the book Moby Dick. The librarian
goes into the storeroom, gets the book, returns to the counter and gives the book to the customer.
Later, the client returns the book which the librarian returns to the storeroom.
The next customer asks for Moby Dick The librarian returns to the storeroom to get the book he
recently handled and give it to the client. Under this model, the librarian has to make a complete round
trip to fetch every book no matter how many times it is requested. How do we improve this situation
The librarian can use a caching system.
(Taken from HowStuffWorks by Guy Provost)
www.hope.ac.uk Deanery of Business & Computer Sciences
Library scenario – Caching
We will give the librarian a mobile trolley where he will be able to store 10 books
(in computer terms, the librarian now has a 10-book cache).
On this trolley, he will put the books the clients return to him, up to a maximum of 10.
(Taken from HowStuffWorks by Guy Provost)
www.hope.ac.uk Deanery of Business & Computer Sciences
Library scenario – Caching
So now at the start of the day the trolley (cache) is empty.
Our first client arrives and asks for Moby Dick. The librarian goes to the storeroom to get the book. He gives it to the client.
When the client returns the book back to the librarian, instead of walking to the storeroom to return the book, the librarian checks to see if the cache is full and then if not puts the book on the trolley then waits for the next customer.
Another client arrives and asks for Moby Dick. Before going to the storeroom, the librarian checks to see if this title is in his trolley. He finds it! All he has to do is take the book from the trolley and give it to the client. There's no journey into the storeroom, so the client is served more efficiently.
www.hope.ac.uk Deanery of Business & Computer Sciences
Library scenario – Caching
If the client asked for a title not in the cache (the trolley) then the librarian is less efficient with a cache than without one.
The librarian takes the time to look for the book in his cache first.
If the book is found in the cache then that is a hit.
If it is not found it is a miss.
(Taken from HowStuffWorks by Guy Provost)
www.hope.ac.uk Deanery of Business & Computer Sciences
The Process Model
A process is created by loading a program into main memory and starting it.
A process consists of (among other things):– the set of instructions run by the process (the program)– the current state of the data structures built by the process
as it executes program instructions– the current state of the CPU registers (especially the
program counter)– which I/O devices are currently open– which files are currently open
www.hope.ac.uk Deanery of Business & Computer Sciences
Scheduling
Deciding which program to run next is called scheduling.
This involves:
programs waiting to run being placed in a queue and a program that has just had its turn goes to the
back of the queue.
More sophisticated operating systems might allow certain programs with higher priority to jump the queue.
www.hope.ac.uk Deanery of Business & Computer Sciences
Scheduling analogy
People queuing in the Post Office all want to pay for their TV licence and their car tax
Cashier is new and can only deal with one routine at a time.
Customers will pay for their TV licence and then go to the back of the queue.
When the first customer reaches the counter again they will then purchase their car tax.
www.hope.ac.uk Deanery of Business & Computer Sciences
Polling and Interrupt - analogy
In a hospital ward a nurse has ten beds to check
The nurse goes from bed to bed to see if the patient needs attention. Polling the beds in this way is time consuming. The patient in the last bed has to wait until all of the others have been seen. Some of them may not need attention.
Supposing the last patient needed something urgently.
www.hope.ac.uk Deanery of Business & Computer Sciences
Polling and Interrupt - analogyThe patient in the last bed is falling out of bed.
How do we deal with this situation.
Suggestions please.
We could give each patient a buzzer.
When the buzzer is pressed the nurse stores the current information (which bed she is at) and then goes directly to that bed.
After she has dealt with the interrupt she returns to where she was before the interrupt.
www.hope.ac.uk Deanery of Business & Computer Sciences
PagingPaging involves the programmer splitting the
program into manageable chunks.
Involves swapping pages between memory and disc which allows the computer to run a much larger program than would otherwise be supported.
www.hope.ac.uk Deanery of Business & Computer Sciences
Polling frequency
George is cutting the grass. He is also waiting for a telephone call and cannot hear the telephone over the sound of the mower.
What can he do?
www.hope.ac.uk Deanery of Business & Computer Sciences
He can switch off the mower from time to time and listen for the telephone ringing
Better solution:
He can fit a telephone with a light which goes on when it rings.
www.hope.ac.uk Deanery of Business & Computer Sciences
Priority Levels
Parent working in the kitchen, cooking the evening meal.
The doorbell rings (Event happens)Parent has such a bad memory that everything
has to be written down before leaving the kitchen. (context switching)
Before answering door, youngest son wants dinner money.
Oldest son needs football boots before he misses the bus.
Which is the highest priority?