UPMC-Paris6 - M1 SAR 2015-2016 - PNL-4I402 Project
-
list
-
fg <id >
-
kill <signal> <pid>
-
wait <pid> [<pid> ...]
-
meminfo
-
modinfo <name>
Project will implement a character driver module for Linux kernel, and a client allowing interaction
Client is invoked :
$ client <option>
Options | Description |
---|---|
list |
Shows runnig stuff |
fg <id> |
Blocking till <id> completes. Recovers exit status. |
kill <signal> <pid> |
Sends <signal> to <pid> using kill_pid kernel method |
wait <pid> [<pid> ...] |
Blocking till <pid> completes, recovers pid and exit status |
meminfo |
Prints info about memory, similar to /proc/meminfo using si_meminfo and si_swapinfo |
modinfo <name> |
Prints info (author, version, parameters, address) about kernel module <name> |
All driver requests are passed via ioctl
function.
void meminfo ()
{
infos i;
if (ioctl(fd, MEMINFO, &i) == -1)
perror("meminfo : IOCTL");
printf "Memory info" + i.stuff
}
Request code | Description | Client calls by |
---|---|---|
LSRCMS |
LiSt Running CoMmandS | list |
FG |
Awaits end of com<id> returning its return code. Blocking. |
fg <id> |
KILL |
Sends signal via kill_pid |
kill <signal> <pid> |
WAIT |
Wait for a process | wait <pid> [<pid> ...] |
MEMINFO |
Get memory info | meminfo |
MODINFO |
Get module info | modinfo <name> |
Before compiling please do provide path to 4.2.3 kernel in /module/Makefile
under KERNELDIR
.
Then, simply run :
$ make
$ insmod kercli.ko
$ rmmode kercli
This project is licensed under the MIT License.