0% found this document useful (0 votes)
21 views1 page

Asg 0

The document describes an assignment to measure the performance of the fork system call and a custom no-op system call named my_precious in Linux. Students are asked to implement the my_precious system call, write a benchmark program to time both calls, and submit a report with their measurements and analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Asg 0

The document describes an assignment to measure the performance of the fork system call and a custom no-op system call named my_precious in Linux. Students are asked to implement the my_precious system call, write a benchmark program to time both calls, and submit a report with their measurements and analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

E0-253: Operating Systems Programming Assignment-0

In this assignment, you are required to measure the performance of the following two system calls in Linux:

1. The fork system call


2. a blank (i.e., noop) system call (lets call it my precious)
The fork system call is available on all Linux versions–you only need to implement my precious. Your system call
is a no-argument system call and returns a long (value 0). You also need to implement a user-space micro-benchmark
(in C) to measure the timing of these system calls.

You are required to measure the execution time, in terms of CPU cycles, of both the system calls. For this task,
you are required to learn how to use the processor’s hardware performance counter (the time stamp counter) to
measure time. Do not use a user-space utility such as date or gettimeofday(). Pick a fixed memory size (e.g.,
100MB) for your micro-benchmark (performance of fork depends on program size). Report your measurements
based on multiple runs (minimum 10) along with the standard deviation. In case you observe high variation across
different runs, state: 1) what causes such variations, and 2) how would you choose a representative value to indicate
execution cycles required for a system call.
Note: The fork system call returns in two processes, the parent and the child. You should measure the timing in
both and use the lower for your measurements.

You can use any Linux distribution (e.g., Ubuntu, Fedora etc.), and either of native or virtual machine for the
assignment. You must use Linux kernel v5.0, available at:
https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.0.tar.xz
If you’re using a virtual environment, you may consider using VirtualBox, Bochs, or QEMU.

What to submit: Submit a tarball consisting of three things: 1) the kernel patch for introducing the my precious
syscall. 2) User-space program(s) used to measure the timing of system calls and 3) your report in PDF form. Use
git, a version control system, to generate the kernel patch. If you submit the entire source code of the ker-
nel (and not a patch to the base version of Linux you’re using), you will get a zero on your submission.

How to submit: Send an email consisting of the above tarball to [email protected], [email protected]
and [email protected], with subject “OS Assignment-0 Submission”. Name the tarball as your SR Number.

Due Date: 25 January, 2020.


In addition to the primary learning objectives of getting familiar with the kernel, adding a system call, and
learning how to measure performance, this homework has a few secondary (yet important) learning objectives (i.e.,
we will evaluate you on whether you’ve done these):

• Learning how to set up your working environment (be it virtual or bare metal), i.e., learning how to compile
the kernel obtain a bootable image/ramdisk, and getting your system to boot your image.
• Learning how to use a debugger to figure out the problem if your program is crashing.
• Learning to use a version control system to backup your code and using it to obtain a kernel patch (which
you’ll be submitting)

All of these learning objectives may seem rather mundane, but are time consuming if you do not have prior
experience with them. Start early!

You might also like