CS 3733 Operating Systems, Fall 2000 Assignment 5



Warning: This is not for the current semester.


Due Tuesday, December November 5, 2000 before class


In Assignment 4 you wrote a program to have separate processes on a machine to compile pieces of your program. You are going to do the same thing using processes on separate machines. Instead of communicating using named pipes, the communication will be over a network.

You will need at least two port numbers for this assignment. So that your port number will not conflict with those of other students, port assigmenents are listed here.

Part 1
Make a directory called assign5 for all of the files for this assignment. Get a copy of the UICI code from /usr/local/courses/cs3733/uici_source. This contains a version of UICI in which the server will not hold onto the port number after it terminates. Included are the UICI source and sample client and server code. Compile these and make sure the client and server can communicate when run on different machines.

Part 2
Start with your compile daemon from part 3 or 4 from Assignment 4. Modify it so that instead of reading information from a named pipe, it waits for a network connection on the port given as a command line argument. It will read only 2 tokens, an ID and a filename. This program is now a serial UICI server. You can test it by sending information to it using the client from Part 1.

After the compilation, it will request a connection to the same host that connected to it using the port number one greater than the port it used to listen on. This program is now acting as a client. It will send two tokens, the ID it got from the first connection followed by either a 0 for failure or a 1 for success. Both tokens should be sent as ASCII characters. After sending these tokens it will close the connection and wait for another connection request.

You can test the second part of this using the server code from Part 1.

Part 3
Convert your makeit from Assignment 4, Part 6, into a program that can communicate with your program from Part 2. Instead of reading names of named pipes, it reads the names of machines from a file called hosts. Pass on the command line the port number it should use for communication. This program is acting as a client. You can test this part independently using the server from Part 1.

Before sending anything to the remove compilers, fork a child which will listen on the port one greater than the one passed on the commnad line. This server will wait for connections from the compile daemons. As it receives information, it should display the name of the corresponding file and whether it was successful or not. After it receives all of the responses, it should then report a summary of how many successes and how many failures there were. If all were successful, it then execs the C compiler to link the object modules. Use the name of the first compiled program as the name of the executable. Use a single makefile to make and lint the parts of this assignment. Get the cover sheet from /usr/local/courses/cs3733/fall2000/cover5.ps. It indicates what is to be handed in. Provide output from each part indicating how you tested your program to convince yourself and me that it is working correctly. Be prepared to demonstrate your code on the last day of class.