Home Schedule Reading Projects People
Mac Logo Windows Logo Minix Logo Sun Solaris Logo Linux Logo

Assignment 5: Inter Process Communication (IPC): Remote Procedure Calls (25 pts)

Assignment Day September 21, 2010 (Tuesday)
Due Date September 28, 2010 (Tuesday before class)
  Email (time stamp) and Typed Hardcopy is required.

 

Read Chapter 1 (What is an OS? History, Concepts, System Calls and Structure and Summary).

Read Chapter 2 on Processes (Introduction, Overview & Implementation of Processes in MINIX, the System and Clock Task). We will cover scheduling this week and synchronization will be covered after scheduling - it is recommended to read ahead though.

For Question 1-3 : Submit a hardcopy of your code (make sure it is readable). We will grade this on conciness and correctness by inspecting you submitted code.

Note that you may need a .rhost file under you home directory, it includes authority to the machine that the 'server' accepts clients <hostname> and from what login id <loginid>.

The format for a .rhost file is:

<hostname1> <loginid1>
<hostname2> <loginid2>
.
.
.

<hostnameN> <loginidN>

The instructor's .rhost file may look like the below (login id is 'maria'):

atlas.cs.uga.edu  maria
odin.cs.uga.edu   maria
herc.cs.uga.edu   maria

Great RPC tutorial - Prof David Marshall @ Cardiff University (optional reading):
http://www.cs.cf.ac.uk/Dave/C/node33.html

On rpcgen: http://www.cs.cf.ac.uk/Dave/C/node34.html#ch:rpcgen (not you may not have permission to print on another server's Console for the printmessage tutorial).

Wikipedia: http://en.wikipedia.org/wiki/Remote_procedure_call (also check the link listed under 'external link" to the SGI Tutorial "Introduction to RPC Programming").

Question 1: Remote Procedure Calls (RPC) Compute the median (10 pts)

Modify the average RPC programs (avg.x, avg_proc.c and ravg.c) discussed last week so that it computes the median of a maximum of 100 numbers instead of the average of a maximum of 200 numbers. Test your program on odin.

The average RPC program is available here - a Makefile tested on odin is included). Just type make after installing these program on odin (make sure you have an .rhost file under your home diretory, and that 'white' space works correctly in the makefile (i.e., cut and past the makefile will not work).

For the avg program: Run the RPC server program by starting the server: ./avg_svc

For the avg program: Run the RPC client program by : ./ravg odin.cs.uga.edu 1 2 3 4

Try to use a different 'port number' than other classmates by 'uniquifying' the 22855 number given in the avg.x file. Suggesion, use the last 4 digits of you student ID number or some other unique number.

A direct link to code on atlas is given below:

ls /web/maria/public_html/classes/4730-Fall-2010/rpc

Question 2: Remote Procedure Calls (RPC): Echo RPC server (5 pts)

Write a program using remote procedure calls where the server simply echo's the word back to the client. Test your program on odin.

Question 3: Remote Procedure Calls (RPC): Sort numbers (10 pts)

Modify the average RPC program so that the server sends back a list of 'sorted' numbers to the client either in descending or ascending order given by an input parameter when invoking the client, e.g., the word "ascending:, "descending" (or just -a, -d).