Project 1 Grading

55 points total


  1. Shell source code (15)


  1. Syscall/kernel source code (15)


  1. A description of the Linux source files you changed and why you had to change them. (4)


  1. Documentation for your new system call (3)


  1. A transcript showing you using your new shell to invoke the /bin/date program, the /bin/cat program, and the exit and cd commands supported by your shell. (2)


  1. Results from calling /usr/bin/find /etc -type f -exec touch t ; (3)


  1. A brief write-up with the answers to the following questions.
    1. Describe how you found the information needed to complete this project. Did it have the information you needed? Did you consult with any humans? If so, what did you try first and who did you consult with? (1)

Any answer you gave was fine as long as it explained where you found some information.

    1. Explain the calling sequence that makes your system call work. First, a user program calls <.....>. Then, <.....> calls <.....>. ... and so on. You can explain this using either text or a rough (less than 15 minutes) diagram. (2)

1.      First, a user program calls the syscall function: syscall(__NR_execcounts, param1, param2).

2.      The syscall function causes an interrupt.

3.      The process finds the syscall indexed at __NR_execcounts in the interrupt table in entry.S.

4.      The entry in the interrupt table directs the process to the actual implementation of that syscall and runs the code.


    1. Why do you think the designers of Linux implemented system calls the way they did? What were they trying to achieve? What were they trying to avoid? (2)

They were probably trying to make the OS very secure and efficient.

    1. Give (in 1-2 sentences) an alternative idea for implementing system calls. State one way your idea would be better or worse than the way it is currently done. (2)

Any reasonable answer that had a little thought put into it was fine.

    1. gotos are generally considered bad programming style, but these are used frequently in the Linux kernel, why could this be?  This is a thinking question, so justification is more important than your answer. (2)

Gotos are more efficient and can produce code that is easier to read (i.e. error checking).

    1. What is the difference between the "clone" and "fork" system calls? (2)

Clone creates a child process that can share some of its memory space with the parent process while fork gives the child process a completely separate memory space.

    1. How could you extend your shell to support multiple simultaneous processes (foreground and background...)? (2)

Donít make the parent process wait for the child process to finish.