Transcript ex1.00

Exercise 1
Operating Systems : Coursework 1
• Task : To annotate a program which emulates the behaviour of a
Distributed Virtual Memory system.
• Background : A Distributed Virtual Memory system is one in which a
number of networked computers can concurrently execute a program
using the same Virtual Address space, shared between them.
The motivation is to improve the execution speed of running a program
by using more than one processor. In this arrangement, however, the
processors are only loosely interconnected, rather than tightly connected
as in a dual, 4-way or 8-way etc. processor system, in which the
processors are on the same mother board and connected by means of a
system bus.
This program, running on one machine, emulates the distributed
processors by means of a single process for each processor, each of
which is forked from a parent process. Sockets are used to interconnect
them just as they would be in a real system. System Calls are used to
create the control environment which supports the emulation. Threads
and signals are used to manage the shared and paged virtual memory
space. Pages are `owned’ by one process at a time. If a process
causes a the equivalent of a page-fault because it does not currently
have access to a page, its environment endeavours to fetch the page
from the process which does own it by means of a request and response
protocol.
The program was written very carefully to ensure that it was correct.
Compiling and running the program will help you to understand how it
works :
• Source Program file : /home/cs3/os/dvme.c
• Compilation Command : gcc dvme.c -lpthread -o dvme
1
Exercise 1
• Details : Most of the comments have been removed from this source file!
Your task is to put comments back in to explain how the emulation works in
detail, including particularly the page request and response protocol and the
‘barrier synchronisation’ implementation. Why do they have to be as
complex as they are? A large comment at the top is probably appropriate to
give a general overview of the approach. Other appropriate places for your
comments are indicated throughout the source by lines such as
// why??
You should also include at the beginning brief explanations in your own
words of the System Calls that are used (not just copies of ‘man’ pages).
You may modify the program in any way you think fit in order to test your
theories as to how it works, but what you submit must be an annotated
version of the original source file, not your modified version.
• Submission : Send your annotated source file to me by email at
[email protected]. Please send it as a straight in-line text message rather
than as an attachment. It must include a comment at the top which tells me
your name and the location of the source file in your home directory, which
you should keep intact.
• Deadline : 5pm, Monday 20th November
• Warning : Your submission must be entirely your own work.
2