Homework #1

CMPS 111, Fall 2007

Assigned: October 11th
Due: Thursday, October 18th at 10 PM

Please read the general homework page for guidelines and submission information. Homework must be submitted online.

All work on this homework must be your own. Please read (and follow!) the academic honesty policy for this class.

  1. A computer has a pipeline with four stages. Each stage takes the same time time to do its work—0.4 ns (nanoseconds). How many instructions can this machine execute per second?
  2. Which of the following operations should be allowed only in kernel mode? Briefly explain your decision for each one.
    1. Cause a trap
    2. Enable all interrupts
    3. Read the memory map for the current process
    4. Write the time-of-day clock
    5. Receive a packet of data from the network
    6. Restart the computer
  3. What is the difference between the following two function calls? Assume that str is a properly null-terminated string. Also, file descriptor 2 (in Unix) is the same as the stdio file stderr. HINT: what does the operating system do for each function?
    fprintf (stderr, %s, str);
    write (2, str, strlen (str));
  4. While there are many different processor architectures, most desktop computers and servers use the Intel x86 architecture. From the point of view of operating systems, what are the advantages to this approach? Are there any disadvantages?
  5. List some differences between personal computer operating systems and server operating systems. Is this difference disappearing? Why might that be?
  6. For each of the following system calls, give a condition that causes it to fail:
    1. read()
    2. write()
    3. dup()
    4. fork()
    5. execvp()
    6. stat() [get information about a file]
  7. There are several different approaches to operating system design.
    1. Describe one advantage the monolithic modular approach has over the microkernel approach.
    2. Describe one advantage the microkernel approach has over the monolithic modular approach.
    3. If security is a bigger concern than speed (as it perhaps is today), which operating system design approach would you choose?
  8. Here are some questions for practicing unit conversions:
    1. How long is a microyear in seconds?
    2. If a car is traveling 25200 miles per fortnight, fast is it traveling in inches per second?
    3. Micrometers are called microns. How long is a gigamicron?
    4. How many bytes are there in 1 terabyte of memory?
    5. The mass of the earth ia 6000 yottagrams. What is that in kilograms?

Last updated 11 Oct 2007 by Ethan L. Miller