add a new system call to the Linux kernel
$30-250 USD
Paid on delivery
For this project, you are required to write a system call which makes a process invisible, i.e.
the process is not listed in the /proc file system and thus cannot be seen using “ps” or
“top”. The prototype for your system call will be
long set_invisibility(pid_t pid, int flag);
The flag can be 0 (for OFF) or 1 (for ON). The system call turns the invisibility of a
process (given by its pid) OFF or ON based on the value of the flag. Only processes with root
privileges can successfully execute this system call. The call returns 0 on success and -1 on
failure.
To achieve this, you need to:
1. Add a new field to the task descriptor. The name and type of the field is:
int invisible;
(Note: This field should be added to the end of the task descriptor.)
If invisible=0 process is visible
If invisible=1 process is invisible
2. Modify the code used by the kernel when creating and initializing new processes.
(Note: A newly created process should have its invisible field initialized to 0.)
3. Write a system call which sets the invisibility field in the task descriptor if the caller
process has root privileges.
4. Add your system call to the kernel.
5. Modify the code that generates the /proc filesystem so that if the invisible field
of a process is set, it is not included.
6. Recompile the kernel.
7. Write a short test program that accepts the pid of the process and the invisibility status
information as input and makes the set_invisibility system call. The test
program should output the return value of the system call. Experiment by running the
program with and without root privileges.
Project ID: #558608