Part 1:
Write an empty C program, empty.c. Then, create a copy of this program called part1.c and add
exactly four system calls to the program. You will not receive points if the program contains more or
fewer than four. The system calls available to your machine can be found within
/usr/include/unistd.h. Further, you can use the command line tool, strace, to intercept and
record the system calls called by a process.
To confirm you have added the correct number of system calls, execute the following commands:
$ gcc -o empty.x empty.c
$ strace -o empty.trace ./empty.x

$ gcc -o part1.x part1.c
$ strace -o part1.trace ./part1.x
To reduce the length of the output from strace, try to minimize the use of other function calls (e.g.
stdlib.h) in your program.
Note: Using strace on an empty C program will produce a number of system calls, so when using
strace on your Part 1 code, it should produce 4 more system calls than that.
Submit empty.c, emtpy.trace, part1.c, and part1.trace. 

Part 2
In Unix-like operating systems, time is sometimes specified to be the seconds since the Unix Epoch
(January 1st, 1970).
You will create a kernel module called my_timer that calls current_kernel_time() and stores
the time value; current_kernel_time() holds the number of seconds and nanoseconds since the
Epoch.
When my_timer is loaded (using insmod), it should create a proc entry called /proc/timer.

 When my_timer is unloaded (using rmmod), /proc/timer should be removed.
On each read you will use the proc interface to both print the current time as well as the amount of time
that’s passed since the last call (if valid).
Example usage:
$ cat /proc/timer
current time: 1518647111.760933999

 $ sleep 1
 $ cat /proc/timer
 current time: 1518647112.768429998
 elapsed time: 1.007495999

 $ sleep 3
 $ cat /proc/timer
 current time: 1518647115.774925999
 elapsed time: 3.006496001

 $ sleep 5
 $ cat /proc/timer
 current time: 1518647120.780421999
 elapsed time: 5.005496000

Testimonials

hw
We have updated our contact contact information. Text Us Or WhatsApp Us+1-(309) 295-6991