
ECS 150, Operating Systems Fall Quarter 2008
Program 1
Due Date: October 8, 2008 Points: 100
Do all programs on MINIX. This requires you to install the MINIX system and begin using it. That way, you can
focus on modifying the kernel for the next assignment.
Programs
1. (20 points) Write a program that prints its own process ID and its parent’s process ID.
2. (40 points) Write a program to print the numeric and symbolic names of any signals it receives. For example, if
you send the process a signal 1, it should print:
Fri Sep 19 23:34:19 2008 Received signal 1 (SIGHUP)
The program should not attempt to catch signal 9 (SIGKILL).
Hint: Look at signal(2) or sigaction(2) for the list of signal names. Also, you can run the program in the
background and send signals from the foreground to test your program.
3. (40 points) Write a program that takes the names of two files as arguments. It determines whether these files are
links to each other.
Hint: Don’t forget to check the devices that the files reside on as well as the inode numbers!
Extra Credit
1. (30 points) Write a program to determine the maximum number of simultaneous processes that MINIX will
support for a single user. Once this number is determined, any processes created to compute this number are to
be terminated. Don’t forget that the user’s shell is itself a process!
Version of September 29, 2008 at 1:06pm Page 1 of 1