ECS150 TA Website

last updated
Homework 1

General Information

You can find the original homework document here. The homework due date has been extended to 12:00 noon, Saturday October 18th.

Handin Information

Remember that you need a Makefile and Readme for the programming portion of the homework. You may have one for each program, or a combined Makefile and Readme for both programs. The source code (and other required files) for both programs should be saved to your virtual floppy drive (fd1) in Minix. To hand in your code, simply hand in a compressed version of floppy.img. (For help with the virtual floppy, please see the 'Using Minix' section.)

You also have to turn in answers to the first four questions. You may put these answers in a simple text file. PDF files are also permitted. (You can save your answers to the virtual floppy, or hand in a separate file from floppy.img.) Please have everything named such that we can easily find your answers and source code!

The homework handin procedure can be found in the 'General Info' section. Here are the specific commands you will need for this assignment:

Compression: tar czvf homework1.tar.gz [file_list]
Submission: handin cs150 hw1 homework1.tar.gz
Verify Submission: handin cs150 hw1

where [file_list] is a space-separated list of the files you want to turn in. Please do not forget to compress floppy.img before submitting!

Grading Information

To receive full credit, you must:
  1. Hand in all necessary files on time
  2. Have answers to the first four questions completed
  3. Have program 1 and program 2 working properly
  4. Include a Makefile and Readme for the programs
  5. Properly commented code
Also, please remember that you must independently write and test your own code. (Discussion is allowed during the program design phase, and to help others debug code.)

Homework Clarification

Questions 1 - 4
  • For question 3, see mpx386.s, on page 596.
Program 1
  • To be safe, please state in your Readme what processes you are or are not accounting for in your final process total. For example, are you including init in your final total? What about the parent process? The user shell?
Program 2
  • You do not need to worry about symbolic links.
  • You do not need to worry about hidden files.
  • Make sure to print directory names in addition to file names.
  • Treat links (hard links) the same as files (just print out full path name to link).

Homework Hints & Tips

Program 1
  • Include the line #define _POSIX_SOURCE 1 to prevent getting the warning implicit declaration of function kill. (See Eric's response to post 'implicit declaration of kill?' on the newsgroups.)
  • Without comments, program 1 will be somewhere around 30 lines of code or more. (This is a very rough estimate.)
Program 2
  • If you type man ln in Minix, it will provide a description of hard links. Handle hard links just as you would any other file.
  • To get the absolute pathname from a relative pathname, you might want to try using chdir and getcwd. Refer to the man pages for more information. (See the 'pathname' post on the newsgroups.)
  • Without comments, program 2 will be somewhere around 100 lines of code or more. (This is a very rough estimate.)
  • For examples that may help with this program, see these lecture notes.