Assignment 1

Instructor:
Dr. Rasit Eskicioglu
E2-574 EITC

In this warmup assignment, you will add a new system call to xv6. This system call, getsyscallinfo() will return the value of a counter, which is initially zero (0).

The new counter, syscallcnt, will be incremented each time a system call is made. This counter should be incremented before a system call made completes its execution.

Details

Your new system call should like this:

int getsyscallinfo()

It returns the number of system calls made since the system booted on success, and -1 on failure.

You will also write a simple test program to show this new system call.

Tips

Find some other system call, such as getpid() and replicate (except its name!) it first. Them modify this copied code as needed.

There should not be much code to be added, but you need to spend some time to understand the code you just copied.

Use gdb (the debugger) to help you understand the code; and to do code traces. This tool is your best friend (after me, of course!;-)

Chapters 0, 3 (and may be 4) would be useful for this assignment.

Due date

The assignment is due at 23:59:59, Sunday, January 27, 2019. The details of the submission procedure will be given in class.

Deliverables

Once completed, you will hand in the following:

  • A README text file that lists and explains the file(s) you have modified in the distribution, as well as the file(s) you have added.
  • The file(s) you have modified.
  • The file(s) you’ve added, including the test program you wrote.