Skip to content

Your first kernel mod v2

petersenna edited this page Mar 23, 2012 · 12 revisions

BUILD INSTRUCTIONS


The source files were tested under Fedora 15 and Fedora 17 Alpha. Full instructions on creating custom Kernel packages for Fedora at: http://fedoraproject.org/wiki/Docs/CustomKernel

Short version: http://goo.gl/eIaUe

After installing the tools, getting the source, preparing the source for building, edit kernel.spec file to change the build name, and to configure it to apply the patch.

Spec: https://github.com/petersenna/Kernel/tree/master/yfkm2/spec

Patch: https://github.com/petersenna/Kernel/tree/master/yfkm2/patch

Use rpmbuild to generate the custom kernel RPMS.

Install the new generated packages: kernel, kernel-header, and kernel-devel.

Reboot.

Go to samples/yfkm2/userspace. Type make. Note that this will not work until the newly generated kernel-devel, and kernel-headers packages are installed.

Testing

Open two terminal windows on the machine that are running your custom Kernel. On terminal #1 run top command.

On terminal #2:


    $ ps aux |grep top
    peter      660  1.6  0.0  15240  1336 pts/0    S+   21:37   0:00 top
    peter      682  0.0  0.0 109364   916 pts/1    S+   21:37   0:00 grep --color=auto top`

Find what is pid of top. It is 660 on example above.

On terminal #2: Go to samples/yfkm2/userspace dir and call monitor then notifyme.


$ ./monitor 660
Sucess on adding 660!

$ ./notifyme 660
Sucess on adding 660!
Finish 660 to see what happens to me.

Now go to terminal #1 and exit top by pressing 'q'. And watch what happens to the notifyme application on terminal #2:


$ ./notifyme 660
Sucess on adding 660!
Finish 660 to see what happens to me.
Killed
 
$
Clone this wiki locally