CS 695
Topics in Virtualization and Cloud Computing
Spring 2019
Exercise #2
due date: 30th January 2019.The aim of this exercise is to familiarize with implementation of Linux loadable kernel modules and system calls.
In this first part, we will implement a new system call and write a loadable kernel module. Both these tasks require changes to be made in a specific manner and to specific set of files.
- Tutorial - Write a System Call
- Adding a New System Call (kernel.org)
- System CallsLinux Inside
- The Linux Kernel Module Programming Guide
- Linux Kernel Module Programming: Hello World Program (geeksforgeeks)
As part of the system call implementation, a
The hook function should be defined in a kernel module and should be loaded along with the module.
On user-level invocation of the system call the hook function should be invoked if it is available or a default message should appear. A special case has to be handled when the kernel module is removed (to handle later system call invocations).
Implement the following two functionalities as part of the hook function.
- Print/return the process ids of all process executing on the system. Compare with ps to check results.
- Assuming the system call is invoked with a pid, print the virtual memory areas/regions of the process and also the physicall pages allocated to the process.
- [lkd]. Chapters 1, 2, 3, 5, 6, 12.